summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
authorDavid Ahern2011-05-27 22:28:44 +0200
committerArnaldo Carvalho de Melo2011-06-02 18:29:14 +0200
commit610723f24eeb842025178a6722fa9108c4e157b6 (patch)
treee184c3b2242ba9b9da065221d4673603dd9d8e86 /tools/perf/util/session.c
parentperf script: "sym" field really means show IP data (diff)
downloadkernel-qcow2-linux-610723f24eeb842025178a6722fa9108c4e157b6.tar.gz
kernel-qcow2-linux-610723f24eeb842025178a6722fa9108c4e157b6.tar.xz
kernel-qcow2-linux-610723f24eeb842025178a6722fa9108c4e157b6.zip
perf script: Make printing of dso a separate field option
The 'sym' option displays both the function name and the DSO it comes from. Split the display of the dso into a separate option. This allows display of the ip address and symbol without the dso, thus shortening line lengths - and decluttering the output a bit. Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1306528124-25861-3-git-send-email-dsahern@gmail.com Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index ad33650cdd41..0dd418299261 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1205,7 +1205,7 @@ struct perf_evsel *perf_session__find_first_evtype(struct perf_session *session,
void perf_session__print_ip(union perf_event *event,
struct perf_sample *sample,
struct perf_session *session,
- int print_sym)
+ int print_sym, int print_dso)
{
struct addr_location al;
const char *symname, *dsoname;
@@ -1241,12 +1241,15 @@ void perf_session__print_ip(union perf_event *event,
else
symname = "";
+ printf(" %s", symname);
+ }
+ if (print_dso) {
if (node->map && node->map->dso && node->map->dso->name)
dsoname = node->map->dso->name;
else
dsoname = "";
- printf(" %s (%s)", symname, dsoname);
+ printf(" (%s)", dsoname);
}
printf("\n");
@@ -1261,12 +1264,16 @@ void perf_session__print_ip(union perf_event *event,
else
symname = "";
+ printf(" %s", symname);
+ }
+
+ if (print_dso) {
if (al.map && al.map->dso && al.map->dso->name)
dsoname = al.map->dso->name;
else
dsoname = "";
- printf(" %s (%s)", symname, dsoname);
+ printf(" (%s)", dsoname);
}
}
}