[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190221160652.1788-2-jonas.rabenstein@studium.uni-erlangen.de>
Date: Thu, 21 Feb 2019 17:06:50 +0100
From: Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>
To: linux-perf-users@...r.kernel.org
Cc: Adrian Hunter <adrian.hunter@...el.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
David Miller <davem@...emloft.net>,
Eric Saint-Etienne <eric.saint.etienne@...cle.com>,
Ingo Molnar <mingo@...hat.com>, Jiri Olsa <jolsa@...hat.com>,
Kim Phillips <kim.phillips@....com>,
Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
Milian Wolff <milian.wolff@...b.com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Rob Gardner <rob.gardner@...cle.com>,
Sandipan Das <sandipan@...ux.ibm.com>,
linux-kernel@...r.kernel.org,
Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>
Subject: [PATCH 1/3] perf map: add function to lookup inline symbols
Inlined symbols should always be added to the dso's inlined_nodes tree
in order to reuse them for a later lookup for the same address. Instead
of repeating those steps at the different users, provide a central
method to lookup and register inline symbols for a map.
Signed-off-by: Jonas Rabenstein <jonas.rabenstein@...dium.uni-erlangen.de>
---
tools/perf/util/map.c | 23 +++++++++++++++++++++++
tools/perf/util/map.h | 3 +++
2 files changed, 26 insertions(+)
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 6751301a755c..0fe74e83ca8d 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -988,3 +988,26 @@ struct map_groups *map__kmaps(struct map *map)
}
return kmap->kmaps;
}
+
+struct inline_node *map__inlines(struct map *map, u64 addr, struct symbol *sym)
+{
+ struct inline_node *node;
+
+ if (!symbol_conf.inline_name)
+ return NULL;
+
+ if (!map->dso)
+ return NULL;
+
+ addr = map->map_ip(map, addr);
+ addr = map__rip_2objdump(map, addr);
+
+ node = inlines__tree_find(&map->dso->inlined_nodes, addr);
+ if (node)
+ return node;
+
+ node = dso__parse_addr_inlines(map->dso, addr, sym);
+ if (node)
+ inlines__tree_insert(&map->dso->inlined_nodes, node);
+ return node;
+}
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index 09282aa45c80..bdcc6e77e26e 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -270,4 +270,7 @@ static inline bool is_entry_trampoline(const char *name)
return !strcmp(name, ENTRY_TRAMPOLINE_NAME);
}
+struct inline_node *map__inlines(struct map *map, u64 addr,
+ struct symbol *sym);
+
#endif /* __PERF_MAP_H */
--
2.19.2
Powered by blists - more mailing lists