=========================================================================== CHANGELOG =========================================================================== --- /usr/tmp/TmpDir.8949-0/CHANGELOG_1.85 Tue Jul 31 13:02:05 2001 +++ CHANGELOG Tue Jul 31 12:10:06 2001 @@ -264,3 +264,6 @@ - fix configure.in to work when ps gives warnings on stderr; (eg. System.map doesn't match running kernel) - added lmsensors PMDA, contributed by Troy Dawson + - added kernel.all.uptime, contributed by Gilly + - fixed int overflow with kernel.*.cpu.* metrics. Fix contributed + by Gilly =========================================================================== VERSION.pcp =========================================================================== --- /usr/tmp/TmpDir.8949-0/VERSION.pcp_1.60 Tue Jul 31 13:02:05 2001 +++ VERSION.pcp Tue Jul 31 12:08:57 2001 @@ -5,7 +5,7 @@ PACKAGE_MAJOR=2 PACKAGE_MINOR=2 PACKAGE_REVISION=2 -PACKAGE_BUILD=2 +PACKAGE_BUILD=3 PACKAGE_VERSION=${PACKAGE_MAJOR}.${PACKAGE_MINOR}.${PACKAGE_REVISION} PACKAGE_DISTRIBUTION="SGI Open Source" =========================================================================== src/pmdas/linux/help =========================================================================== --- /usr/tmp/TmpDir.8949-0/src/pmdas/linux/help_1.18 Tue Jul 31 13:02:05 2001 +++ src/pmdas/linux/help Tue Jul 31 11:53:16 2001 @@ -864,7 +864,7 @@ @ hinv.cpu.cache primary cache size of each CPU as reported by /proc/cpuinfo @ hinv.cpu.bogomips bogo mips rating for each CPU as reported by /proc/cpuinfo @ kernel.all.hz value of HZ (jiffies/second) for the currently running kernel - +@ kernel.all.uptime time the current kernel has been running @ mem.slabinfo.objects.active number of active objects in each cache @ mem.slabinfo.objects.total total number of objects in each cache @ mem.slabinfo.objects.size size of individual objects of each cache =========================================================================== src/pmdas/linux/pmda.c =========================================================================== --- /usr/tmp/TmpDir.8949-0/src/pmdas/linux/pmda.c_1.31 Tue Jul 31 13:02:05 2001 +++ src/pmdas/linux/pmda.c Tue Jul 31 12:59:29 2001 @@ -420,10 +420,15 @@ PMDA_PMUNITS(0,1,0,0,PM_TIME_MSEC,0) }, }, /* kernel.all.hz */ - { &proc_stat.hz, + { NULL, { PMDA_PMID(CLUSTER_STAT,48), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_DISCRETE, PMDA_PMUNITS(0,-1,1,0,PM_TIME_SEC,PM_COUNT_ONE) }, }, +/* kernel.all.uptime */ + { NULL, + { PMDA_PMID(CLUSTER_STAT,49), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_INSTANT, + PMDA_PMUNITS(0,1,1,0,PM_TIME_HOUR,PM_COUNT_ONE) }, }, + /* * /proc/meminfo cluster @@ -2505,16 +2510,16 @@ */ switch (idp->item) { case 0: /* user */ - atom->ul = 1000 * proc_stat.p_user[inst] / proc_stat.hz; + atom->ul = 1000 * (double)proc_stat.p_user[inst] / proc_stat.hz; break; case 1: /* nice */ - atom->ul = 1000 * proc_stat.p_nice[inst] / proc_stat.hz; + atom->ul = 1000 * (double)proc_stat.p_nice[inst] / proc_stat.hz; break; case 2: /* sys */ - atom->ul = 1000 * proc_stat.p_sys[inst] / proc_stat.hz; + atom->ul = 1000 * (double)proc_stat.p_sys[inst] / proc_stat.hz; break; case 3: /* idle */ - atom->ul = 1000 * proc_stat.p_idle[inst] / proc_stat.hz; + atom->ul = 1000 * (double)proc_stat.p_idle[inst] / proc_stat.hz; break; case 4: /* rio */ @@ -2552,17 +2557,18 @@ atom->ul = proc_stat.processes; break; + /* gilly - change the calculation to prevent a bug */ case 20: /* all.user */ - atom->ul = 1000 * proc_stat.user / proc_stat.hz; + atom->ul = 1000 * (double)proc_stat.user / proc_stat.hz; break; case 21: /* all.nice */ - atom->ul = 1000 * proc_stat.nice / proc_stat.hz; + atom->ul = 1000 * (double)proc_stat.nice / proc_stat.hz; break; case 22: /* all.sys */ - atom->ul = 1000 * proc_stat.sys / proc_stat.hz; + atom->ul = 1000 * (double)proc_stat.sys / proc_stat.hz; break; case 23: /* all.idle */ - atom->ul = 1000 * proc_stat.idle / proc_stat.hz; + atom->ul = 1000 * (double)proc_stat.idle / proc_stat.hz; break; case 24: /* all.rio */ @@ -2628,6 +2634,18 @@ case 46: /* disk.dev.avactive */ case 47: /* disk.dev.aveq */ return 0; /* no values available */ + + case 48: /* kernel.all.hz */ + atom->ul = proc_stat.hz; + break; + + case 49: + /* + * kernel.all.uptime in hours + * contributed by "gilly" + */ + atom->ul = (u_long)(times(NULL)) / (proc_stat.hz * 60 * 60); + break; default: return PM_ERR_PMID; =========================================================================== src/pmdas/linux/root_linux =========================================================================== --- /usr/tmp/TmpDir.8949-0/src/pmdas/linux/root_linux_1.16 Tue Jul 31 13:02:05 2001 +++ src/pmdas/linux/root_linux Tue Jul 31 11:51:42 2001 @@ -55,6 +55,7 @@ sysfork 60:0:14 syscall 60:4:1 hz 60:0:48 + uptime 60:0:49 } kernel.all.cpu {