Skip to content

Commit

Permalink
lock: Use bt_has_any in place of bt_has in rwsem scanner.
Browse files Browse the repository at this point in the history
Signed-off-by: Imran Khan <[email protected]>
  • Loading branch information
imran-kn committed Mar 14, 2024
1 parent fe76101 commit 3fd9252
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions drgn_tools/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 3fd9252

Please sign in to comment.