diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-02-04 10:43:24 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-02-05 09:28:48 -0500 |
commit | 2f525d0148ef2734c8a172201e5e1e9167a8a5fd (patch) | |
tree | 6bd0efbdeb640fa52616b20f03aed7176eb6c297 /tools/perf/builtin-report.c | |
parent | 78f7defedbb4da73b9a07635c357c1afcaa55c8f (diff) |
perf annotate: Support multiple histograms in annotation
The perf annotate tool continues aggregating everything on just one
histograms, but to support the top model add support for one histogram
perf evsel in the evlist.
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
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.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 91e4cdba933b..de06bf55efff 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -118,8 +118,17 @@ static int perf_session__add_hist_entry(struct perf_session *session, | |||
118 | * so we don't allocated the extra space needed because the stdio | 118 | * so we don't allocated the extra space needed because the stdio |
119 | * code will not use it. | 119 | * code will not use it. |
120 | */ | 120 | */ |
121 | if (use_browser > 0) | 121 | if (al->sym != NULL && use_browser > 0) { |
122 | err = hist_entry__inc_addr_samples(he, al->addr); | 122 | /* |
123 | * All aggregated on the first sym_hist. | ||
124 | */ | ||
125 | struct annotation *notes = symbol__annotation(he->ms.sym); | ||
126 | if (notes->histograms == NULL && | ||
127 | symbol__alloc_hist(he->ms.sym, 1) < 0) | ||
128 | err = -ENOMEM; | ||
129 | else | ||
130 | err = hist_entry__inc_addr_samples(he, 0, al->addr); | ||
131 | } | ||
123 | 132 | ||
124 | return err; | 133 | return err; |
125 | } | 134 | } |
@@ -349,7 +358,7 @@ static int __cmd_report(void) | |||
349 | } | 358 | } |
350 | 359 | ||
351 | if (use_browser > 0) | 360 | if (use_browser > 0) |
352 | hists__tui_browse_tree(&session->hists_tree, help); | 361 | hists__tui_browse_tree(&session->hists_tree, help, 0); |
353 | else | 362 | else |
354 | hists__tty_browse_tree(&session->hists_tree, help); | 363 | hists__tty_browse_tree(&session->hists_tree, help); |
355 | 364 | ||