From 38a2111221c9247c7fffed01975c8c55e741502c Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Tue, 26 Dec 2017 16:53:27 +0100 Subject: [PATCH] sadf: RAW: Display number of allocated slots for current activity Enhance output displayed by sadf in raw mode (sadf -r) again: If showhints option is used, display number of allocated slots for items for current activity sample. Mainly useful for debugging purpose, as this value is not saved in file. Signed-off-by: Sebastien GODARD --- raw_stats.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/raw_stats.c b/raw_stats.c index 4221120..a560fc2 100644 --- a/raw_stats.c +++ b/raw_stats.c @@ -119,7 +119,7 @@ __print_funct_t raw_print_cpu_stats(struct activity *a, char *timestr, int curr) struct stats_cpu *scc, *scp; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } /* @nr[curr] cannot normally be greater than @nr_ini */ @@ -242,7 +242,7 @@ __print_funct_t raw_print_irq_stats(struct activity *a, char *timestr, int curr) struct stats_irq *sic, *sip; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) { @@ -461,7 +461,7 @@ __print_funct_t raw_print_serial_stats(struct activity *a, char *timestr, int cu struct stats_serial *ssc, *ssp; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -535,7 +535,7 @@ __print_funct_t raw_print_disk_stats(struct activity *a, char *timestr, int curr memset(&sdpzero, 0, STATS_DISK_SIZE); if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -611,7 +611,7 @@ __print_funct_t raw_print_net_dev_stats(struct activity *a, char *timestr, int c memset(&sndzero, 0, STATS_NET_DEV_SIZE); if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -668,7 +668,7 @@ __print_funct_t raw_print_net_edev_stats(struct activity *a, char *timestr, int memset(&snedzero, 0, STATS_NET_EDEV_SIZE); if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -1306,7 +1306,7 @@ __print_funct_t raw_print_pwr_cpufreq_stats(struct activity *a, char *timestr, i struct stats_pwr_cpufreq *spc; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) { @@ -1338,7 +1338,7 @@ __print_funct_t raw_print_pwr_fan_stats(struct activity *a, char *timestr, int c struct stats_pwr_fan *spc; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -1367,7 +1367,7 @@ __print_funct_t raw_print_pwr_temp_stats(struct activity *a, char *timestr, int struct stats_pwr_temp *spc; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -1397,7 +1397,7 @@ __print_funct_t raw_print_pwr_in_stats(struct activity *a, char *timestr, int cu struct stats_pwr_in *spc; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -1446,7 +1446,7 @@ __print_funct_t raw_print_pwr_wghfreq_stats(struct activity *a, char *timestr, i struct stats_pwr_wghfreq *spc, *spp, *spc_k, *spp_k; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d,%d]\n", a->nr[curr], a->nr_ini, a->nr2); + printf("[NBR: %d/%d,%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr2, a->nr_allocated); } for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) { @@ -1492,7 +1492,7 @@ __print_funct_t raw_print_pwr_usb_stats(struct activity *a, char *timestr, int c struct stats_pwr_usb *suc; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -1523,7 +1523,7 @@ __print_funct_t raw_print_filesystem_stats(struct activity *a, char *timestr, in struct stats_filesystem *sfc; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -1560,7 +1560,7 @@ __print_funct_t raw_print_fchost_stats(struct activity *a, char *timestr, int cu struct stats_fchost *sfcc, *sfcp; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; i < a->nr[curr]; i++) { @@ -1620,7 +1620,7 @@ __print_funct_t raw_print_softnet_stats(struct activity *a, char *timestr, int c struct stats_softnet *ssnc, *ssnp; if (DISPLAY_HINTS(flags)) { - printf("[NBR: %d/%d]\n", a->nr[curr], a->nr_ini); + printf("[NBR: %d/%d (%d)]\n", a->nr[curr], a->nr_ini, a->nr_allocated); } for (i = 0; (i < a->nr[curr]) && (i < a->bitmap->b_size + 1); i++) { -- 2.40.0