X-Git-Url: http://git.alex.org.uk diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index 216e33a..e0a0970 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -230,6 +230,18 @@ struct hist_entry *__hists__add_entry(struct hists *hists, if (!cmp) { he->period += period; ++he->nr_events; + + /* If the map of an existing hist_entry has + * become out-of-date due to an exec() or + * similar, update it. Otherwise we will + * mis-adjust symbol addresses when computing + * the history counter to increment. + */ + if (he->ms.map != entry.ms.map) { + he->ms.map = entry.ms.map; + if (he->ms.map) + he->ms.map->referenced = true; + } goto out; }