diff options
Diffstat (limited to 'tools/perf/builtin-report.c')
| -rw-r--r-- | tools/perf/builtin-report.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 6ab16980dd66..e93c69a8e720 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | #include "util/cache.h" | 14 | #include "util/cache.h" |
| 15 | #include <linux/rbtree.h> | 15 | #include <linux/rbtree.h> |
| 16 | #include "util/symbol.h" | 16 | #include "util/symbol.h" |
| 17 | #include "util/string.h" | ||
| 18 | #include "util/callchain.h" | 17 | #include "util/callchain.h" |
| 19 | #include "util/strlist.h" | 18 | #include "util/strlist.h" |
| 20 | #include "util/values.h" | 19 | #include "util/values.h" |
| @@ -89,9 +88,12 @@ static int perf_session__add_hist_entry(struct perf_session *self, | |||
| 89 | struct event_stat_id *stats; | 88 | struct event_stat_id *stats; |
| 90 | struct perf_event_attr *attr; | 89 | struct perf_event_attr *attr; |
| 91 | 90 | ||
| 92 | if ((sort__has_parent || symbol_conf.use_callchain) && data->callchain) | 91 | if ((sort__has_parent || symbol_conf.use_callchain) && data->callchain) { |
| 93 | syms = perf_session__resolve_callchain(self, al->thread, | 92 | syms = perf_session__resolve_callchain(self, al->thread, |
| 94 | data->callchain, &parent); | 93 | data->callchain, &parent); |
| 94 | if (syms == NULL) | ||
| 95 | return -ENOMEM; | ||
| 96 | } | ||
| 95 | 97 | ||
| 96 | attr = perf_header__find_attr(data->id, &self->header); | 98 | attr = perf_header__find_attr(data->id, &self->header); |
| 97 | if (attr) | 99 | if (attr) |
| @@ -110,8 +112,8 @@ static int perf_session__add_hist_entry(struct perf_session *self, | |||
| 110 | 112 | ||
| 111 | if (symbol_conf.use_callchain) { | 113 | if (symbol_conf.use_callchain) { |
| 112 | if (!hit) | 114 | if (!hit) |
| 113 | callchain_init(&he->callchain); | 115 | callchain_init(he->callchain); |
| 114 | err = append_chain(&he->callchain, data->callchain, syms); | 116 | err = append_chain(he->callchain, data->callchain, syms); |
| 115 | free(syms); | 117 | free(syms); |
| 116 | 118 | ||
| 117 | if (err) | 119 | if (err) |
| @@ -303,14 +305,16 @@ static int __cmd_report(void) | |||
| 303 | next = rb_first(&session->stats_by_id); | 305 | next = rb_first(&session->stats_by_id); |
| 304 | while (next) { | 306 | while (next) { |
| 305 | struct event_stat_id *stats; | 307 | struct event_stat_id *stats; |
| 308 | u64 nr_hists; | ||
| 306 | 309 | ||
| 307 | stats = rb_entry(next, struct event_stat_id, rb_node); | 310 | stats = rb_entry(next, struct event_stat_id, rb_node); |
| 308 | perf_session__collapse_resort(&stats->hists); | 311 | perf_session__collapse_resort(&stats->hists); |
| 309 | perf_session__output_resort(&stats->hists, stats->stats.total); | 312 | nr_hists = perf_session__output_resort(&stats->hists, |
| 310 | 313 | stats->stats.total); | |
| 311 | if (use_browser) | 314 | if (use_browser) |
| 312 | perf_session__browse_hists(&stats->hists, | 315 | perf_session__browse_hists(&stats->hists, nr_hists, |
| 313 | stats->stats.total, help); | 316 | stats->stats.total, help, |
| 317 | input_name); | ||
| 314 | else { | 318 | else { |
| 315 | if (rb_first(&session->stats_by_id) == | 319 | if (rb_first(&session->stats_by_id) == |
| 316 | rb_last(&session->stats_by_id)) | 320 | rb_last(&session->stats_by_id)) |
| @@ -469,7 +473,8 @@ int cmd_report(int argc, const char **argv, const char *prefix __used) | |||
| 469 | setup_sorting(report_usage, options); | 473 | setup_sorting(report_usage, options); |
| 470 | 474 | ||
| 471 | if (parent_pattern != default_parent_pattern) { | 475 | if (parent_pattern != default_parent_pattern) { |
| 472 | sort_dimension__add("parent"); | 476 | if (sort_dimension__add("parent") < 0) |
| 477 | return -1; | ||
| 473 | sort_parent.elide = 1; | 478 | sort_parent.elide = 1; |
| 474 | } else | 479 | } else |
| 475 | symbol_conf.exclude_other = false; | 480 | symbol_conf.exclude_other = false; |
