summaryrefslogtreecommitdiff
path: root/tools/perf/util/map.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-04-29 08:41:21 +0200
committerIngo Molnar <mingo@kernel.org>2014-04-29 08:41:21 +0200
commit201131998fbf074b03679afedcc29948e63331ef (patch)
treefbfa52100f795fd9f048d7c08050f4f733bd7fa1 /tools/perf/util/map.h
parent2933d7813d8618f18632a7dc7f4e7f1f7d17383a (diff)
parentfabf01238289e9ae009499594fc54642f5802a24 (diff)
Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf into perf/core
Pull perf/core improvements and fixes from Jiri Olsa: * Add a test case for hists filtering (Namhyung Kim) * Share map_groups among threads of the same group (Arnaldo Carvalho de Melo, Jiri Olsa) Signed-off-by: Jiri Olsa <jolsa@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/map.h')
-rw-r--r--tools/perf/util/map.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index f00f058afb3b..d6445b27d672 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -59,8 +59,20 @@ struct map_groups {
struct rb_root maps[MAP__NR_TYPES];
struct list_head removed_maps[MAP__NR_TYPES];
struct machine *machine;
+ int refcnt;
};
+struct map_groups *map_groups__new(void);
+void map_groups__delete(struct map_groups *mg);
+
+static inline struct map_groups *map_groups__get(struct map_groups *mg)
+{
+ ++mg->refcnt;
+ return mg;
+}
+
+void map_groups__put(struct map_groups *mg);
+
static inline struct kmap *map__kmap(struct map *map)
{
return (struct kmap *)(map + 1);