From 3fd9252fd88d2f639b3e4e6e22601015b4648019 Mon Sep 17 00:00:00 2001 From: Imran Khan Date: Thu, 14 Mar 2024 14:06:05 +1100 Subject: [PATCH] lock: Use bt_has_any in place of bt_has in rwsem scanner. Signed-off-by: Imran Khan --- drgn_tools/lock.py | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/drgn_tools/lock.py b/drgn_tools/lock.py index 170b7f86..2f92e18d 100755 --- a/drgn_tools/lock.py +++ b/drgn_tools/lock.py @@ -226,19 +226,13 @@ def scan_sem_lock(prog: Program, stack: bool) -> None: def scan_rwsem_lock(prog: Program, stack: bool) -> None: """Scan for read-write(rw) semphores""" seen_rwsems: Set[int] = set() - frame_list = bt_has(prog, "__rwsem_down_write_failed_common") - if frame_list: - show_rwsem_lock(prog, frame_list, seen_rwsems, stack) - - frame_list = bt_has(prog, "__rwsem_down_read_failed_common") - if frame_list: - show_rwsem_lock(prog, frame_list, seen_rwsems, stack) - - frame_list = bt_has(prog, "rwsem_down_write_slowpath") - if frame_list: - show_rwsem_lock(prog, frame_list, seen_rwsems, stack) - - frame_list = bt_has(prog, "rwsem_down_read_slowpath") + functions = [ + "__rwsem_down_write_failed_common", + "__rwsem_down_read_failed_common", + "rwsem_down_write_slowpath", + "rwsem_down_read_slowpath", + ] + frame_list = bt_has_any(prog, functions) if frame_list: show_rwsem_lock(prog, frame_list, seen_rwsems, stack)