From ceb13bfc01d55388092c00796a5b76aa3dfa483a Mon Sep 17 00:00:00 2001 From: Namhyung Kim Date: Tue, 2 Aug 2022 12:10:03 -0700 Subject: perf lock: Add --map-nr-entries option The --map-nr-entries option is to control number of max entries in the perf lock contention BPF maps. Signed-off-by: Namhyung Kim Cc: Blake Jones Cc: Boqun Feng Cc: Davidlohr Bueso Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Peter Zijlstra Cc: Song Liu Cc: Waiman Long Cc: Will Deacon Link: https://lore.kernel.org/r/20220802191004.347740-2-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/bpf_lock_contention.c | 3 +++ tools/perf/util/lock-contention.h | 1 + 2 files changed, 4 insertions(+) (limited to 'tools/perf/util') diff --git a/tools/perf/util/bpf_lock_contention.c b/tools/perf/util/bpf_lock_contention.c index f5e2b4f19a72..0556cf4469ff 100644 --- a/tools/perf/util/bpf_lock_contention.c +++ b/tools/perf/util/bpf_lock_contention.c @@ -40,6 +40,9 @@ int lock_contention_prepare(struct lock_contention *con) return -1; } + bpf_map__set_max_entries(skel->maps.stacks, con->map_nr_entries); + bpf_map__set_max_entries(skel->maps.lock_stat, con->map_nr_entries); + if (target__has_cpu(target)) ncpus = perf_cpu_map__nr(evlist->core.user_requested_cpus); if (target__has_task(target)) diff --git a/tools/perf/util/lock-contention.h b/tools/perf/util/lock-contention.h index a0df5308cca4..8de8550f5ef8 100644 --- a/tools/perf/util/lock-contention.h +++ b/tools/perf/util/lock-contention.h @@ -112,6 +112,7 @@ struct lock_contention { struct target *target; struct machine *machine; struct hlist_head *result; + unsigned long map_nr_entries; }; #ifdef HAVE_BPF_SKEL -- cgit v1.2.3