aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/lib
diff options
context:
space:
mode:
authorJiri Olsa2019-09-02 22:20:12 +0200
committerArnaldo Carvalho de Melo2019-09-25 09:51:48 -0300
commit1d5af02d7a92acaa877ab0fbec0756114852720a (patch)
treef81ad151b425160512d005f98215ae009dfd3924 /tools/perf/lib
parente7eb9002d4513ac4a26c756b72e6c25bf063baf2 (diff)
libperf: Move 'heads' from 'struct evlist' to 'struct perf_evlist'
Move 'heads' hash table from 'struct evlist' to 'struct perf_evlist'. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lore.kernel.org/lkml/20190913132355.21634-27-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/lib')
-rw-r--r--tools/perf/lib/evlist.c4
-rw-r--r--tools/perf/lib/include/internal/evlist.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/lib/evlist.c b/tools/perf/lib/evlist.c
index f4dc9a208332..2bdd9d2c79d9 100644
--- a/tools/perf/lib/evlist.c
+++ b/tools/perf/lib/evlist.c
@@ -11,6 +11,10 @@
void perf_evlist__init(struct perf_evlist *evlist)
{
+ int i;
+
+ for (i = 0; i < PERF_EVLIST__HLIST_SIZE; ++i)
+ INIT_HLIST_HEAD(&evlist->heads[i]);
INIT_LIST_HEAD(&evlist->entries);
evlist->nr_entries = 0;
}
diff --git a/tools/perf/lib/include/internal/evlist.h b/tools/perf/lib/include/internal/evlist.h
index 8a4eb66fbf3a..c5a06890fd6a 100644
--- a/tools/perf/lib/include/internal/evlist.h
+++ b/tools/perf/lib/include/internal/evlist.h
@@ -5,6 +5,9 @@
#include <linux/list.h>
#include <api/fd/array.h>
+#define PERF_EVLIST__HLIST_BITS 8
+#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)
+
struct perf_cpu_map;
struct perf_thread_map;
@@ -17,6 +20,7 @@ struct perf_evlist {
int nr_mmaps;
size_t mmap_len;
struct fdarray pollfd;
+ struct hlist_head heads[PERF_EVLIST__HLIST_SIZE];
};
/**