summaryrefslogtreecommitdiff
path: root/tools/perf/util/map.h
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2015-05-22 13:45:24 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-05-27 20:25:16 -0300
commit6a2ffcddad22ead7ce75c5773e87895b91e7cca7 (patch)
tree21507892d91c16d26e475dc61536454f5a5c8654 /tools/perf/util/map.h
parent1eee78aea9252fabcd333805d5d9fa42a1bf9427 (diff)
perf tools: Protect accesses the map rbtrees with a rw lock
To allow concurrent access, next step: refcount struct map instances, so that we can ditch maps->removed_maps and stop leaking threads, maps, then struct DSO needs the same treatment. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Borislav Petkov <bp@suse.de> Cc: David Ahern <dsahern@gmail.com> Cc: Don Zickus <dzickus@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-o45w2w5dzrza38nzqxnqzhyf@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/map.h')
-rw-r--r--tools/perf/util/map.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index e3702fd468c5..6796f2785649 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -5,6 +5,7 @@
#include <linux/compiler.h>
#include <linux/list.h>
#include <linux/rbtree.h>
+#include <pthread.h>
#include <stdio.h>
#include <stdbool.h>
#include <linux/types.h>
@@ -60,6 +61,7 @@ struct kmap {
struct maps {
struct rb_root entries;
+ pthread_rwlock_t lock;
struct list_head removed_maps;
};