Skip to content

Commit 41c14a2

Browse files
sara hartseshartse
authored andcommitted
Stacks should be a pretty printer and a locator
1 parent 8d23f80 commit 41c14a2

File tree

7 files changed

+342
-192
lines changed

7 files changed

+342
-192
lines changed

sdb/commands/stacks.py

Lines changed: 218 additions & 192 deletions
Large diffs are not rendered by default.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
TASK_STRUCT STATE COUNT
2+
==========================================
3+
0xffffa089669edc00 INTERRUPTIBLE 1
4+
__schedule+0x2c0
5+
schedule+0x2c
6+
schedule_hrtimeout_range_clock+0x181
7+
schedule_hrtimeout_range+0x13
8+
ep_poll+0x258
9+
do_epoll_wait+0xb0
10+
__x64_sys_epoll_wait+0x1e
11+
do_syscall_64+0x5a
12+
entry_SYSCALL_64+0x7c
13+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sdb: stacks: module 'bogus' doesn't exist or isn't currently loaded
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
TASK_STRUCT STATE COUNT
2+
==========================================
3+
0xffffa0895684c500 INTERRUPTIBLE 13
4+
__schedule+0x2c0
5+
schedule+0x2c
6+
cv_wait_common+0x11f
7+
__cv_wait_sig+0x15
8+
zthr_procedure+0x51
9+
thread_generic_wrapper+0x74
10+
kthread+0x121
11+
ret_from_fork+0x1f
12+
13+
0xffffa08956849700 INTERRUPTIBLE 1
14+
__schedule+0x2c0
15+
schedule+0x2c
16+
schedule_hrtimeout_range_clock+0xb9
17+
schedule_hrtimeout_range+0x13
18+
__cv_timedwait_hires+0x11b
19+
cv_timedwait_hires_common+0x4b
20+
cv_timedwait_sig_hires+0x14
21+
zthr_procedure+0xa4
22+
thread_generic_wrapper+0x74
23+
kthread+0x121
24+
ret_from_fork+0x1f
25+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(unsigned long long)26
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
TASK_STRUCT STATE COUNT
2+
==========================================
3+
0xffffa08960a38000 INTERRUPTIBLE 57
4+
__schedule+0x2c0
5+
schedule+0x2c
6+
futex_wait_queue_me+0xc4
7+
futex_wait+0x10a
8+
do_futex+0x364
9+
__x64_sys_futex+0x13f
10+
do_syscall_64+0x5a
11+
entry_SYSCALL_64+0x7c
12+
13+
0xffffa08960a24500 INTERRUPTIBLE 12
14+
__schedule+0x2c0
15+
schedule+0x2c
16+
schedule_hrtimeout_range_clock+0xb9
17+
schedule_hrtimeout_range+0x13
18+
ep_poll+0x258
19+
do_epoll_wait+0xb0
20+
__x64_sys_epoll_wait+0x1e
21+
do_syscall_64+0x5a
22+
entry_SYSCALL_64+0x7c
23+
24+
0xffffa088f740dc00 INTERRUPTIBLE 6
25+
__schedule+0x2c0
26+
schedule+0x2c
27+
pipe_wait+0x70
28+
pipe_read+0x21f
29+
new_sync_read+0x109
30+
__vfs_read+0x29
31+
vfs_read+0x8e
32+
ksys_read+0x5c
33+
__x64_sys_read+0x1a
34+
do_syscall_64+0x5a
35+
entry_SYSCALL_64+0x7c
36+
37+
0xffffa088f740ae00 INTERRUPTIBLE 3
38+
__schedule+0x2c0
39+
schedule+0x2c
40+
do_wait+0x1cb
41+
kernel_wait4+0x89
42+
__do_sys_wait4+0x95
43+
__x64_sys_wait4+0x1e
44+
do_syscall_64+0x5a
45+
entry_SYSCALL_64+0x7c
46+
47+
0xffffa088ef2d1700 INTERRUPTIBLE 2
48+
__schedule+0x2c0
49+
schedule+0x2c
50+
schedule_timeout+0x1db
51+
inet_csk_accept+0x246
52+
inet_accept+0x45
53+
__sys_accept4+0x104
54+
__x64_sys_accept+0x1c
55+
do_syscall_64+0x5a
56+
entry_SYSCALL_64+0x7c
57+
58+
0xffffa0889cd4dc00 INTERRUPTIBLE 2
59+
__schedule+0x2c0
60+
schedule+0x2c
61+
schedule_hrtimeout_range_clock+0x181
62+
schedule_hrtimeout_range+0x13
63+
ep_poll+0x258
64+
do_epoll_wait+0xb0
65+
__x64_sys_epoll_wait+0x1e
66+
do_syscall_64+0x5a
67+
entry_SYSCALL_64+0x7c
68+
69+
0xffffa088f0979700 INTERRUPTIBLE 1
70+
__schedule+0x2c0
71+
schedule+0x2c
72+
schedule_hrtimeout_range_clock+0x181
73+
schedule_hrtimeout_range+0x13
74+
poll_schedule_timeout.constprop.11+0x46
75+
do_sys_poll+0x3d6
76+
__x64_sys_poll+0x3b
77+
do_syscall_64+0x5a
78+
entry_SYSCALL_64+0x7c
79+

tests/integration/test_linux_generic.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@
8282
"stacks -m zfs",
8383
"stacks -c spa_sync",
8484
"stacks -m zfs -c spa_sync",
85+
"stacks -m zfs -c zthr_procedure",
86+
'threads | filter obj.comm == "java" | stack',
87+
"stacks -m zfs | count",
88+
"echo 0xffffa089669edc00 | stack",
8589

8690
# threads
8791
"threads",
@@ -139,6 +143,7 @@
139143
"stacks -m bogus",
140144
"stacks -c bogus",
141145
"stacks -t bogus",
146+
"stacks -m bogus | count",
142147
]
143148

144149
CMD_TABLE = POS_CMDS + STRIPPED_POS_CMDS + NEG_CMDS

0 commit comments

Comments
 (0)