From f8c3f0e7ed109ee3f88dc6dd5dda398ec9ed074c Mon Sep 17 00:00:00 2001 From: David Miller Date: Tue, 27 Mar 2012 03:14:18 -0400 Subject: [PATCH] --- yaml --- r: 299233 b: refs/heads/master c: 63fa471dd49e9c9ce029d910d1024330d9b1b145 h: refs/heads/master i: 299231: e2a6d69978eb07e440b4da4a2694cfa321c46de3 v: v3 --- [refs] | 2 +- trunk/tools/perf/util/hist.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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; }