From 749806b389f53f7dd43a2cae1589e63dddf51990 Mon Sep 17 00:00:00 2001 From: WaLyong Cho Date: Fri, 13 Feb 2015 14:59:39 +0900 Subject: bootchart: display each CPU utilization/wait --- src/bootchart/bootchart.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'src/bootchart/bootchart.c') diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index b49e2c9235..64a384bacf 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -87,6 +87,7 @@ bool arg_filter = true; bool arg_show_cmdline = false; bool arg_show_cgroup = false; bool arg_pss = false; +bool arg_percpu = false; int samples; int arg_samples_len = DEFAULT_SAMPLES_LEN; /* we record len+1 (1 start sample) */ double arg_hz = DEFAULT_HZ; @@ -122,6 +123,7 @@ static void parse_conf(void) { { "Bootchart", "ScaleX", config_parse_double, 0, &arg_scale_x }, { "Bootchart", "ScaleY", config_parse_double, 0, &arg_scale_y }, { "Bootchart", "ControlGroup", config_parse_bool, 0, &arg_show_cgroup }, + { "Bootchart", "PerCPU", config_parse_bool, 0, &arg_percpu }, { NULL, NULL, NULL, 0, NULL } }; @@ -151,6 +153,7 @@ static void help(void) { " -F, --no-filter Disable filtering of unimportant or ephemeral processes\n" " -C, --cmdline Display full command lines with arguments\n" " -c, --control-group Display process control group\n" + " --per-cpu Draw each CPU utilization and wait bar also\n" " -h, --help Display this message\n\n" "See bootchart.conf for more information.\n", program_invocation_short_name, @@ -163,20 +166,26 @@ static void help(void) { } static int parse_argv(int argc, char *argv[]) { + + enum { + ARG_PERCPU = 0x100, + }; + static const struct option options[] = { - {"rel", no_argument, NULL, 'r'}, - {"freq", required_argument, NULL, 'f'}, - {"samples", required_argument, NULL, 'n'}, - {"pss", no_argument, NULL, 'p'}, - {"output", required_argument, NULL, 'o'}, - {"init", required_argument, NULL, 'i'}, - {"no-filter", no_argument, NULL, 'F'}, - {"cmdline", no_argument, NULL, 'C'}, - {"control-group", no_argument, NULL, 'c'}, - {"help", no_argument, NULL, 'h'}, - {"scale-x", required_argument, NULL, 'x'}, - {"scale-y", required_argument, NULL, 'y'}, - {"entropy", no_argument, NULL, 'e'}, + {"rel", no_argument, NULL, 'r' }, + {"freq", required_argument, NULL, 'f' }, + {"samples", required_argument, NULL, 'n' }, + {"pss", no_argument, NULL, 'p' }, + {"output", required_argument, NULL, 'o' }, + {"init", required_argument, NULL, 'i' }, + {"no-filter", no_argument, NULL, 'F' }, + {"cmdline", no_argument, NULL, 'C' }, + {"control-group", no_argument, NULL, 'c' }, + {"help", no_argument, NULL, 'h' }, + {"scale-x", required_argument, NULL, 'x' }, + {"scale-y", required_argument, NULL, 'y' }, + {"entropy", no_argument, NULL, 'e' }, + {"per-cpu", no_argument, NULL, ARG_PERCPU}, {} }; int c, r; @@ -237,6 +246,9 @@ static int parse_argv(int argc, char *argv[]) { case 'e': arg_entropy = true; break; + case ARG_PERCPU: + arg_percpu = true; + break; case 'h': help(); return 0; -- cgit v1.2.3-54-g00ecf