diff options
Diffstat (limited to 'tools/perf/util/hist.c')
| -rw-r--r-- | tools/perf/util/hist.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 2ec4b60aff6c..9f6d630d5316 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
| @@ -256,6 +256,18 @@ static struct hist_entry *add_hist_entry(struct hists *hists, | |||
| 256 | if (!cmp) { | 256 | if (!cmp) { |
| 257 | he->period += period; | 257 | he->period += period; |
| 258 | ++he->nr_events; | 258 | ++he->nr_events; |
| 259 | |||
| 260 | /* If the map of an existing hist_entry has | ||
| 261 | * become out-of-date due to an exec() or | ||
| 262 | * similar, update it. Otherwise we will | ||
| 263 | * mis-adjust symbol addresses when computing | ||
| 264 | * the history counter to increment. | ||
| 265 | */ | ||
| 266 | if (he->ms.map != entry->ms.map) { | ||
| 267 | he->ms.map = entry->ms.map; | ||
| 268 | if (he->ms.map) | ||
| 269 | he->ms.map->referenced = true; | ||
| 270 | } | ||
| 259 | goto out; | 271 | goto out; |
| 260 | } | 272 | } |
| 261 | 273 | ||
