summaryrefslogtreecommitdiff
path: root/tools/perf/util/bpf_skel
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2024-04-22 19:35:18 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2024-04-22 19:35:18 +0300
commit173b0b5b0e865348684c02bd9cb1d22b5d46e458 (patch)
treea42a2cc8b724b94a9478aedfcbfabcec0197b246 /tools/perf/util/bpf_skel
parent61ba075d9911d2a6db181fbb5602762a24d5d0a9 (diff)
parented30a4a51bb196781c8058073ea720133a65596f (diff)
downloadlinux-173b0b5b0e865348684c02bd9cb1d22b5d46e458.tar.xz
Merge remote-tracking branch 'torvalds/master' into perf-tools-next
To pick up fixes sent via perf-tools, by Namhyung Kim. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/bpf_skel')
-rw-r--r--tools/perf/util/bpf_skel/lock_contention.bpf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/bpf_skel/lock_contention.bpf.c b/tools/perf/util/bpf_skel/lock_contention.bpf.c
index fb54bd38e7d0..d931a898c434 100644
--- a/tools/perf/util/bpf_skel/lock_contention.bpf.c
+++ b/tools/perf/util/bpf_skel/lock_contention.bpf.c
@@ -284,6 +284,7 @@ static inline __u32 check_lock_type(__u64 lock, __u32 flags)
struct task_struct *curr;
struct mm_struct___old *mm_old;
struct mm_struct___new *mm_new;
+ struct sighand_struct *sighand;
switch (flags) {
case LCB_F_READ: /* rwsem */
@@ -305,7 +306,9 @@ static inline __u32 check_lock_type(__u64 lock, __u32 flags)
break;
case LCB_F_SPIN: /* spinlock */
curr = bpf_get_current_task_btf();
- if (&curr->sighand->siglock == (void *)lock)
+ sighand = curr->sighand;
+
+ if (sighand && &sighand->siglock == (void *)lock)
return LCD_F_SIGHAND_LOCK;
break;
default: