Skip to content

Commit e53de7b

Browse files
namhyungacmel
authored andcommitted
perf lock contention: Fix struct rq lock access
The BPF CO-RE's ignore suffix rule requires three underscores. Otherwise it'd fail like below: $ sudo perf lock contention -ab libbpf: prog 'collect_lock_syms': BPF program load failed: Invalid argument libbpf: prog 'collect_lock_syms': -- BEGIN PROG LOAD LOG -- reg type unsupported for arg#0 function collect_lock_syms#380 ; int BPF_PROG(collect_lock_syms) 0: (b7) r6 = 0 ; R6_w=0 1: (b7) r7 = 0 ; R7_w=0 2: (b7) r9 = 1 ; R9_w=1 3: <invalid CO-RE relocation> failed to resolve CO-RE relocation <byte_off> [381] struct rq__new.__lock (0:0 @ offset 0) Fixes: 0c12284 ("perf lock contention: Support pre-5.14 kernels") Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Andrii Nakryiko <[email protected]> Cc: Hao Luo <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Song Liu <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 06bff3d commit e53de7b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/perf/util/bpf_skel/lock_contention.bpf.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,11 +418,11 @@ int contention_end(u64 *ctx)
418418

419419
extern struct rq runqueues __ksym;
420420

421-
struct rq__old {
421+
struct rq___old {
422422
raw_spinlock_t lock;
423423
} __attribute__((preserve_access_index));
424424

425-
struct rq__new {
425+
struct rq___new {
426426
raw_spinlock_t __lock;
427427
} __attribute__((preserve_access_index));
428428

@@ -434,8 +434,8 @@ int BPF_PROG(collect_lock_syms)
434434

435435
for (int i = 0; i < MAX_CPUS; i++) {
436436
struct rq *rq = bpf_per_cpu_ptr(&runqueues, i);
437-
struct rq__new *rq_new = (void *)rq;
438-
struct rq__old *rq_old = (void *)rq;
437+
struct rq___new *rq_new = (void *)rq;
438+
struct rq___old *rq_old = (void *)rq;
439439

440440
if (rq == NULL)
441441
break;

0 commit comments

Comments
 (0)