Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Apr 2006 21:50:21 +0000
From:      Marco van Tol <marco@tols.org>
To:        freebsd-hackers@freebsd.org
Cc:        Marco van Tol <marco@tols.org>
Subject:   Per CPU cpu-statistics under SMP
Message-ID:  <20060412215021.GB1146@tols.org>

next in thread | raw e-mail | index | archive | help
Hi there,

My apologies if this is the wrong list to ask this kind of question.
I would appreciate a pointer to the correct list if it is please. :)

I noticed in the code for gkrellm /usr/ports/sysutils/gkrellm2 that SMP
per-cpu statistics were not yet supported under FreeBSD, and decided to
check whether I could add that.  (I'm running a (dual-core) Athlon64 X2
with FreeBSD 6.1-PRERELEASE)
I can't find sample code and/or documentation on how to acquire that
information from the kernel.

I checked
- gkrellm2 itself, which uses kern.cp_time in <gkrellm>/src/sysdeps/freebsd.c
- top, which also uses kern.cp_time in /usr/src/usr.bin/top/machine.c

Some browsing around the internet doesn't get me much further either
unfortunately.  I keep hitting the per-cpu statistics mentioned with regard
to uma(9).

Under linux this can be acquired via /proc/stat. (And gkrellm looks realy
funky with per-cpu stats, but that may or may not be relevant depending on
the reader of this mail I guess ;)

Is there an interface under FreeBSD to acquire the necessary per-cpu
statistics?

Thank you very much in advance, appreciated,

Marco van Tol

-- 
Gisteren is het niet gelukt.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060412215021.GB1146>