Date: Sun, 28 Nov 1999 21:05:14 -0800 From: Arun Sharma <adsharma@c62443-a.frmt1.sfba.home.com> To: freebsd-hackers@freebsd.org Subject: Fwd: Re: kstat - an API for gathering kernel stats Message-ID: <199911290505.VAA01931@c62443-a.frmt1.sfba.home.com>
next in thread | raw e-mail | index | archive | help
[ 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 ? */ } Also, one simple solution to maintaining per cpu stats is to put the whole thing in struct globaldata. All existing code remains unchanged and automagically updates the per cpu stats. I may need to add some additional variables, which reflect system wide data. Now, if I put stuff in globaldata and try to export it using sysctl, things get a little more complex. One solution to the above problem is to use SMPpt relative addresses in the sysctl declarations. But given that the number of CPUs is known only at runtime, we come back to the first question in this mail. -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?199911290505.VAA01931>