Date: Mon, 29 Nov 1999 10:09:35 +0100 (CET) From: Andrzej Bialecki <abial@webgiro.com> To: Arun Sharma <adsharma@sharmas.dhs.org> Cc: freebsd-hackers@freebsd.org Subject: Re: Fwd: Re: kstat - an API for gathering kernel stats Message-ID: <Pine.BSF.4.05.9911291007170.4405-100000@freja.webgiro.com> In-Reply-To: <199911290505.VAA01931@c62443-a.frmt1.sfba.home.com>
index | next in thread | previous in thread | raw e-mail
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 <mike@smith.net.au> 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
// <abial@webgiro.com> 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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.9911291007170.4405-100000>
