Date: Wed, 19 Apr 2000 11:13:25 -0400 (EDT) From: Zhihui Zhang <zzhang@cs.binghamton.edu> To: Andrzej Bialecki <abial@webgiro.com> Cc: freebsd-hackers@freebsd.org Subject: Re: NFS attribute cache & profiling sysctl variables Message-ID: <Pine.SOL.4.21.0004191102150.26080-100000@sol.cs.binghamton.edu> In-Reply-To: <Pine.BSF.4.20.0004161426460.36690-100000@mx.webgiro.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 16 Apr 2000, Andrzej Bialecki wrote: > On Sat, 15 Apr 2000, Zhihui Zhang wrote: > > > > > I have two unrelated questions I can not figure out myself: > > > (2) I am trying to display kernel profiling sysctl variables with sysctl > > -a or sysctl -A without success. They are defined in subr_prof.c. Why > > sysctl command can not display them? I can use kgmon. > I spend some time on this. It turns out that you can not do a sysctl() on a node without a handler. For the case of kern.prof, there is a handler, but that handler - sysctl_kern_prof() - only allows you to access lower level variables. When you do sysctl -a or sysctl -A, you use the special {0,2, ..} names to get the next oids in the MIB tree. In the routine sysctl_sysctl_next_ls(), you can see that a node with a handler is skipped by the following statements: if ((oidp->oid_kind & CTLTYPE) != CTLTYPE_NODE) continue; if (oidp->oid_handler) continue; That is why you can not show kern.prof stuff with command sysctl -a or sysctl -A. You have to use the way shown in usr.sbin/kgmon/kgmon.c. -Zhihui 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?Pine.SOL.4.21.0004191102150.26080-100000>