Date: Wed, 8 Dec 1999 08:33:48 -0800 From: Arun Sharma <adsharma@sharmas.dhs.org> To: Andrzej Bialecki <abial@webgiro.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Fwd: Re: kstat - an API for gathering kernel stats Message-ID: <19991208083348.A29811@sharmas.dhs.org> In-Reply-To: <Pine.BSF.4.05.9911291007170.4405-100000@freja.webgiro.com>; from Andrzej Bialecki on Mon, Nov 29, 1999 at 10:09:35AM %2B0100 References: <199911290505.VAA01931@c62443-a.frmt1.sfba.home.com> <Pine.BSF.4.05.9911291007170.4405-100000@freja.webgiro.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Nov 29, 1999 at 10:09:35AM +0100, Andrzej Bialecki wrote: > > 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. Thanks - that was useful. However, I noticed that only the leaves (SYSCTL_INT/LONG/STRING) etc can be dynamically created. But nodes can't be dynamically created. Am I correct ? I'm interested in doing something like: kern.stats.cpu0.idle kern.stats.cpu0.nice ... kern.stats.cpu1.idle kern.stats.cpu1.nice ... and I want the nodes cpu0, cpu1 etc dynamically created. But that's no big deal. I'll define 4 cpus for now and zero the values for non-existent cpus. -Arun To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991208083348.A29811>