cooltst.ksh:/usr/sbin/cpustat: not found
Hi,
I played aroud a bit with the cooltst tool on a V210 (sparc)
SunOS hostname 5.9 Generic_117171-12 sun4u sparc SUNW,Sun-Fire-V210
When examening the logfiles I noticed a lot of
"/usr/sbin/cpustat: not found" lines in
/tmp/000/hostname/NM_cpustat_out
This message is not displayed on stdout of stderr. It might be wise to change that behaviour in a next release.
However..it is a correct message because /usr/sbin/cpustat was not available on the system. When trying to fix this I ran into new troubles
I used pkgadd to install SUNWcpcu and SUNWcpcux
now usr/sbin/cpustat is available:
# ls -l /usr/sbin/cpustat
-r-xr-xr-x1 rootbin14892 Apr 7 2002 /usr/sbin/cpustat*
but when running it:
#/usr/sbin/cpustat
cpustat: CPU performance counters are inaccessible on this machine
cpustat: CPU performance counter hardware not available on this machine.
manpage had some info on this error, but that's to me of no use to solve the problem.
I think I have all necessarily packages to run cpustat installed
systemSUNWcpcuCPU Performance Counter libraries and utilities
systemSUNWcpcuxCPU Performance Counter libraries and utilities (64-bit)
systemSUNWcarCore Architecture, (Root)
systemSUNWcsdCore Solaris Devices
systemSUNWcslCore Solaris, (Shared Libs)
systemSUNWcsrCore Solaris, (Root)
systemSUNWcsuCore Solaris, (Usr)
systemSUNWkvmCore Architecture, (Kvm)
What is wrong?
Kind regards
Johan
[1569 byte] By [
johanj] at [2007-11-26 7:33:58]

# 3
Two packages need be installed on the system: SUNWcpc and SUNWcpcu. Verify that the infrastructure to run cpustat is correctly installed by running a simple command as root:
/usr/sbin/cpustat -c pic0=Cycle_cnt,pic1=Instr_cnt,sys,nouser 1 1
For each processor in the system, you will get performance counter information similar to that from my 10-way system if everything is properly installed:
time cpu eventpic0pic1
1.0101 tick 455579645 363872520
1.0099 tick 467069857 368550988
1.009 14 tick 466778714 375440207
1.0090 tick 467356756 374395562
1.0104 tick 465917316 374894238
1.009 12 tick 466900477 376129080
1.0098 tick 466749029 374629315
1.009 13 tick 466823803 375654301
1.0095 tick 467229291 375854677
1.009 15 tick 463006255 373813579
1.010 10 total 4653411143 3733234467
If output similar to this is printed, you should be able to run cooltst without a problem. If you are unable to run cpustat, something is wrong in with the installation of the options. truss cpustat to see where the failure is occuring.
rml at 2007-7-6 19:31:37 >

# 4
It's been a while ago but now I found some time to play some more with cooltst.ksh
Some updates:
Still have some problems with/usr/sbin/cpustat
When I run this command like Robert Lane suggested I'll get output like this:
# /usr/sbin/cpustat -c pic0=Cycle_cnt,pic1=Instr_cnt,sys,nouser 1 1
cpustat: cannot access cpu performance counters - No such file or directory
The tail of the truss output from cpustat suggests that I'm missing
"/devices/pseudo/cpc@0:shared". Which is correct:
#ls -l /devices/pseudo/cpc@0:shared
/devices/pseudo/cpc@0:shared: No such file or directory
Anyone a suggestion to get this device on my system?
-8<--only last lines of truss output-->8--
lwp_schedctl(SC_STATE|SC_PREEMPT, 0, 0xFFBFF504) = 0
sigaction(SIGCANCEL, 0xFFBFF5C8, 0x00000000)= 0
sigaction(SIGWAITING, 0xFFBFF5C8, 0x00000000)= 0
sigaction(SIGLWP, 0xFFBFF5C8, 0x00000000)= 0
sigprocmask(SIG_SETMASK, 0xFFBFF690, 0x00000000) = 0
getustack(0xFFBFF85C)
sysconfig(_CONFIG_SEM_VALUE_MAX)= 2147483647
brk(0x00023660) = 0
brk(0x00025660) = 0
sigaction(SIGSYS, 0xFFBFF9B0, 0xFFBFFAD0)= 0
cpc(-1, -1, 0x00000000, 0x00000000) Err#22 EINVAL
sigaction(SIGSYS, 0xFFBFF9B0, 0xFFBFFAD0)= 0
open("/devices/pseudo/devinfo@0:devinfo", O_RDONLY) = 3
ioctl(3, 0xDF82, 0x00000000)= 57311
ioctl(3, 0xDF07, 0xFFBFF704)= 51184
brk(0x00025660) = 0
brk(0x00035660) = 0
ioctl(3, 0xDF80, 0x00026000)= 57344
close(3)= 0
fstat64(1, 0xFFBFFA20) = 0
open("/devices/pseudo/cpc@0:shared", O_RDWR)Err#2 ENOENT
fstat64(2, 0xFFBFEC10) = 0
cpustatwrite(2, " c p u s t a t", 7)= 7
: cannot access cpu performance counters - write(2, " :c a n n o ta c c".., 43)= 43
No such file or directorywrite(2, " N os u c hf i l e".., 25)= 25
write(2, "\n", 1)= 1
_exit(1)
On the suggestion by Robert to test cooltst.ksh with the -n option I get this output. All pakages are available. There is some nawk error on opening a logfile, but that's because in a NO-OP run no logs will be generated in te first place.
#./cooltst.ksh -n
===> NO-OP run: no any *stat tools will be run, no logs will be generated
Would make the /root/000 directory
cooltst.ksh v2.3.2
NOTE: Would run in RT (i.e. the real-time class)
System configs
Host Name:hostname.some.domain
Chip Arch:US-IIIi
OS: SunOS 5.9, 64-bit
[Virtual]Processors:1
processor0nawk: can't open file /root/000/hostname.some.domain/NMLOG
input record number 1
source line number 7
Testing command /usr/sbin/cpustat: OK
Testing package SUNWcpc ... OK
Testing package SUNWcpcu ... OK
Testing command userpeg.5.9: OK
Testing command procls.sh: OK
Kind regards
Johan