Re: Fwd: Re: kstat - an API for gathering kernel stats

1999-12-08 Thread Dan Seguin
Is it possible to make nodes dynamically that are immutable from userland (even by root), but modifyable from the kernel? On Mon, 29 Nov 1999, Andrzej Bialecki wrote: Yes. See for example linux emulator or my SPY module: http://www.freebsd.org/~abial/spy You can also create

Re: Fwd: Re: kstat - an API for gathering kernel stats

1999-12-08 Thread Andrzej Bialecki
On Wed, 8 Dec 1999, Dan Seguin wrote: Is it possible to make nodes dynamically that are immutable from userland (even by root), but modifyable from the kernel? Yes, of course. Just mark them as read-only (CTLFLAG_RD). You are free to assign any value to them within the kernel. If it's more

Re: Fwd: Re: kstat - an API for gathering kernel stats

1999-12-08 Thread Arun Sharma
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

Re: Fwd: Re: kstat - an API for gathering kernel stats

1999-12-08 Thread Andrzej Bialecki
On Wed, 8 Dec 1999, Arun Sharma wrote: 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

Re: Fwd: Re: kstat - an API for gathering kernel stats

1999-12-08 Thread Arun Sharma
On Wed, Dec 08, 1999 at 05:44:31PM +0100, Andrzej Bialecki wrote: On Wed, 8 Dec 1999, Arun Sharma wrote: Erhm.. No. Look closer at the SPY module. I create the whole branch from the root level. In the standard system there is no such thing as "kld" node, neither there is a "spy" node. I

Re: Fwd: Re: kstat - an API for gathering kernel stats

1999-12-08 Thread Matthew N. Dodd
On Wed, 8 Dec 1999, Arun Sharma wrote: 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. It would be better

Re: Fwd: Re: kstat - an API for gathering kernel stats

1999-12-08 Thread Louis A. Mamakos
On Wed, 8 Dec 1999, Arun Sharma wrote: 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. It would be better

Re: Fwd: Re: kstat - an API for gathering kernel stats

1999-11-29 Thread Andrzej Bialecki
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 [EMAIL PROTECTED] wrote: I don't see any examples in

Re: kstat - an API for gathering kernel stats

1999-11-04 Thread Matthew Jacob
Well, this is welcome news- Bonwick's kstat from solaris was and is an excellent tool. I look forward to using your version. To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-hackers" in the body of the message

Re: kstat - an API for gathering kernel stats

1999-11-04 Thread Alex Zepeda
On Thu, 4 Nov 1999, Matthew N. Dodd wrote: On Wed, 3 Nov 1999, Arun Sharma wrote: A user program makes a system call with this string "cpu.system" to get the current value of user/system/nice time etc. How is this different from doing: # sysctl -a | grep load vm.loadavg: { 0.15 0.09

Re: kstat - an API for gathering kernel stats

1999-11-04 Thread Mike Smith
I wrote kstat as a way to improve on the current BSD method of getting kernel statistics, which involves looking up a particular kernel symbol name and then getting the value from the symbol offset. This makes any performance monitoring tool or an application that gets kernel stats

kstat - an API for gathering kernel stats

1999-11-03 Thread Arun Sharma
I wrote kstat as a way to improve on the current BSD method of getting kernel statistics, which involves looking up a particular kernel symbol name and then getting the value from the symbol offset. This makes any performance monitoring tool or an application that gets kernel stats non-portable

Re: kstat - an API for gathering kernel stats

1999-11-03 Thread Matthew N. Dodd
On Wed, 3 Nov 1999, Arun Sharma wrote: A user program makes a system call with this string "cpu.system" to get the current value of user/system/nice time etc. How is this different from doing: # sysctl -a | grep load vm.loadavg: { 0.15 0.09 0.04 } Ideally we could have a syscall that could

Re: kstat - an API for gathering kernel stats

1999-01-04 Thread Doug Rabson
On Thu, 4 Nov 1999, Arun Sharma wrote: On Thu, Nov 04, 1999 at 09:31:02PM -0600, Chris Costello wrote: On Thu, Nov 04, 1999, Arun Sharma wrote: Can a loadable module, say a network driver register variables with sysctl ? Can sysctl itself be made a loadable module ? As for the speed,

Re: kstat - an API for gathering kernel stats

1999-01-04 Thread Doug Rabson
On Fri, 5 Nov 1999, Mike Smith wrote: On Thu, 4 Nov 1999, Mike Smith wrote: Sysctl is faster than kstat once you have performed the name-oid lookup. There is basically nothing that kstat can do that sysctl can't do better and faster, apart from lookup-by-name. Except for

