Opened 13 years ago

Closed 10 years ago

#280 closed enhancement (fixed)

Taskdump should print fibril stacks

Reported by: Jiri Svoboda Owned by: Jiri Svoboda
Priority: major Milestone: 0.6.0
Component: helenos/app/taskdump Version:
Keywords: Cc:
Blocker for: Depends on:
See also:


Printing a stack trace is a good way to observe what a sleeping task is currently doing. This great for investigating hangs, for example.

As of changeset:mainline,781 taskdump can (on some architectures at least) print the userspace stack of a thread which is currently executing a system call. Most tasks typically sleep waiting for IPC inside sys_ipc_wait_for_call() or similar.

This is still not very good because we will just see the stack trace of the manager fibril, yielding little useful information. What we need is to print stack traces of all fibrils, be they running, ready or sleeping.

Change History (7)

comment:1 by Jiri Svoboda, 13 years ago

It would seem the simplest way is to obtain addresses of the ready_list, serialized_list and manager_list (in fibril.c) from the symbol table.

Note that fibril.c does not keep any list of 'sleeping' fibrils (fibrils which are neither in ready_list, serialized_list nor manager_list). We should introduce such list otherwise we would miss the most interesting fibrils.

comment:2 by Jakub Jermář, 13 years ago


comment:3 by Jakub Jermář, 13 years ago

Component: unspecifiedapp/taskdump

comment:4 by Jakub Jermář, 12 years ago


comment:5 by Jakub Jermář, 10 years ago


comment:6 by Jiri Svoboda, 10 years ago

Owner: set to Jiri Svoboda
Status: newaccepted

comment:7 by Jiri Svoboda, 10 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in mainline,2135. I added a list of all fibrils. taskdump looks it up in symbol table by name and walks it. It prints stack traces for all the fibrils. I generalized libc's stacktrace_print_fp_pc() to stacktrace_print_generic() which can be passed an ops structure with method for reading memory. In the end I did not use it, because it does not support translating addresses to symbol names yet, instead used the slightly modified version, td_stacktrace().

Note: See TracTickets for help on using tickets.