From c00fcf4858e465b3cbaa93d3d9ace7241f5fc348 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Fri, 22 Dec 2017 18:06:23 +0100 Subject: [PATCH] pr_stats.c: Cosmetic change in code Signed-off-by: Sebastien GODARD --- pr_stats.c | 90 +++++++++++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/pr_stats.c b/pr_stats.c index 94dfa7e..bf973f8 100644 --- a/pr_stats.c +++ b/pr_stats.c @@ -1953,36 +1953,36 @@ void stub_print_pwr_cpufreq_stats(struct activity *a, int curr, int dispavg) */ /* Should current CPU (including CPU "all") be displayed? */ - if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { + if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07)))) + /* No */ + continue; - /* Yes: Display it */ - printf("%-11s", timestamp[curr]); + printf("%-11s", timestamp[curr]); - if (!i) { - /* This is CPU "all" */ - cprintf_in(IS_STR, "%s", " all", 0); - } - else { - cprintf_in(IS_INT, " %3d", "", i - 1); - } + if (!i) { + /* This is CPU "all" */ + cprintf_in(IS_STR, "%s", " all", 0); + } + else { + cprintf_in(IS_INT, " %3d", "", i - 1); + } - if (!dispavg) { - /* Display instantaneous values */ - cprintf_f(NO_UNIT, 1, 9, 2, - ((double) spc->cpufreq) / 100); - printf("\n"); - /* - * Will be used to compute the average. - * Note: Overflow unlikely to happen but not impossible... - */ - avg_cpufreq[i] += spc->cpufreq; - } - else { - /* Display average values */ - cprintf_f(NO_UNIT, 1, 9, 2, - (double) avg_cpufreq[i] / (100 * avg_count)); - printf("\n"); - } + if (!dispavg) { + /* Display instantaneous values */ + cprintf_f(NO_UNIT, 1, 9, 2, + ((double) spc->cpufreq) / 100); + printf("\n"); + /* + * Will be used to compute the average. + * Note: Overflow unlikely to happen but not impossible... + */ + avg_cpufreq[i] += spc->cpufreq; + } + else { + /* Display average values */ + cprintf_f(NO_UNIT, 1, 9, 2, + (double) avg_cpufreq[i] / (100 * avg_count)); + printf("\n"); } } @@ -2862,26 +2862,26 @@ __print_funct_t print_softnet_stats(struct activity *a, int prev, int curr, */ /* Should current CPU (including CPU "all") be displayed? */ - if (a->bitmap->b_array[i >> 3] & (1 << (i & 0x07))) { - - /* Yes: Display it */ - printf("%-11s", timestamp[curr]); + if (!(a->bitmap->b_array[i >> 3] & (1 << (i & 0x07)))) + /* No */ + continue; - if (!i) { - /* This is CPU "all" */ - cprintf_in(IS_STR, " %s", " all", 0); - } - else { - cprintf_in(IS_INT, " %7d", "", i - 1); - } + printf("%-11s", timestamp[curr]); - cprintf_f(NO_UNIT, 5, 9, 2, - S_VALUE(ssnp->processed, ssnc->processed, itv), - S_VALUE(ssnp->dropped, ssnc->dropped, itv), - S_VALUE(ssnp->time_squeeze, ssnc->time_squeeze, itv), - S_VALUE(ssnp->received_rps, ssnc->received_rps, itv), - S_VALUE(ssnp->flow_limit, ssnc->flow_limit, itv)); - printf("\n"); + if (!i) { + /* This is CPU "all" */ + cprintf_in(IS_STR, " %s", " all", 0); + } + else { + cprintf_in(IS_INT, " %7d", "", i - 1); } + + cprintf_f(NO_UNIT, 5, 9, 2, + S_VALUE(ssnp->processed, ssnc->processed, itv), + S_VALUE(ssnp->dropped, ssnc->dropped, itv), + S_VALUE(ssnp->time_squeeze, ssnc->time_squeeze, itv), + S_VALUE(ssnp->received_rps, ssnc->received_rps, itv), + S_VALUE(ssnp->flow_limit, ssnc->flow_limit, itv)); + printf("\n"); } } -- 2.40.0