From dbf76461c815d9db8bf2e676eab4e1602135ca16 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Mon, 15 Jan 2018 17:34:53 +0100 Subject: [PATCH] sar: Change some activities' name Signed-off-by: Sebastien GODARD --- activity.c | 14 +++++++------- sa.h | 6 +++--- sa_common.c | 14 +++++++------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/activity.c b/activity.c index 867dbc4..51af5a3 100644 --- a/activity.c +++ b/activity.c @@ -1267,7 +1267,7 @@ struct activity net_udp6_act = { /* CPU frequency */ struct activity pwr_cpufreq_act = { - .id = A_PWR_CPUFREQ, + .id = A_PWR_CPU, .options = AO_COUNTED + AO_GRAPH_PER_ITEM, .magic = ACTIVITY_MAGIC_BASE, .group = G_POWER, @@ -1291,7 +1291,7 @@ struct activity pwr_cpufreq_act = { .f_json_print = json_print_pwr_cpufreq_stats, .f_svg_print = svg_print_pwr_cpufreq_stats, .f_raw_print = raw_print_pwr_cpufreq_stats, - .name = "A_PWR_CPUFREQ", + .name = "A_PWR_CPU", .g_nr = 1, #endif .nr_ini = -1, @@ -1472,7 +1472,7 @@ struct activity huge_act = { /* CPU weighted frequency */ struct activity pwr_wghfreq_act = { - .id = A_PWR_WGHFREQ, + .id = A_PWR_FREQ, .options = AO_COUNTED + AO_MATRIX, .magic = ACTIVITY_MAGIC_BASE, .group = G_POWER, @@ -1496,7 +1496,7 @@ struct activity pwr_wghfreq_act = { .f_json_print = json_print_pwr_wghfreq_stats, .f_svg_print = NULL, .f_raw_print = raw_print_pwr_wghfreq_stats, - .name = "A_PWR_WGHFREQ", + .name = "A_PWR_FREQ", .g_nr = 0, #endif .nr_ini = -1, @@ -1554,7 +1554,7 @@ struct activity pwr_usb_act = { /* Filesystem usage activity */ struct activity filesystem_act = { - .id = A_FILESYSTEM, + .id = A_FS, .options = AO_COUNTED + AO_GRAPH_PER_ITEM + AO_MULTIPLE_OUTPUTS, .magic = ACTIVITY_MAGIC_BASE, .group = G_XDISK, @@ -1579,7 +1579,7 @@ struct activity filesystem_act = { .f_json_print = json_print_filesystem_stats, .f_svg_print = svg_print_filesystem_stats, .f_raw_print = raw_print_filesystem_stats, - .name = "A_FILESYSTEM", + .name = "A_FS", .g_nr = 4, #endif .nr_ini = -1, @@ -1620,7 +1620,7 @@ struct activity fchost_act = { .f_json_print = json_print_fchost_stats, .f_svg_print = svg_print_fchost_stats, .f_raw_print = raw_print_fchost_stats, - .name = "A_FCHOST", + .name = "A_NET_FC", .g_nr = 2, #endif .nr_ini = -1, diff --git a/sa.h b/sa.h index 945f79f..df4f826 100644 --- a/sa.h +++ b/sa.h @@ -56,14 +56,14 @@ #define A_NET_ICMP6 27 #define A_NET_EICMP6 28 #define A_NET_UDP6 29 -#define A_PWR_CPUFREQ 30 +#define A_PWR_CPU 30 #define A_PWR_FAN 31 #define A_PWR_TEMP 32 #define A_PWR_IN 33 #define A_HUGE 34 -#define A_PWR_WGHFREQ 35 +#define A_PWR_FREQ 35 #define A_PWR_USB 36 -#define A_FILESYSTEM 37 +#define A_FS 37 #define A_NET_FC 38 #define A_NET_SOFT 39 diff --git a/sa_common.c b/sa_common.c index 1fd0506..218b928 100644 --- a/sa_common.c +++ b/sa_common.c @@ -1035,7 +1035,7 @@ void select_default_activity(struct activity *act[]) /* * If no CPU's have been selected then select CPU "all". - * cpu_bitmap bitmap may be used by several activities (A_CPU, A_PWR_CPUFREQ...) + * cpu_bitmap bitmap may be used by several activities (A_CPU, A_PWR_CPU...) */ if (!count_bits(cpu_bitmap.b_array, BITMAP_SIZE(cpu_bitmap.b_size))) { cpu_bitmap.b_array[0] |= 0x01; @@ -1859,7 +1859,7 @@ int parse_sar_opt(char *argv[], int *opt, struct activity *act[], BITMAP_SIZE(act[p]->bitmap->b_size)); act[p]->opt_flags = AO_F_CPU_ALL; - p = get_activity_position(act, A_FILESYSTEM, EXIT_IF_NOT_FOUND); + p = get_activity_position(act, A_FS, EXIT_IF_NOT_FOUND); act[p]->opt_flags = AO_F_FILESYSTEM; break; @@ -1880,7 +1880,7 @@ int parse_sar_opt(char *argv[], int *opt, struct activity *act[], break; case 'F': - p = get_activity_position(act, A_FILESYSTEM, EXIT_IF_NOT_FOUND); + p = get_activity_position(act, A_FS, EXIT_IF_NOT_FOUND); act[p]->options |= AO_SELECTED; if (!*(argv[*opt] + i + 1) && argv[*opt + 1] && !strcmp(argv[*opt + 1], K_MOUNT)) { (*opt)++; @@ -2019,7 +2019,7 @@ int parse_sar_m_opt(char *argv[], int *opt, struct activity *act[]) for (t = strtok(argv[*opt], ","); t; t = strtok(NULL, ",")) { if (!strcmp(t, K_CPU)) { - SELECT_ACTIVITY(A_PWR_CPUFREQ); + SELECT_ACTIVITY(A_PWR_CPU); } else if (!strcmp(t, K_FAN)) { SELECT_ACTIVITY(A_PWR_FAN); @@ -2031,17 +2031,17 @@ int parse_sar_m_opt(char *argv[], int *opt, struct activity *act[]) SELECT_ACTIVITY(A_PWR_TEMP); } else if (!strcmp(t, K_FREQ)) { - SELECT_ACTIVITY(A_PWR_WGHFREQ); + SELECT_ACTIVITY(A_PWR_FREQ); } else if (!strcmp(t, K_USB)) { SELECT_ACTIVITY(A_PWR_USB); } else if (!strcmp(t, K_ALL)) { - SELECT_ACTIVITY(A_PWR_CPUFREQ); + SELECT_ACTIVITY(A_PWR_CPU); SELECT_ACTIVITY(A_PWR_FAN); SELECT_ACTIVITY(A_PWR_IN); SELECT_ACTIVITY(A_PWR_TEMP); - SELECT_ACTIVITY(A_PWR_WGHFREQ); + SELECT_ACTIVITY(A_PWR_FREQ); SELECT_ACTIVITY(A_PWR_USB); } else -- 2.40.0