From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 08/21] perf evsel: Add option to print stack trace on single line
Date: Wed, 14 Aug 2013 15:25:02 -0300 [thread overview]
Message-ID: <1376504715-28107-9-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1376504715-28107-1-git-send-email-acme@infradead.org>
From: David Ahern <dsahern@gmail.com>
Option is used by upcoming timehist command.
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1375930261-77273-11-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/session.c | 8 ++++++--
tools/perf/util/session.h | 1 +
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index e5fd658..0d895e7 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1497,6 +1497,8 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
int print_sym = print_opts & PRINT_IP_OPT_SYM;
int print_dso = print_opts & PRINT_IP_OPT_DSO;
int print_symoffset = print_opts & PRINT_IP_OPT_SYMOFFSET;
+ int print_oneline = print_opts & PRINT_IP_OPT_ONELINE;
+ char s = print_oneline ? ' ' : '\t';
if (perf_event__preprocess_sample(event, machine, &al, sample,
NULL) < 0) {
@@ -1521,7 +1523,7 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
break;
if (print_ip)
- printf("%16" PRIx64, node->ip);
+ printf("%c%16" PRIx64, s, node->ip);
if (print_sym) {
printf(" ");
@@ -1537,7 +1539,9 @@ void perf_evsel__print_ip(struct perf_evsel *evsel, union perf_event *event,
map__fprintf_dsoname(node->map, stdout);
printf(")");
}
- printf("\n");
+
+ if (!print_oneline)
+ printf("\n");
callchain_cursor_advance(&callchain_cursor);
}
diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h
index 69e554a..7c00ccb 100644
--- a/tools/perf/util/session.h
+++ b/tools/perf/util/session.h
@@ -45,6 +45,7 @@ struct perf_session {
#define PRINT_IP_OPT_SYM (1<<1)
#define PRINT_IP_OPT_DSO (1<<2)
#define PRINT_IP_OPT_SYMOFFSET (1<<3)
+#define PRINT_IP_OPT_ONELINE (1<<4)
struct perf_tool;
--
1.8.1.4
next prev parent reply other threads:[~2013-08-14 18:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-14 18:24 [GIT PULL 00/21] perf/core improvements and fixes Arnaldo Carvalho de Melo
2013-08-14 18:24 ` [PATCH 01/21] perf kvm: Option to print events that exceed a duration Arnaldo Carvalho de Melo
2013-08-14 18:24 ` [PATCH 02/21] perf kvm: Update documentation with live command Arnaldo Carvalho de Melo
2013-08-14 18:24 ` [PATCH 03/21] perf sched: Simplify arguments to read_events Arnaldo Carvalho de Melo
2013-08-14 18:24 ` [PATCH 04/21] perf sched: Remove thread lookup in sample handler Arnaldo Carvalho de Melo
2013-08-14 18:24 ` [PATCH 05/21] perf sched: Remove sched_process_exit tracepoint Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 06/21] perf sched: Remove sched_process_fork tracepoint Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 07/21] perf tool: Simplify options to perf_evsel__print_ip Arnaldo Carvalho de Melo
2013-08-14 18:25 ` Arnaldo Carvalho de Melo [this message]
2013-08-14 18:25 ` [PATCH 09/21] perf evsel: Add option to limit stack depth in callchain dumps Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 10/21] perf session: Change perf_session__has_traces to actually check for tracepoints Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 11/21] perf machine: Add symbol filter to struct machine Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 12/21] perf top: Set the machines symbol filter Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 13/21] perf report: " Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 14/21] perf mem: Remove unused symbol filter member Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 15/21] perf annotate: Set the machines symbol filter Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 16/21] perf tools: Remove filter parameter of perf_event__preprocess_sample() Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 17/21] perf tools: Remove filter parameter of thread__find_addr_location() Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 18/21] perf tools: Remove filter parameter of thread__find_addr_map() Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 19/21] perf tests: Fix compile failure on do_sort_something Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 20/21] perf tools: Improve robustness of topology parsing code Arnaldo Carvalho de Melo
2013-08-14 18:25 ` [PATCH 21/21] perf trace: Allow specifying which syscalls to trace Arnaldo Carvalho de Melo
2013-08-15 7:52 ` [GIT PULL 00/21] perf/core improvements and fixes Ingo Molnar
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=1376504715-28107-9-git-send-email-acme@infradead.org \
--to=acme@infradead.org \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).