From owner-freebsd-hackers Mon Nov 29 1: 8:49 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from freja.webgiro.com (freja.webgiro.com [212.209.29.10]) by hub.freebsd.org (Postfix) with ESMTP id 7285914E19 for ; Mon, 29 Nov 1999 01:08:47 -0800 (PST) (envelope-from abial@webgiro.com) Received: by freja.webgiro.com (Postfix, from userid 1001) id 273981927; Mon, 29 Nov 1999 10:09:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by freja.webgiro.com (Postfix) with ESMTP id 263C249EC; Mon, 29 Nov 1999 10:09:35 +0100 (CET) Date: Mon, 29 Nov 1999 10:09:35 +0100 (CET) From: Andrzej Bialecki To: Arun Sharma Cc: freebsd-hackers@freebsd.org Subject: Re: Fwd: Re: kstat - an API for gathering kernel stats In-Reply-To: <199911290505.VAA01931@c62443-a.frmt1.sfba.home.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 28 Nov 1999, Arun Sharma wrote: > > [ For some reason, this post through muc.lists.freebsd.hackers gateway didn't > show up on the mailing list. Forwarding it to the mailing list.. ] > > On Thu, 04 Nov 1999 20:38:50 -0800, Mike Smith wrote: > > > I don't see any examples in sys/modules. The SYSCTL_INT macros eventually > > > expands to DATA_SET which puts certain data in a different ELF section. > > > > You don't do anything magic at all; it's handled invisibly by the > > kernel linker. > > I was thinking about implementing SMP cpu stats using sysctl today and > I have a question - can I create sysctl nodes dynamically ? > > i.e. > > for (cpu = 0; cpu < get_num_cpus(); cpu++) { > /* create sysctl node here ? */ > } Yes. See for example linux emulator or my SPY module: http://www.freebsd.org/~abial/spy You can also create whole new branches, as the second example shows. Andrzej Bialecki // WebGiro AB, Sweden (http://www.webgiro.com) // ------------------------------------------------------------------- // ------ FreeBSD: The Power to Serve. http://www.freebsd.org -------- // --- Small & Embedded FreeBSD: http://www.freebsd.org/~picobsd/ ---- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message