lkml.org 
[lkml]   [2013]   [Jan]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] perf tools: mark branch_info maps as referenced

As noticed by Jiri, the hist_entry->branch_info.to/from maps
need to be marked as referenced to avoid problems later on.
So we do this when the hist_entry is allocated.

Signed-off-by: Stephane Eranian <eranian@google.com>
--

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index cb17e2a..ab35b82 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -242,6 +242,14 @@ static struct hist_entry *hist_entry__new(struct hist_entry *template)

if (he->ms.map)
he->ms.map->referenced = true;
+
+ if (he->branch_info) {
+ if (he->branch_info->from.map)
+ he->branch_info->from.map->referenced = true;
+ if (he->branch_info->to.map)
+ he->branch_info->to.map->referenced = true;
+ }
+
if (symbol_conf.use_callchain)
callchain_init(he->callchain);


\
 
 \ /
  Last update: 2013-01-14 15:43    [W:0.056 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site