Skip to content

Instantly share code, notes, and snippets.

@osandov
Created June 8, 2024 14:26
Show Gist options
  • Save osandov/9fa85a64b0da722c265071bf0e61fa86 to your computer and use it in GitHub Desktop.
Save osandov/9fa85a64b0da722c265071bf0e61fa86 to your computer and use it in GitHub Desktop.
Idle thread PID
$ drgn
...
>>> for cpu in for_each_present_cpu():
... task = per_cpu(prog["runqueues"], cpu).idle
... print(task.comm, task.pid)
...
(char [16])"swapper/0" (pid_t)0
(char [16])"swapper/1" (pid_t)0
(char [16])"swapper/2" (pid_t)0
(char [16])"swapper/3" (pid_t)0
(char [16])"swapper/4" (pid_t)0
(char [16])"swapper/5" (pid_t)0
(char [16])"swapper/6" (pid_t)0
(char [16])"swapper/7" (pid_t)0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment