diff options
author | WaLyong Cho <walyong.cho@samsung.com> | 2014-04-25 00:50:51 +0900 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2014-04-24 19:21:51 -0400 |
commit | 49e5b2a93339869703d581a06f8d903f8371ab60 (patch) | |
tree | bb5322e6f0d6f664389c716b71a03afaa5fa00c0 /src/bootchart/bootchart.c | |
parent | e6c474723dc66cd4765fd09453d6b48bd5905ba4 (diff) |
bootchart: add control group option
Diffstat (limited to 'src/bootchart/bootchart.c')
-rw-r--r-- | src/bootchart/bootchart.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 9f72d98126..a73418af7e 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -78,6 +78,7 @@ bool initcall = true; bool arg_relative = false; bool arg_filter = true; bool arg_show_cmdline = false; +bool arg_show_cgroup = false; bool arg_pss = false; int samples; int arg_samples_len = 500; /* we record len+1 (1 start sample) */ @@ -113,6 +114,7 @@ static void parse_conf(void) { { "Bootchart", "PlotEntropyGraph", config_parse_bool, 0, &arg_entropy }, { "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 }, { NULL, NULL, NULL, 0, NULL } }; _cleanup_fclose_ FILE *f; @@ -143,6 +145,7 @@ static int parse_args(int argc, char *argv[]) { {"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'}, @@ -151,7 +154,7 @@ static int parse_args(int argc, char *argv[]) { }; int c; - while ((c = getopt_long(argc, argv, "erpf:n:o:i:FChx:y:", options, NULL)) >= 0) { + while ((c = getopt_long(argc, argv, "erpf:n:o:i:FCchx:y:", options, NULL)) >= 0) { int r; switch (c) { @@ -170,6 +173,9 @@ static int parse_args(int argc, char *argv[]) { case 'C': arg_show_cmdline = true; break; + case 'c': + arg_show_cgroup = true; + break; case 'n': r = safe_atoi(optarg, &arg_samples_len); if (r < 0) @@ -217,6 +223,7 @@ static int parse_args(int argc, char *argv[]) { fprintf(stderr, " that are of less importance or short-lived\n"); fprintf(stderr, " --cmdline, -C Display the full command line with arguments\n"); fprintf(stderr, " of processes, instead of only the process name\n"); + fprintf(stderr, " --control-group, -c Display process control group\n"); fprintf(stderr, " --help, -h Display this message\n"); fprintf(stderr, "See bootchart.conf for more information.\n"); exit (EXIT_SUCCESS); @@ -458,9 +465,11 @@ int main(int argc, char *argv[]) { old->sample = old->sample->next; free(oldsample); } + free(old->cgroup); free(old->sample); free(old); } + free(ps->cgroup); free(ps->sample); free(ps); |