Fork us on GitHub Follow us on Facebook Follow us on Twitter

Opened 8 years ago

Closed 5 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:

Description

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 Changed 8 years ago by Jiri Svoboda

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 Changed 8 years ago by Jakub Jermář

Milestone: 0.4.30.5.0

comment:3 Changed 8 years ago by Jakub Jermář

Component: unspecifiedapp/taskdump

comment:4 Changed 7 years ago by Jakub Jermář

Milestone: 0.5.00.5.1

comment:5 Changed 5 years ago by Jakub Jermář

Milestone: 0.5.10.5.2

comment:6 Changed 5 years ago by Jiri Svoboda

Milestone: 0.6.10.6.0
Owner: set to Jiri Svoboda
Status: newaccepted

comment:7 Changed 5 years ago by Jiri Svoboda

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.