diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-18 13:46:32 -0500 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-12-19 09:34:04 -0500 |
| commit | 00e55218642b91c152917e170c8387c631467460 (patch) | |
| tree | 0381d5a4e92c1d02c06a597930c8a5054c1d40b6 /tools | |
| parent | b66d8c0caa8f7925ae75fed243b0482a901f21e1 (diff) | |
perf hists: Leave symbol addr hist bucket auto alloc to symbol layer
Since now symbol__addr_inc_samples() does the auto alloc, no need to do
it prior to calling hist_entry__inc_addr_samples.
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-6ife7xq2kef1nn017m04b3id@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/perf/builtin-annotate.c | 10 | ||||
| -rw-r--r-- | tools/perf/builtin-report.c | 38 |
2 files changed, 5 insertions, 43 deletions
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 6fd52c8fa682..4136f9970fd5 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c | |||
| @@ -69,15 +69,7 @@ static int perf_evsel__add_sample(struct perf_evsel *evsel, | |||
| 69 | if (he == NULL) | 69 | if (he == NULL) |
| 70 | return -ENOMEM; | 70 | return -ENOMEM; |
| 71 | 71 | ||
| 72 | ret = 0; | 72 | ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); |
| 73 | if (he->ms.sym != NULL) { | ||
| 74 | struct annotation *notes = symbol__annotation(he->ms.sym); | ||
| 75 | if (notes->src == NULL && symbol__alloc_hist(he->ms.sym) < 0) | ||
| 76 | return -ENOMEM; | ||
| 77 | |||
| 78 | ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); | ||
| 79 | } | ||
| 80 | |||
| 81 | evsel->hists.stats.total_period += sample->period; | 73 | evsel->hists.stats.total_period += sample->period; |
| 82 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); | 74 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); |
| 83 | return ret; | 75 | return ret; |
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index b75fc361b9bd..0615a63ae355 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
| @@ -122,23 +122,9 @@ static int perf_report__add_mem_hist_entry(struct perf_tool *tool, | |||
| 122 | if (!he) | 122 | if (!he) |
| 123 | return -ENOMEM; | 123 | return -ENOMEM; |
| 124 | 124 | ||
| 125 | /* | 125 | err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); |
| 126 | * In the TUI browser, we are doing integrated annotation, | 126 | if (err) |
| 127 | * so we don't allocate the extra space needed because the stdio | 127 | goto out; |
| 128 | * code will not use it. | ||
| 129 | */ | ||
| 130 | if (sort__has_sym && he->ms.sym && use_browser > 0) { | ||
| 131 | struct annotation *notes = symbol__annotation(he->ms.sym); | ||
| 132 | |||
| 133 | assert(evsel != NULL); | ||
| 134 | |||
| 135 | if (notes->src == NULL && symbol__alloc_hist(he->ms.sym) < 0) | ||
| 136 | goto out; | ||
| 137 | |||
| 138 | err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); | ||
| 139 | if (err) | ||
| 140 | goto out; | ||
| 141 | } | ||
| 142 | 128 | ||
| 143 | mx = he->mem_info; | 129 | mx = he->mem_info; |
| 144 | err = symbol__inc_addr_samples(mx->daddr.sym, mx->daddr.map, | 130 | err = symbol__inc_addr_samples(mx->daddr.sym, mx->daddr.map, |
| @@ -259,26 +245,10 @@ static int perf_evsel__add_hist_entry(struct perf_tool *tool, | |||
| 259 | if (err) | 245 | if (err) |
| 260 | return err; | 246 | return err; |
| 261 | } | 247 | } |
| 262 | /* | ||
| 263 | * Only in the TUI browser we are doing integrated annotation, | ||
| 264 | * so we don't allocated the extra space needed because the stdio | ||
| 265 | * code will not use it. | ||
| 266 | */ | ||
| 267 | if (he->ms.sym != NULL && use_browser == 1 && sort__has_sym) { | ||
| 268 | struct annotation *notes = symbol__annotation(he->ms.sym); | ||
| 269 | |||
| 270 | assert(evsel != NULL); | ||
| 271 | |||
| 272 | err = -ENOMEM; | ||
| 273 | if (notes->src == NULL && symbol__alloc_hist(he->ms.sym) < 0) | ||
| 274 | goto out; | ||
| 275 | |||
| 276 | err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); | ||
| 277 | } | ||
| 278 | 248 | ||
| 249 | err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); | ||
| 279 | evsel->hists.stats.total_period += sample->period; | 250 | evsel->hists.stats.total_period += sample->period; |
| 280 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); | 251 | hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); |
| 281 | out: | ||
| 282 | return err; | 252 | return err; |
| 283 | } | 253 | } |
| 284 | 254 | ||
