aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-09-14 04:35:28 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-09-17 12:09:43 -0400
commit034a9265c289d5298bac7bfd824d3d5b9ec892b4 (patch)
tree480fd6fccf08545c309dfe6263ba2b4656d94fde /tools/perf/builtin-report.c
parent1af556406670f2076ea235ba8ba16da13d227e99 (diff)
perf report: Enable integrated annotation only if possible
The integrated annotation feature is supported only in TUI mode. Also it should be enabled with 'symbol' sort key otherwise resulting hist entry doesn't need to have same symbol as of a sample so that it can fail on hist_entry__inc_addr_samples with -ERANGE. You can easily see it when start perf report TUI without symbol* sort key. This patch fixes the problem. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1347611729-16994-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 97b2e6300f4c..b6696dd51cb0 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -93,7 +93,7 @@ static int perf_report__add_branch_hist_entry(struct perf_tool *tool,
93 struct annotation *notes; 93 struct annotation *notes;
94 err = -ENOMEM; 94 err = -ENOMEM;
95 bx = he->branch_info; 95 bx = he->branch_info;
96 if (bx->from.sym && use_browser > 0) { 96 if (bx->from.sym && use_browser == 1 && sort__has_sym) {
97 notes = symbol__annotation(bx->from.sym); 97 notes = symbol__annotation(bx->from.sym);
98 if (!notes->src 98 if (!notes->src
99 && symbol__alloc_hist(bx->from.sym) < 0) 99 && symbol__alloc_hist(bx->from.sym) < 0)
@@ -107,7 +107,7 @@ static int perf_report__add_branch_hist_entry(struct perf_tool *tool,
107 goto out; 107 goto out;
108 } 108 }
109 109
110 if (bx->to.sym && use_browser > 0) { 110 if (bx->to.sym && use_browser == 1 && sort__has_sym) {
111 notes = symbol__annotation(bx->to.sym); 111 notes = symbol__annotation(bx->to.sym);
112 if (!notes->src 112 if (!notes->src
113 && symbol__alloc_hist(bx->to.sym) < 0) 113 && symbol__alloc_hist(bx->to.sym) < 0)
@@ -162,7 +162,7 @@ static int perf_evsel__add_hist_entry(struct perf_evsel *evsel,
162 * so we don't allocated the extra space needed because the stdio 162 * so we don't allocated the extra space needed because the stdio
163 * code will not use it. 163 * code will not use it.
164 */ 164 */
165 if (he->ms.sym != NULL && use_browser > 0) { 165 if (he->ms.sym != NULL && use_browser == 1 && sort__has_sym) {
166 struct annotation *notes = symbol__annotation(he->ms.sym); 166 struct annotation *notes = symbol__annotation(he->ms.sym);
167 167
168 assert(evsel != NULL); 168 assert(evsel != NULL);
@@ -692,12 +692,14 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
692 else 692 else
693 use_browser = 0; 693 use_browser = 0;
694 694
695 setup_sorting(report_usage, options);
696
695 /* 697 /*
696 * Only in the newt browser we are doing integrated annotation, 698 * Only in the newt browser we are doing integrated annotation,
697 * so don't allocate extra space that won't be used in the stdio 699 * so don't allocate extra space that won't be used in the stdio
698 * implementation. 700 * implementation.
699 */ 701 */
700 if (use_browser > 0) { 702 if (use_browser == 1 && sort__has_sym) {
701 symbol_conf.priv_size = sizeof(struct annotation); 703 symbol_conf.priv_size = sizeof(struct annotation);
702 report.annotate_init = symbol__annotate_init; 704 report.annotate_init = symbol__annotate_init;
703 /* 705 /*
@@ -720,8 +722,6 @@ int cmd_report(int argc, const char **argv, const char *prefix __maybe_unused)
720 if (symbol__init() < 0) 722 if (symbol__init() < 0)
721 goto error; 723 goto error;
722 724
723 setup_sorting(report_usage, options);
724
725 if (parent_pattern != default_parent_pattern) { 725 if (parent_pattern != default_parent_pattern) {
726 if (sort_dimension__add("parent") < 0) 726 if (sort_dimension__add("parent") < 0)
727 goto error; 727 goto error;