diff --git a/[refs] b/[refs] index 596aa2348645..5acbb5fedc1b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8b84a568117fde9b77575f2060274eddab424c32 +refs/heads/master: 63fa471dd49e9c9ce029d910d1024330d9b1b145 diff --git a/trunk/tools/perf/util/hist.c b/trunk/tools/perf/util/hist.c index 2ec4b60aff6c..9f6d630d5316 100644 --- a/trunk/tools/perf/util/hist.c +++ b/trunk/tools/perf/util/hist.c @@ -256,6 +256,18 @@ static struct hist_entry *add_hist_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; }