diff options
author | Stanislav Fomichev <stfomichev@yandex-team.ru> | 2013-12-02 09:37:33 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-16 14:33:14 -0500 |
commit | 8b6dcca017aa53fe13066411a653b5997c158a2c (patch) | |
tree | 63d8edc91fbb2eacc26fc6f88051a17db1152d13 | |
parent | 553873e1df63a20559ac9c336765dc7055cfc3d4 (diff) |
perf timechart: Add backtrace support to CPU info
Add backtrace info to the CPU usage timechart.
Signed-off-by: Stanislav Fomichev <stfomichev@yandex-team.ru>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>
Link: http://lkml.kernel.org/r/1385995056-20158-2-git-send-email-stfomichev@yandex-team.ru
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r-- | tools/perf/builtin-timechart.c | 10 | ||||
-rw-r--r-- | tools/perf/util/svghelper.c | 4 | ||||
-rw-r--r-- | tools/perf/util/svghelper.h | 2 |
3 files changed, 12 insertions, 4 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c index 0bda620a717d..d955095b6d63 100644 --- a/tools/perf/builtin-timechart.c +++ b/tools/perf/builtin-timechart.c | |||
@@ -837,8 +837,14 @@ static void draw_cpu_usage(struct timechart *tchart) | |||
837 | while (c) { | 837 | while (c) { |
838 | sample = c->samples; | 838 | sample = c->samples; |
839 | while (sample) { | 839 | while (sample) { |
840 | if (sample->type == TYPE_RUNNING) | 840 | if (sample->type == TYPE_RUNNING) { |
841 | svg_process(sample->cpu, sample->start_time, sample->end_time, "sample", c->comm); | 841 | svg_process(sample->cpu, |
842 | sample->start_time, | ||
843 | sample->end_time, | ||
844 | "sample", | ||
845 | c->comm, | ||
846 | sample->backtrace); | ||
847 | } | ||
842 | 848 | ||
843 | sample = sample->next; | 849 | sample = sample->next; |
844 | } | 850 | } |
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c index 8b79d3ad1246..740f0328fc13 100644 --- a/tools/perf/util/svghelper.c +++ b/tools/perf/util/svghelper.c | |||
@@ -285,7 +285,7 @@ void svg_cpu_box(int cpu, u64 __max_freq, u64 __turbo_freq) | |||
285 | fprintf(svgfile, "</g>\n"); | 285 | fprintf(svgfile, "</g>\n"); |
286 | } | 286 | } |
287 | 287 | ||
288 | void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name) | 288 | void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name, const char *backtrace) |
289 | { | 289 | { |
290 | double width; | 290 | double width; |
291 | 291 | ||
@@ -295,6 +295,8 @@ void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name | |||
295 | 295 | ||
296 | fprintf(svgfile, "<g transform=\"translate(%4.8f,%4.8f)\">\n", time2pixels(start), cpu2y(cpu)); | 296 | fprintf(svgfile, "<g transform=\"translate(%4.8f,%4.8f)\">\n", time2pixels(start), cpu2y(cpu)); |
297 | fprintf(svgfile, "<title>%s %s</title>\n", name, time_to_string(end - start)); | 297 | fprintf(svgfile, "<title>%s %s</title>\n", name, time_to_string(end - start)); |
298 | if (backtrace) | ||
299 | fprintf(svgfile, "<desc>Switched because:\n%s</desc>\n", backtrace); | ||
298 | fprintf(svgfile, "<rect x=\"0\" width=\"%4.8f\" y=\"0\" height=\"%4.1f\" class=\"%s\"/>\n", | 300 | fprintf(svgfile, "<rect x=\"0\" width=\"%4.8f\" y=\"0\" height=\"%4.1f\" class=\"%s\"/>\n", |
299 | time2pixels(end)-time2pixels(start), SLOT_MULT+SLOT_HEIGHT, type); | 301 | time2pixels(end)-time2pixels(start), SLOT_MULT+SLOT_HEIGHT, type); |
300 | width = time2pixels(end)-time2pixels(start); | 302 | width = time2pixels(end)-time2pixels(start); |
diff --git a/tools/perf/util/svghelper.h b/tools/perf/util/svghelper.h index fad79ceeac1a..7db6ae98bf2c 100644 --- a/tools/perf/util/svghelper.h +++ b/tools/perf/util/svghelper.h | |||
@@ -11,7 +11,7 @@ extern void svg_waiting(int Yslot, int cpu, u64 start, u64 end, const char *back | |||
11 | extern void svg_cpu_box(int cpu, u64 max_frequency, u64 turbo_frequency); | 11 | extern void svg_cpu_box(int cpu, u64 max_frequency, u64 turbo_frequency); |
12 | 12 | ||
13 | 13 | ||
14 | extern void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name); | 14 | extern void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name, const char *backtrace); |
15 | extern void svg_cstate(int cpu, u64 start, u64 end, int type); | 15 | extern void svg_cstate(int cpu, u64 start, u64 end, int type); |
16 | extern void svg_pstate(int cpu, u64 start, u64 end, u64 freq); | 16 | extern void svg_pstate(int cpu, u64 start, u64 end, u64 freq); |
17 | 17 | ||