All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Stanislav Fomichev <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
	mingo@redhat.com, hpa@zytor.com, mingo@kernel.org,
	a.p.zijlstra@chello.nl, namhyung@kernel.org, jolsa@redhat.com,
	stfomichev@yandex-team.ru, artagnon@gmail.com,
	tglx@linutronix.de
Subject: [tip:perf/core] perf timechart: Add backtrace support to CPU info
Date: Wed, 18 Dec 2013 02:30:45 -0800	[thread overview]
Message-ID: <tip-8b6dcca017aa53fe13066411a653b5997c158a2c@git.kernel.org> (raw)
In-Reply-To: <1385995056-20158-2-git-send-email-stfomichev@yandex-team.ru>

Commit-ID:  8b6dcca017aa53fe13066411a653b5997c158a2c
Gitweb:     http://git.kernel.org/tip/8b6dcca017aa53fe13066411a653b5997c158a2c
Author:     Stanislav Fomichev <stfomichev@yandex-team.ru>
AuthorDate: Mon, 2 Dec 2013 18:37:33 +0400
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 16 Dec 2013 16:33:14 -0300

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>
---
 tools/perf/builtin-timechart.c | 10 ++++++++--
 tools/perf/util/svghelper.c    |  4 +++-
 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 0bda620..d955095 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)
 		while (c) {
 			sample = c->samples;
 			while (sample) {
-				if (sample->type == TYPE_RUNNING)
-					svg_process(sample->cpu, sample->start_time, sample->end_time, "sample", c->comm);
+				if (sample->type == TYPE_RUNNING) {
+					svg_process(sample->cpu,
+						    sample->start_time,
+						    sample->end_time,
+						    "sample",
+						    c->comm,
+						    sample->backtrace);
+				}
 
 				sample = sample->next;
 			}
diff --git a/tools/perf/util/svghelper.c b/tools/perf/util/svghelper.c
index 8b79d3a..740f032 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)
 	fprintf(svgfile, "</g>\n");
 }
 
-void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name)
+void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name, const char *backtrace)
 {
 	double width;
 
@@ -295,6 +295,8 @@ void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name
 
 	fprintf(svgfile, "<g transform=\"translate(%4.8f,%4.8f)\">\n", time2pixels(start), cpu2y(cpu));
 	fprintf(svgfile, "<title>%s %s</title>\n", name, time_to_string(end - start));
+	if (backtrace)
+		fprintf(svgfile, "<desc>Switched because:\n%s</desc>\n", backtrace);
 	fprintf(svgfile, "<rect x=\"0\" width=\"%4.8f\" y=\"0\" height=\"%4.1f\" class=\"%s\"/>\n",
 		time2pixels(end)-time2pixels(start), SLOT_MULT+SLOT_HEIGHT, type);
 	width = time2pixels(end)-time2pixels(start);
diff --git a/tools/perf/util/svghelper.h b/tools/perf/util/svghelper.h
index fad79ce..7db6ae9 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
 extern void svg_cpu_box(int cpu, u64 max_frequency, u64 turbo_frequency);
 
 
-extern void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name);
+extern void svg_process(int cpu, u64 start, u64 end, const char *type, const char *name, const char *backtrace);
 extern void svg_cstate(int cpu, u64 start, u64 end, int type);
 extern void svg_pstate(int cpu, u64 start, u64 end, u64 freq);
 

  reply	other threads:[~2013-12-18 10:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-02 14:37 [PATCH 0/5] perf timechart improvements part 2 Stanislav Fomichev
2013-12-02 14:37 ` [PATCH 1/5] perf timechart: add backtrace support to CPU info Stanislav Fomichev
2013-12-18 10:30   ` tip-bot for Stanislav Fomichev [this message]
2013-12-02 14:37 ` [PATCH 2/5] perf timechart: print pid along the name Stanislav Fomichev
2013-12-18 10:30   ` [tip:perf/core] perf timechart: Print " tip-bot for Stanislav Fomichev
2013-12-02 14:37 ` [PATCH 3/5] perf timechart: get number of CPUs from perf header Stanislav Fomichev
2013-12-18 10:31   ` [tip:perf/core] perf timechart: Get " tip-bot for Stanislav Fomichev
2013-12-02 14:37 ` [PATCH 4/5] perf timechart: add support for topology Stanislav Fomichev
2013-12-18 10:31   ` [tip:perf/core] perf timechart: Add " tip-bot for Stanislav Fomichev
2013-12-16 19:38 ` [PATCH 0/5] perf timechart improvements part 2 Arnaldo Carvalho de Melo
2013-12-17  9:38   ` [PATCH 5/5] perf timechart: add emphasize option Stanislav Fomichev
2013-12-17 11:23     ` Ingo Molnar
2013-12-17 12:15       ` [PATCH 5/5 v2] " Stanislav Fomichev
2013-12-17 13:12         ` Ingo Molnar
2013-12-17 13:38         ` Arnaldo Carvalho de Melo
2013-12-17 13:41           ` Ingo Molnar
2013-12-17 13:59             ` Arnaldo Carvalho de Melo
2013-12-17 14:06               ` Ingo Molnar
2013-12-17 14:15                 ` Arnaldo Carvalho de Melo
2013-12-17 14:26                   ` Ingo Molnar
2013-12-17 15:03                   ` David Ahern
2013-12-17 15:53                   ` Stanislav Fomichev
2013-12-18 10:33                     ` [tip:perf/core] perf timechart: Add --highlight option tip-bot for Stanislav Fomichev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-8b6dcca017aa53fe13066411a653b5997c158a2c@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=artagnon@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    --cc=stfomichev@yandex-team.ru \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.