perf timechart: Add support for displaying only tasks related data

In order to make SVG smaller and faster to browse add possibility to
switch off power related information with -T switch.

Signed-off-by: Stanislav Fomichev <stfomichev@yandex-team.ru>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1383323151-19810-5-git-send-email-stfomichev@yandex-team.ru
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Stanislav Fomichev 2013-11-01 20:25:48 +04:00 committed by Arnaldo Carvalho de Melo
parent 753c505dc4
commit c87097d39d
2 changed files with 13 additions and 1 deletions

View File

@ -35,6 +35,9 @@ OPTIONS
-P:: -P::
--power-only:: --power-only::
Only output the CPU power section of the diagram Only output the CPU power section of the diagram
-T::
--tasks-only::
Don't output processor state transitions
-p:: -p::
--process:: --process::
Select the processes to display, by name or PID Select the processes to display, by name or PID

View File

@ -51,6 +51,7 @@ static u64 turbo_frequency;
static u64 first_time, last_time; static u64 first_time, last_time;
static bool power_only; static bool power_only;
static bool tasks_only;
struct per_pid; struct per_pid;
@ -971,7 +972,8 @@ static void write_svg_file(const char *filename)
draw_cpu_usage(); draw_cpu_usage();
if (proc_num) if (proc_num)
draw_process_bars(); draw_process_bars();
draw_c_p_states(); if (!tasks_only)
draw_c_p_states();
if (proc_num) if (proc_num)
draw_wakeups(); draw_wakeups();
@ -1102,6 +1104,8 @@ int cmd_timechart(int argc, const char **argv,
OPT_STRING('o', "output", &output_name, "file", "output file name"), OPT_STRING('o', "output", &output_name, "file", "output file name"),
OPT_INTEGER('w', "width", &svg_page_width, "page width"), OPT_INTEGER('w', "width", &svg_page_width, "page width"),
OPT_BOOLEAN('P', "power-only", &power_only, "output power data only"), OPT_BOOLEAN('P', "power-only", &power_only, "output power data only"),
OPT_BOOLEAN('T', "tasks-only", &tasks_only,
"output processes data only"),
OPT_CALLBACK('p', "process", NULL, "process", OPT_CALLBACK('p', "process", NULL, "process",
"process selector. Pass a pid or process name.", "process selector. Pass a pid or process name.",
parse_process), parse_process),
@ -1119,6 +1123,11 @@ int cmd_timechart(int argc, const char **argv,
argc = parse_options(argc, argv, options, timechart_usage, argc = parse_options(argc, argv, options, timechart_usage,
PARSE_OPT_STOP_AT_NON_OPTION); PARSE_OPT_STOP_AT_NON_OPTION);
if (power_only && tasks_only) {
pr_err("-P and -T options cannot be used at the same time.\n");
return -1;
}
symbol__init(); symbol__init();
if (argc && !strncmp(argv[0], "rec", 3)) if (argc && !strncmp(argv[0], "rec", 3))