Skip to contentSkip to conversation

perf tools: mark branch_info maps as referenced

PATCH In review Stephane Eranian 2 participants 3 messages Jan 14, 2013 – Jan 25, 2013 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

--

tools/perf/util/hist.c +8 -0
index cb17e2a..ab35b82 100644
@@ -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);
 
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Stephane Eranian

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.

Quoted 21 lines

--

tools/perf/util/hist.c +8 -0
index cb17e2a..ab35b82 100644
@@ -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);
 
#2 lore raw

[tip:perf/core] perf tools: Mark branch_info maps as referenced

In reply to Stephane Eranian
Commit-ID:  3cf0cb1f899640f1eb8b3984739cfd70375c9c36
Gitweb:     http://git.kernel.org/tip/3cf0cb1f899640f1eb8b3984739cfd70375c9c36
Author:     Stephane Eranian <[email protected]>
AuthorDate: Mon, 14 Jan 2013 15:02:45 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 24 Jan 2013 16:40:38 -0300

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.

---
 tools/perf/util/hist.c | 8 ++++++++
 1 file changed, 8 insertions(+)
tools/perf/util/hist.c +8 -0
index 9485c70..8170a3d 100644
@@ -245,6 +245,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);