From: tip-bot for Arnaldo Carvalho de Melo <acme@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, paulus@samba.org, acme@redhat.com,
hpa@zytor.com, mingo@redhat.com, peterz@infradead.org,
efault@gmx.de, tglx@linutronix.de, mingo@elte.hu
Subject: [tip:perfcounters/urgent] perf report: Add --symbols parameter
Date: Tue, 30 Jun 2009 22:55:10 GMT [thread overview]
Message-ID: <tip-7bec7a9134c25cecb0d7029199b59f7b1bef35b8@git.kernel.org> (raw)
In-Reply-To: <1246399282-20934-4-git-send-email-acme@redhat.com>
Commit-ID: 7bec7a9134c25cecb0d7029199b59f7b1bef35b8
Gitweb: http://git.kernel.org/tip/7bec7a9134c25cecb0d7029199b59f7b1bef35b8
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Tue, 30 Jun 2009 19:01:22 -0300
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Wed, 1 Jul 2009 00:07:10 +0200
perf report: Add --symbols parameter
So that we can filter by symbol name.
The 'pfunct' utility in the 'dwarves' package can be used to
create a file with the functions one wants.
Example:
[acme@doppio pahole]$ pfunct /usr/lib/debug/usr/lib64/libdw-0.141.so.debug | grep dwarf > /tmp/dwarf.symbols
[acme@doppio pahole]$ wc -l /tmp/dwarf.symbols
93 /tmp/dwarf.symbols
[acme@doppio pahole]$ head -3 /tmp/dwarf.symbols
dwfl_addrdwarf
dwfl_module_getdwarf
dwfl_getdwarf
[acme@doppio pahole]$ perf report --sort comm,dso,symbol --comms pahole --dsos /usr/lib64/libdw-0.141.so --symbols file:///tmp/dwarf.symbols
33.99% pahole /usr/lib64/libdw-0.141.so [.] dwarf_tag
29.07% pahole /usr/lib64/libdw-0.141.so [.] dwarf_decl_file
27.71% pahole /usr/lib64/libdw-0.141.so [.] dwarf_getsrclines
4.54% pahole /usr/lib64/libdw-0.141.so 0x00000000007400
3.93% pahole /usr/lib64/libdw-0.141.so [.] dwarf_decl_line
0.46% pahole /usr/lib64/libdw-0.141.so [.] dwarf_getlocation
0.18% pahole /usr/lib64/libdw-0.141.so [.] __libdwarf_next_prime
0.13% pahole /usr/lib64/libdw-0.141.so [.] dwarf_diecu
[acme@doppio pahole]$
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1246399282-20934-4-git-send-email-acme@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/Documentation/perf-report.txt | 4 ++++
tools/perf/builtin-report.c | 10 ++++++++--
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt
index 4c44ef1..8aa3f8c 100644
--- a/tools/perf/Documentation/perf-report.txt
+++ b/tools/perf/Documentation/perf-report.txt
@@ -28,6 +28,10 @@ OPTIONS
--comms=::
Only consider symbols in these comms. CSV that understands
file://filename entries.
+-S::
+--symbols=::
+ Only consider these symbols. CSV that understands
+ file://filename entries.
SEE ALSO
--------
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 8143477..135b783 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -33,8 +33,8 @@ static char *vmlinux = NULL;
static char default_sort_order[] = "comm,dso";
static char *sort_order = default_sort_order;
-static char *dso_list_str, *comm_list_str;
-static struct strlist *dso_list, *comm_list;
+static char *dso_list_str, *comm_list_str, *sym_list_str;
+static struct strlist *dso_list, *comm_list, *sym_list;
static int input;
static int show_mask = SHOW_KERNEL | SHOW_USER | SHOW_HV;
@@ -1281,6 +1281,9 @@ process_sample_event(event_t *event, unsigned long offset, unsigned long head)
if (dso_list && dso && dso->name && !strlist__has_entry(dso_list, dso->name))
return 0;
+ if (sym_list && sym && !strlist__has_entry(sym_list, sym->name))
+ return 0;
+
if (hist_entry__add(thread, map, dso, sym, ip, chain, level, period)) {
eprintf("problem incrementing symbol count, skipping event\n");
return -1;
@@ -1672,6 +1675,8 @@ static const struct option options[] = {
"only consider symbols in these dsos"),
OPT_STRING('C', "comms", &comm_list_str, "comm[,comm...]",
"only consider symbols in these comms"),
+ OPT_STRING('S', "symbols", &sym_list_str, "symbol[,symbol...]",
+ "only consider these symbols"),
OPT_END()
};
@@ -1726,6 +1731,7 @@ int cmd_report(int argc, const char **argv, const char *prefix)
setup_list(&dso_list, dso_list_str, "dso");
setup_list(&comm_list, comm_list_str, "comm");
+ setup_list(&sym_list, sym_list_str, "symbol");
setup_pager();
next prev parent reply other threads:[~2009-06-30 22:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-30 22:01 [PATCH 0/3] perf_counter tools: filter by comm, dso & symbol lists Linux Kernel Mailing List <linux-kernel@vger.kernel.org> Arnaldo Carvalho de Melo
2009-06-30 22:01 ` [PATCH tip 1/3] perf_counter tools: Add --dsos parameter to 'perf report' Arnaldo Carvalho de Melo
2009-06-30 22:01 ` [PATCH tip 2/3] perf_counter tools: Add --comms " Arnaldo Carvalho de Melo
2009-06-30 22:01 ` [PATCH tip 3/3] perf_counter tools: Add --symbols " Arnaldo Carvalho de Melo
2009-06-30 22:55 ` tip-bot for Arnaldo Carvalho de Melo [this message]
2009-06-30 22:54 ` [tip:perfcounters/urgent] perf report: Add --comms parameter tip-bot for Arnaldo Carvalho de Melo
2009-06-30 22:54 ` [tip:perfcounters/urgent] perf report: Add --dsos parameter tip-bot for Arnaldo Carvalho de Melo
2009-06-30 22:08 ` [PATCH 0/3] perf_counter tools: filter by comm, dso & symbol lists Linux Kernel Mailing List <linux-kernel@vger.kernel.org> 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=tip-7bec7a9134c25cecb0d7029199b59f7b1bef35b8@git.kernel.org \
--to=acme@redhat.com \
--cc=efault@gmx.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox