Skip to content

Commit ad09667

Browse files
committed
pstack: drop task_on_cpu() helper
This was introduced in drgn 0.0.33. For UEK it's doing nothing more than "cpu_curr(prog, task_cpu(task)) == task". So open-code it instead. This fixes errors like: ImportError: cannot import name 'task_on_cpu' from 'drgn.helpers.linux' (/usr/lib64/python3.9/site-packages/drgn/helpers/linux/__init__.py) Signed-off-by: Stephen Brennan <[email protected]>
1 parent f67aa34 commit ad09667

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drgn_tools/pstack.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
from drgn.helpers.linux import for_each_online_cpu
5858
from drgn.helpers.linux import for_each_task
5959
from drgn.helpers.linux import for_each_vma
60-
from drgn.helpers.linux import task_on_cpu
6160
from drgn.helpers.linux import task_state_to_char
6261
from drgn.helpers.linux import vma_find
6362

@@ -767,7 +766,7 @@ def pstack_print_process(task: Object) -> None:
767766
tcomm = thread.comm.string_().decode("utf-8", errors="replace")
768767
st = task_state_to_char(thread)
769768
cpu = task_cpu(thread)
770-
on_cpu = task_on_cpu(thread)
769+
on_cpu = cpu_curr(prog, cpu) == thread
771770
cpunote = "RUNNING ON " if on_cpu else ""
772771
print(f" Thread {i} TID={tid} [{st}] {cpunote}CPU={cpu} ('{tcomm}')")
773772
try:

0 commit comments

Comments
 (0)