Please note that User Registration has been temporarily disabled due to a recent increase in automated registrations. If anyone needs an account, please request one here: RequestAccount. Thanks for your patience!--Wmat (talk)
Please email User:Wmat if you experience any issues with the Request Account form.

Difference between revisions of "Support dumping user-space stack from kernel"

From eLinux.org
Jump to: navigation, search
(add page)
 
Line 7: Line 7:
 
dump_backtrace()) is limited to showing the the dump of kernel stack only.
 
dump_backtrace()) is limited to showing the the dump of kernel stack only.
  
In some situations it would be useful to get the call stack of user
+
In some situations it would be useful to get the call stack of the user
 
level process also, instead of just the kernel's call stack.
 
level process also, instead of just the kernel's call stack.
With this feature, we could determine what user-space activity
+
This feature could be used to determine what user-space activity
 
was responsible for what kernel actions.
 
was responsible for what kernel actions.
  
Line 21: Line 21:
 
Other existing systems, such as strace, ltrace and ftrace, show parts of
 
Other existing systems, such as strace, ltrace and ftrace, show parts of
 
the full sequence of execution, but not all of them.
 
the full sequence of execution, but not all of them.
It would be nice to create an easy tool similar to strace,
+
It would be nice to create an easy tool similar to strace, which showed
which can focus on the     call stack related to the initiator caller. NOT print all. All
+
the functions through all levels of the system.
      user space call stack, kernel call stack, irq, softirq, tasklet
+
      occurs during these calls are recorded.
+
  
As an example, when running a program called 'prog1', it would be nice to collect:
+
As an example, when running a program called 'prog1', it would be nice to collect and display:
 
* all function/library all from prog1 in user-space,including the arguments for each call and the return values
 
* all function/library all from prog1 in user-space,including the arguments for each call and the return values
 
* all system calls made by prog1, including arguments and return values
 
* all system calls made by prog1, including arguments and return values

Revision as of 20:31, 1 October 2013

Summary
Support dumping user-space stack from kernel
Proposer
Tim Bird, Sony Mobile

Description

Currently, a function like dump_stack() (which internally calls dump_backtrace()) is limited to showing the the dump of kernel stack only.

In some situations it would be useful to get the call stack of the user level process also, instead of just the kernel's call stack. This feature could be used to determine what user-space activity was responsible for what kernel actions.

It will be nice if this feature could be enabled with a kernel config option.

In conjunction with this, it would be nice to support a system-wide tracing function, which could trace both user-space and kernel space. This would include a simple method in userspace to show the both user-space and kernel-space functions, with arguments and return values.

Other existing systems, such as strace, ltrace and ftrace, show parts of the full sequence of execution, but not all of them. It would be nice to create an easy tool similar to strace, which showed the functions through all levels of the system.

As an example, when running a program called 'prog1', it would be nice to collect and display:

  • all function/library all from prog1 in user-space,including the arguments for each call and the return values
  • all system calls made by prog1, including arguments and return values
  • all the function calls in kernel-space launched resulting from prog1 (all processes / threads) including what happens during system call, irq, softirq, and tasklets)

Related work

  • LTTng - has a user-space tracer (not the same as monitoring return values)

Scope

Unknown

Contractor Candidates

None yet.

Comments