From d87f4e50d85ea8de6568a6ff7b16257726b5a4b7 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 20 Jul 2004 15:42:05 +0000 Subject: [PATCH] skip swap device if not active --- src/os/aix/aix_sigar.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index fea5c125..c0d8b90e 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -534,8 +534,14 @@ static int sigar_swap_get_perfstat(sigar_t *sigar, sigar_swap_t *swap) } if (SIGAR_LOG_IS_DEBUG(sigar)) { sigar_log_printf(sigar, SIGAR_LOG_DEBUG, - "[swap] dev=%s: total=%lluMb, used=%lluMb", - SWAP_DEV(ps), ps.mb_size, ps.mb_used); + "[swap] dev=%s: active=%s, " + "total=%lluMb, used=%lluMb", + SWAP_DEV(ps), + ((ps.active == 1) ? "yes" : "no"), + ps.mb_size, ps.mb_used); + } + if (ps.active != 1) { + continue; } /* convert MB sizes to bytes */ swap->total += SWAP_MB_TO_BYTES(ps.mb_size);