diff options
author | 2018-12-06 11:18:16 -0800 | |
---|---|---|
committer | 2019-01-25 15:12:10 +0100 | |
commit | ca2270292e6c3415102242bf9dc3d05f622b7b28 (patch) | |
tree | 716a1cf2f73101e4d02569585fd26cb320f9a703 /tools/perf/util/rblist.h | |
parent | perf callchain: Use cached rbtrees (diff) | |
download | linux-ca2270292e6c3415102242bf9dc3d05f622b7b28.tar.gz linux-ca2270292e6c3415102242bf9dc3d05f622b7b28.tar.bz2 linux-ca2270292e6c3415102242bf9dc3d05f622b7b28.zip |
perf util: Use cached rbtree for rblists
At the cost of an extra pointer, we can avoid the O(logN) cost of
finding the first element in the tree (smallest node), which is
something required for any of the strlist or intlist traversals
(XXX_for_each_entry()). There are a number of users in perf of these
(particularly strlists), including probes, and buildid.
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/20181206191819.30182-5-dave@stgolabs.net
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/rblist.h')
-rw-r--r-- | tools/perf/util/rblist.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/rblist.h b/tools/perf/util/rblist.h index 76df15c27f5f..14b232a4d0b6 100644 --- a/tools/perf/util/rblist.h +++ b/tools/perf/util/rblist.h @@ -20,7 +20,7 @@ */ struct rblist { - struct rb_root entries; + struct rb_root_cached entries; unsigned int nr_entries; int (*node_cmp)(struct rb_node *rbn, const void *entry); |