diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2009-09-24 09:40:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-10-01 03:26:40 -0400 |
commit | 39a90a8ef17fe6fbf4b45e46e3c10d3b8b4a3dea (patch) | |
tree | 8aa8c5b0486d1d2cedace07bcb9e42189b4ccda5 /tools/perf/builtin-timechart.c | |
parent | 8357275bb919d91093bc5a959932ef7b1ea816e8 (diff) |
perf timechart: Add a power-only mode
For doing work on the Linux power management components, I need to
make long (30+ seconds) traces. Currently, this then results in a
HUGE svg file, with mostly process data that isn't interesting.
This patch adds a --power-only mode to perf timechart that only
outputs the CPU power section of the SVG; this significantly
reduces the size of the SVG file, making even 30+ second traces
viewable with inkscape.
As a minor tweak for the same effect, the minimum text size is
decreased; current inkscape cannot zoom in deep enough to show text
this small, but it reduces inkscape compute time.
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: peterz@infradead.org
LKML-Reference: <20090924154013.0675ab71@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r-- | tools/perf/builtin-timechart.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 4405681b3134..702d8fe58fbc 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -46,6 +46,8 @@ static u64 turbo_frequency; | |||
46 | 46 | ||
47 | static u64 first_time, last_time; | 47 | static u64 first_time, last_time; |
48 | 48 | ||
49 | static int power_only; | ||
50 | |||
49 | 51 | ||
50 | static struct perf_header *header; | 52 | static struct perf_header *header; |
51 | 53 | ||
@@ -547,7 +549,7 @@ static void end_sample_processing(void) | |||
547 | u64 cpu; | 549 | u64 cpu; |
548 | struct power_event *pwr; | 550 | struct power_event *pwr; |
549 | 551 | ||
550 | for (cpu = 0; cpu < numcpus; cpu++) { | 552 | for (cpu = 0; cpu <= numcpus; cpu++) { |
551 | pwr = malloc(sizeof(struct power_event)); | 553 | pwr = malloc(sizeof(struct power_event)); |
552 | if (!pwr) | 554 | if (!pwr) |
553 | return; | 555 | return; |
@@ -871,7 +873,7 @@ static int determine_display_tasks(u64 threshold) | |||
871 | /* no exit marker, task kept running to the end */ | 873 | /* no exit marker, task kept running to the end */ |
872 | if (p->end_time == 0) | 874 | if (p->end_time == 0) |
873 | p->end_time = last_time; | 875 | p->end_time = last_time; |
874 | if (p->total_time >= threshold) | 876 | if (p->total_time >= threshold && !power_only) |
875 | p->display = 1; | 877 | p->display = 1; |
876 | 878 | ||
877 | c = p->all; | 879 | c = p->all; |
@@ -882,7 +884,7 @@ static int determine_display_tasks(u64 threshold) | |||
882 | if (c->start_time == 1) | 884 | if (c->start_time == 1) |
883 | c->start_time = first_time; | 885 | c->start_time = first_time; |
884 | 886 | ||
885 | if (c->total_time >= threshold) { | 887 | if (c->total_time >= threshold && !power_only) { |
886 | c->display = 1; | 888 | c->display = 1; |
887 | count++; | 889 | count++; |
888 | } | 890 | } |
@@ -1134,6 +1136,8 @@ static const struct option options[] = { | |||
1134 | "output file name"), | 1136 | "output file name"), |
1135 | OPT_INTEGER('w', "width", &svg_page_width, | 1137 | OPT_INTEGER('w', "width", &svg_page_width, |
1136 | "page width"), | 1138 | "page width"), |
1139 | OPT_BOOLEAN('p', "power-only", &power_only, | ||
1140 | "output power data only"), | ||
1137 | OPT_END() | 1141 | OPT_END() |
1138 | }; | 1142 | }; |
1139 | 1143 | ||