aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-03-16 04:50:54 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-03-16 15:41:30 -0400
commitb14ffaca44c60da1c900aa36131ef3d9858001fc (patch)
treef78378c12bb5d8ce2113bee0a38a0f89ba33feb3 /tools
parent938a23ae7f656ffde9dd67e83dddf4406f85d773 (diff)
perf report: Add --symbol-filter option
Add new --symbol-filter command line option to set appropriate filter string. Its short version is missing as I couldn't find an ideal one and --filter option of perf record also has no short version. Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1331887855-874-4-git-send-email-namhyung.kim@lge.com Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-report.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 8e91c6eba18a..80fb90741b64 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -50,6 +50,7 @@ struct perf_report {
50 const char *pretty_printing_style; 50 const char *pretty_printing_style;
51 symbol_filter_t annotate_init; 51 symbol_filter_t annotate_init;
52 const char *cpu_list; 52 const char *cpu_list;
53 const char *symbol_filter_str;
53 DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS); 54 DECLARE_BITMAP(cpu_bitmap, MAX_NR_CPUS);
54}; 55};
55 56
@@ -400,6 +401,9 @@ static int __cmd_report(struct perf_report *rep)
400 list_for_each_entry(pos, &session->evlist->entries, node) { 401 list_for_each_entry(pos, &session->evlist->entries, node) {
401 struct hists *hists = &pos->hists; 402 struct hists *hists = &pos->hists;
402 403
404 if (pos->idx == 0)
405 hists->symbol_filter_str = rep->symbol_filter_str;
406
403 hists__collapse_resort(hists); 407 hists__collapse_resort(hists);
404 hists__output_resort(hists); 408 hists__output_resort(hists);
405 nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE]; 409 nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE];
@@ -591,6 +595,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used)
591 "only consider symbols in these comms"), 595 "only consider symbols in these comms"),
592 OPT_STRING('S', "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]", 596 OPT_STRING('S', "symbols", &symbol_conf.sym_list_str, "symbol[,symbol...]",
593 "only consider these symbols"), 597 "only consider these symbols"),
598 OPT_STRING(0, "symbol-filter", &report.symbol_filter_str, "filter",
599 "only show symbols that (partially) match with this filter"),
594 OPT_STRING('w', "column-widths", &symbol_conf.col_width_list_str, 600 OPT_STRING('w', "column-widths", &symbol_conf.col_width_list_str,
595 "width[,width...]", 601 "width[,width...]",
596 "don't try to adjust column width, use these fixed values"), 602 "don't try to adjust column width, use these fixed values"),