linux/tools/lib/perf
Riccardo Mancini 6e93bc534f libperf cpumap: Take into advantage it is sorted to optimize perf_cpu_map__max()
From commit 7074674e73 ("perf cpumap: Maintain cpumaps ordered and
without dups"), perf_cpu_map elements are sorted in ascending order.

This patch improves the perf_cpu_map__max function by returning the last
element.

Committer notes:

Do it as a ternary to keep it in just one return line, add a comment
explaining it is sorted and what functions does it.

Signed-off-by: Riccardo Mancini <rickyman7@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/fb79f02e7b86ea8044d563adb1e9890c906f982f.1629490974.git.rickyman7@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2021-08-31 16:17:02 -03:00
..
Documentation libperf: Add evsel mmap support 2021-04-15 16:38:51 -03:00
include libperf tests: Fix verbose printing 2021-08-24 15:05:35 -03:00
tests libperf: Add tests for perf_evlist__set_leader() 2021-07-09 15:34:41 -03:00
Build libperf: Change tests to single static and shared binaries 2021-07-07 11:41:58 -03:00
core.c
cpumap.c libperf cpumap: Take into advantage it is sorted to optimize perf_cpu_map__max() 2021-08-31 16:17:02 -03:00
evlist.c libperf: Adopt evlist__set_leader() from tools/perf as perf_evlist__set_leader() 2021-07-09 14:04:32 -03:00
evsel.c libperf: Remove BUG_ON() from library code in get_group_fd() 2021-07-09 15:33:39 -03:00
internal.h
lib.c
libperf.map libperf: Adopt evlist__set_leader() from tools/perf as perf_evlist__set_leader() 2021-07-09 14:04:32 -03:00
libperf.pc.template
Makefile libperf: Change tests to single static and shared binaries 2021-07-07 11:41:58 -03:00
mmap.c libperf: Add support for user space counter access 2021-04-20 08:10:45 -03:00
threadmap.c
xyarray.c