Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 73e40c9b authored by Riccardo Mancini's avatar Riccardo Mancini Committed by Arnaldo Carvalho de Melo
Browse files

libperf cpumap: Use binary search in perf_cpu_map__idx() as array are sorted

Since 7074674e

 ("perf cpumap: Maintain cpumaps ordered and
without dups") perf_cpu_map elements are sorted in ascending order.

This patch improves perf_cpu_map__idx() by using a binary search.

Signed-off-by: default avatarRiccardo Mancini <rickyman7@gmail.com>
Cc: Andi Kleen <ak@linux.intel.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/f1543c15797169c21e8b205a4a6751159180580d.1629490974.git.rickyman7@gmail.com


[ Removed 'else' after if + return, declared variables where needed ]
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 47e7dd34
Branches
Tags
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment