Skip to contentSkip to conversation

perf map: Move structs and prototypes for map groups to a separate header

tip:perf/core tip-bot for Arnaldo Carvalho de Melo 1 participant 1 message Feb 9, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Commit-ID:  41f30914fc33116cfd0fd0982c8effe435d97698
Gitweb:     https://git.kernel.org/tip/41f30914fc33116cfd0fd0982c8effe435d97698
Author:     Arnaldo Carvalho de Melo <[email protected]>
AuthorDate: Sun, 27 Jan 2019 13:44:29 +0100
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Wed, 6 Feb 2019 10:00:38 -0300

perf map: Move structs and prototypes for map groups to a separate header

And since machine.h only needs what is in there, make it stop including map.h and instead include this newly introduced map_groups.h instead.

---
 tools/perf/arch/arm/tests/dwarf-unwind.c     |  1 +
 tools/perf/arch/arm64/tests/dwarf-unwind.c   |  1 +
 tools/perf/arch/powerpc/tests/dwarf-unwind.c |  1 +
 tools/perf/arch/x86/tests/dwarf-unwind.c     |  1 +
 tools/perf/ui/stdio/hist.c                   |  1 +
 tools/perf/util/machine.h                    |  2 +-
 tools/perf/util/map.c                        |  6 ++
 tools/perf/util/map.h                        | 87 +-------------------------
 tools/perf/util/map_groups.h                 | 91 ++++++++++++++++++++++++++++
 tools/perf/util/probe-event.c                |  1 +
 tools/perf/util/symbol-elf.c                 |  1 +
 11 files changed, 106 insertions(+), 87 deletions(-)
tools/perf/arch/arm/tests/dwarf-unwind.c +1 -0
index 9a0242e74cfc..2c35e532bc9a 100644
@@ -3,6 +3,7 @@
 #include "perf_regs.h"
 #include "thread.h"
 #include "map.h"
+#include "map_groups.h"
 #include "event.h"
 #include "debug.h"
 #include "tests/tests.h"
tools/perf/arch/arm64/tests/dwarf-unwind.c +1 -0
index 5522ce384723..a6a407fa1b8b 100644
@@ -3,6 +3,7 @@
 #include "perf_regs.h"
 #include "thread.h"
 #include "map.h"
+#include "map_groups.h"
 #include "event.h"
 #include "debug.h"
 #include "tests/tests.h"
tools/perf/arch/powerpc/tests/dwarf-unwind.c +1 -0
index 5f39efef0856..5c178e4a1995 100644
@@ -3,6 +3,7 @@
 #include "perf_regs.h"
 #include "thread.h"
 #include "map.h"
+#include "map_groups.h"
 #include "event.h"
 #include "debug.h"
 #include "tests/tests.h"
tools/perf/arch/x86/tests/dwarf-unwind.c +1 -0
index 7879df34569a..6ad0a1cedb13 100644
@@ -3,6 +3,7 @@
 #include "perf_regs.h"
 #include "thread.h"
 #include "map.h"
+#include "map_groups.h"
 #include "event.h"
 #include "debug.h"
 #include "tests/tests.h"
tools/perf/ui/stdio/hist.c +1 -0
index 814abf5e9a5c..bb653a47f47a 100644
@@ -5,6 +5,7 @@
 #include "../../util/util.h"
 #include "../../util/hist.h"
 #include "../../util/map.h"
+#include "../../util/map_groups.h"
 #include "../../util/sort.h"
 #include "../../util/evsel.h"
 #include "../../util/srcline.h"
tools/perf/util/machine.h +1 -1
index e2f3df45410a..f70ab98a7bde 100644
@@ -4,7 +4,7 @@
 
 #include <sys/types.h>
 #include <linux/rbtree.h>
-#include "map.h"
+#include "map_groups.h"
 #include "dso.h"
 #include "event.h"
 #include "rwsem.h"
tools/perf/util/map.c +6 -0
index cf407cc9d915..fbeb0c6efaa6 100644
@@ -557,6 +557,12 @@ void map_groups__init(struct map_groups *mg, struct machine *machine)
 	refcount_set(&mg->refcnt, 1);
 }
 
+void map_groups__insert(struct map_groups *mg, struct map *map)
+{
+	maps__insert(&mg->maps, map);
+	map->groups = mg;
+}
+
 static void __maps__purge(struct maps *maps)
 {
 	struct rb_root *root = &maps->entries;
tools/perf/util/map.h +1 -86

112 lines not on this page · raw message

tools/perf/util/map_groups.h new file +91 -0

91 lines not on this page · raw message

tools/perf/util/probe-event.c +1 -0
index b0192160513d..0030f9b9bf7e 100644
@@ -42,6 +42,7 @@
 #include "cache.h"
 #include "color.h"
 #include "map.h"
+#include "map_groups.h"
 #include "symbol.h"
 #include "thread.h"
 #include <api/fs/fs.h>
tools/perf/util/symbol-elf.c +1 -0
index 848d1a0f8dc0..6b9a2a70da29 100644
@@ -7,6 +7,7 @@
 #include <inttypes.h>
 
 #include "map.h"
+#include "map_groups.h"
 #include "symbol.h"
 #include "demangle-java.h"
 #include "demangle-rust.h"