cpu rollup log noise reduction

This commit is contained in:
Doug MacEachern 2008-07-11 23:09:38 +00:00
parent 3571d739a1
commit 7d63d0f092
1 changed files with 6 additions and 2 deletions

View File

@ -590,16 +590,20 @@ int sigar_cpu_core_count(sigar_t *sigar)
int sigar_cpu_core_rollup(sigar_t *sigar) int sigar_cpu_core_rollup(sigar_t *sigar)
{ {
#ifdef SIGAR_HAS_CPUID #ifdef SIGAR_HAS_CPUID
int log_rollup =
SIGAR_LOG_IS_DEBUG(sigar) &&
(sigar->lcpu == -1);
(void)sigar_cpu_core_count(sigar); (void)sigar_cpu_core_count(sigar);
if (sigar->cpu_list_cores) { if (sigar->cpu_list_cores) {
if (sigar->lcpu > 1) { if (log_rollup && (sigar->lcpu > 1)) {
sigar_log_printf(sigar, SIGAR_LOG_DEBUG, sigar_log_printf(sigar, SIGAR_LOG_DEBUG,
"[cpu] treating cores as-is"); "[cpu] treating cores as-is");
} }
} }
else { else {
if (sigar->lcpu > 1) { if (log_rollup && (sigar->lcpu > 1)) {
sigar_log_printf(sigar, SIGAR_LOG_DEBUG, sigar_log_printf(sigar, SIGAR_LOG_DEBUG,
"[cpu] rolling up cores to sockets"); "[cpu] rolling up cores to sockets");
return 1; return 1;