perf lock contention: Factor out lock_contention_get_name()
authorNamhyung Kim <namhyung@kernel.org>
Fri, 3 Feb 2023 02:13:22 +0000 (18:13 -0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 3 Feb 2023 20:12:26 +0000 (17:12 -0300)
commit492fef218a6606c53bbb979a65b8f827c5ea02ce
tree59a84f8ba0a133eb153a812ecd95d9c19a83fc96
parent7105311c2d3bce8f52653dbfe87de475a251892b
perf lock contention: Factor out lock_contention_get_name()

The lock_contention_get_name() returns a name for the lock stat entry
based on the current aggregation mode.  As it's called sequentially in a
single thread, it can return the address of a static buffer for symbol
and offset of the caller.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <song@kernel.org>
Cc: bpf@vger.kernel.org
Link: https://lore.kernel.org/r/20230203021324.143540-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/bpf_lock_contention.c