> Hi,
> can anybody post a kstat output of a multicore machine running Solaris
> 10? I need to know if the enumeration of cpu_stat/instance is consistent
> with cpu/sys/instance. intrstat, cpustat, and cpuinfo look consistent,
> but I really would like to know for sure.
A complete output would be rather large, but basically:
module = cpu
instance = processor_id
name = intrstat/sys/vm
% kstat -m cpu | grep -v '^ '
module: cpu instance: 0
name: intrstat class: misc
module: cpu instance: 0
name: sys class: misc
module: cpu instance: 0
name: vm class: misc
module: cpu instance: 1
name: intrstat class: misc
module: cpu instance: 1
name: sys class: misc
module: cpu instance: 1
name: vm class: misc
For "kstat -m cpu -n sys" exist a second structure with almost the same
content. It is just named differently:
module = cpu_stat
instance = processor_id
name = cpu_stat%d (%d = processor_id)
% kstat -m cpu_stat|grep -v '^ '
module: cpu_stat instance: 0
name: cpu_stat0 class: misc
module: cpu_stat instance: 1
name: cpu_stat1 class: misc
Quote:> Unfortunately the instances of cpu_stat are not enumerated sequentally
> on multicore cpus which makes collecting the information a bit tricky,
> when one consideres that a cpu could be turned off during this process.
> Does anybody know, if there is an upper limit of instances. kstat_lookup
> takes an int, which is a pretty long way to go, if a cpu got turned off.
Just iterate through all cpu_stat%d entries. Or call
sysconf(_SC_CPUID_MAX)
to know up to which instance number you have to iterate. Remember there
may be holes in the processor numbering, esp. on SPARC.
--
Daniel