fix cpu metrics for sparc64 and change loadavg back to using ui32

This commit is contained in:
Doug MacEachern 2007-01-17 18:14:14 +00:00
parent ee70e39574
commit 165e7d6a99
2 changed files with 13 additions and 5 deletions

View File

@ -259,11 +259,19 @@ struct sigar_t {
#define KSTAT_UINT ui32
#endif
#define kSTAT_uint(v, type) \
((sigar->koffsets.type[v] == -2) ? 0 : \
((kstat_named_t *)ksp->ks_data + sigar->koffsets.type[v])->value.KSTAT_UINT)
#define kSTAT_exists(v, type) \
(sigar->koffsets.type[v] != -2)
#define kSYSTEM(v) kSTAT_uint(v, system)
#define kSTAT_ptr(v, type) \
((kstat_named_t *)ksp->ks_data + sigar->koffsets.type[v])
#define kSTAT_uint(v, type) \
(kSTAT_exists(v, type) ? kSTAT_ptr(v, type)->value.KSTAT_UINT : 0)
#define kSTAT_ui32(v, type) \
(kSTAT_exists(v, type) ? kSTAT_ptr(v, type)->value.ui32 : 0)
#define kSYSTEM(v) kSTAT_ui32(v, system)
#define kMEMPAGES(v) kSTAT_uint(v, mempages)

View File

@ -358,7 +358,7 @@ int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist)
{
kstat_ctl_t *kc = sigar->kc;
kstat_t *ksp;
ulong cpuinfo[CPU_STATES];
uint_t cpuinfo[CPU_STATES];
unsigned int i;
int is_debug = SIGAR_LOG_IS_DEBUG(sigar);
int reported_virtual = 0;