perf util: Use cached rbtree for rblists
authorDavidlohr Bueso <dave@stgolabs.net>
Thu, 6 Dec 2018 19:18:16 +0000 (11:18 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 25 Jan 2019 14:12:10 +0000 (15:12 +0100)
commitca2270292e6c3415102242bf9dc3d05f622b7b28
tree716a1cf2f73101e4d02569585fd26cb320f9a703
parent55ecd6310f9fe48cf7e435be408862da1e0e6baa
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>
tools/perf/util/intlist.h
tools/perf/util/metricgroup.c
tools/perf/util/rb_resort.h
tools/perf/util/rblist.c
tools/perf/util/rblist.h
tools/perf/util/stat-shadow.c
tools/perf/util/strlist.h