Re: kstat - an API for gathering kernel stats

1999-01-03 Thread Mike Smith
On Thu, 4 Nov 1999, Mike Smith wrote: Sysctl is faster than kstat once you have performed the name-oid lookup. There is basically nothing that kstat can do that sysctl can't do better and faster, apart from lookup-by-name. Except for dynamic registration right? No, Peter fixed that

Re: kstat - an API for gathering kernel stats

1999-01-03 Thread Peter Wemm
Mike Smith wrote: On Thu, 4 Nov 1999, Mike Smith wrote: Sysctl is faster than kstat once you have performed the name-oid lookup. There is basically nothing that kstat can do that sysctl can't do better and faster, apart from lookup-by-name. Except for dynamic registration

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Matthew N. Dodd
On Thu, 4 Nov 1999, Alex Zepeda wrote: On Thu, 4 Nov 1999, Matthew N. Dodd wrote: On Wed, 3 Nov 1999, Arun Sharma wrote: A user program makes a system call with this string "cpu.system" to get the current value of user/system/nice time etc. How is this different from doing: #

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Ronald G. Minnich
FWIW -- I think a reasonable goal of "getting stats out of the kernel" is that pulling data out ought to run as fast as bcopy, and it would be nice if you didn't have to drop into a syscall. Kind of an extreme position, I guess, but if you have ever seen the rstatd on linux eat 12% of cpu to

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Arun Sharma
On Thu, Nov 04, 1999 at 02:53:51AM -0500, Matthew N. Dodd wrote: On Wed, 3 Nov 1999, Arun Sharma wrote: A user program makes a system call with this string "cpu.system" to get the current value of user/system/nice time etc. How is this different from doing: # sysctl -a | grep load

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Matthew N. Dodd
On Thu, 4 Nov 1999, Arun Sharma wrote: I just looked at the sysctl implementation and there are some differences. Moreover, since it was not being used in tools like vmstat and xosview, I thought there must be a reason. sysctl also seems to assume that it doesn't get called frequently. So

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Ricardo Bernardini
Original Message Follows From: Mike Smith [EMAIL PROTECTED] You can add "counters" with sysctl. You can also add read/write variables of any type. You can add them dynamically at runtime? How do you know which counters are available at a given time? One thing that puzzles me; you say

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Chuck Youse
Such an interface, for generic userland statistical gathering, need not be [and thus should not be] implemented via a kernel-land system call. bloat, bloat, bloat. Chuck On Thu, 4 Nov 1999, Ricardo Bernardini wrote: Original Message Follows From: Mike Smith [EMAIL PROTECTED] You

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Arun Sharma
On Thu, Nov 04, 1999 at 12:52:50PM -0500, Matthew N. Dodd wrote: On Thu, 4 Nov 1999, Arun Sharma wrote: I just looked at the sysctl implementation and there are some differences. Moreover, since it was not being used in tools like vmstat and xosview, I thought there must be a reason.

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Mike Smith
Original Message Follows From: Mike Smith [EMAIL PROTECTED] You can add "counters" with sysctl. You can also add read/write variables of any type. You can add them dynamically at runtime? How do you know which counters are available at a given time? The same way you do it

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Mike Smith
--vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii On Thu, Nov 04, 1999 at 12:52:50PM -0500, Matthew N. Dodd wrote: On Thu, 4 Nov 1999, Arun Sharma wrote: I just looked at the sysctl implementation and there are some differences. Moreover, since it was not being used in

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Arun Sharma
On Thu, Nov 04, 1999 at 06:30:01PM -0800, Mike Smith wrote: Sysctl is faster than kstat once you have performed the name-oid lookup. There is basically nothing that kstat can do that sysctl can't do better and faster, apart from lookup-by-name. Can a loadable module, say a network driver

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Mike Smith
On Thu, Nov 04, 1999 at 06:30:01PM -0800, Mike Smith wrote: Sysctl is faster than kstat once you have performed the name-oid lookup. There is basically nothing that kstat can do that sysctl can't do better and faster, apart from lookup-by-name. Can a loadable module, say a network

Re: kstat - an API for gathering kernel stats

1999-01-02 Thread Matthew N. Dodd
On Thu, 4 Nov 1999, Mike Smith wrote: Sysctl is faster than kstat once you have performed the name-oid lookup. There is basically nothing that kstat can do that sysctl can't do better and faster, apart from lookup-by-name. Except for dynamic registration right? -- | Matthew N. Dodd |