fix cpu metrics for sparc64 and change loadavg back to using ui32
This commit is contained in:
parent
ee70e39574
commit
165e7d6a99
|
@ -259,11 +259,19 @@ struct sigar_t {
|
||||||
#define KSTAT_UINT ui32
|
#define KSTAT_UINT ui32
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define kSTAT_uint(v, type) \
|
#define kSTAT_exists(v, type) \
|
||||||
((sigar->koffsets.type[v] == -2) ? 0 : \
|
(sigar->koffsets.type[v] != -2)
|
||||||
((kstat_named_t *)ksp->ks_data + sigar->koffsets.type[v])->value.KSTAT_UINT)
|
|
||||||
|
|
||||||
#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)
|
#define kMEMPAGES(v) kSTAT_uint(v, mempages)
|
||||||
|
|
||||||
|
|
|
@ -358,7 +358,7 @@ int sigar_cpu_list_get(sigar_t *sigar, sigar_cpu_list_t *cpulist)
|
||||||
{
|
{
|
||||||
kstat_ctl_t *kc = sigar->kc;
|
kstat_ctl_t *kc = sigar->kc;
|
||||||
kstat_t *ksp;
|
kstat_t *ksp;
|
||||||
ulong cpuinfo[CPU_STATES];
|
uint_t cpuinfo[CPU_STATES];
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
int is_debug = SIGAR_LOG_IS_DEBUG(sigar);
|
int is_debug = SIGAR_LOG_IS_DEBUG(sigar);
|
||||||
int reported_virtual = 0;
|
int reported_virtual = 0;
|
||||||
|
|
Loading…
Reference in New Issue