mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-08 16:23:24 -04:00
DEV: dev/gdb: add simple task dump
New functions task_dump_wq and task_dump_rq can be used to dump tasks in a wait queue or in a run queue respectively. For the wait queue (the most common usage), one needs to pass either the thread-local's timers, or the thread group ones for shared tasks: task_dump_wq &ha_tgroup_ctx[0].timers task_dump_wq &ha_thread_ctx[0].timers For the run queue, task_dump_rq will take the thread's rqueue: task_dump_rq &ha_thread_ctx[0].rqueue The output is the task pointer and a dump of the task* struct per line, then a total count at the end.
This commit is contained in:
parent
837d69f8ef
commit
c82ac139f4
1 changed files with 31 additions and 0 deletions
31
dev/gdb/task.gdb
Normal file
31
dev/gdb/task.gdb
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# lists all tasks in the wait queue whose ebroot pointed to by $arg0
|
||||
# e.g.
|
||||
# task_dump_wq &ha_tgroup_ctx[0].timers
|
||||
# task_dump_wq &ha_thread_ctx[0].timers
|
||||
#
|
||||
define task_dump_rq
|
||||
set $tot=0
|
||||
ebtree_first ($arg0)
|
||||
while ($node != 0)
|
||||
set $tot = $tot+1
|
||||
set $p = (struct task *)((void*)$node-(long)&((struct task*)0).rq)
|
||||
printf "task %p ",$p
|
||||
p -pretty off -- /a *$p
|
||||
ebtree_next $node
|
||||
end
|
||||
printf "Total: %d tasks.\n",$tot
|
||||
end
|
||||
|
||||
define task_dump_wq
|
||||
set $tot=0
|
||||
ebtree_first ($arg0)
|
||||
while ($node != 0)
|
||||
set $tot = $tot+1
|
||||
set $p = (struct task *)((void*)$node-(long)&((struct task*)0).wq)
|
||||
printf "task %p ",$p
|
||||
p -pretty off -- /a *$p
|
||||
ebtree_next $node
|
||||
end
|
||||
printf "Total: %d tasks.\n",$tot
|
||||
end
|
||||
|
||||
Loading…
Reference in a new issue