This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Met Problem on Enable SystemTap on Android


On Wed, Sep 14, 2011 at 04:20:05PM -0400, Yao,Yanjun wrote:
> One last question, in my implementation, we want to know what system
> calls each program made. However, in SystemTap tutorial or examples,
> people already know what to probe, then they go to probe that file.
> 
> What's in my mind is like:
> probe syscall.* {
>    //print out the * part of the target "syscall.*"
> }
> 
> May I ask how can I do that?

See the top of tapset/syscall.stp:

/* Each syscall returns the calls parameters. In addition, the following
* variables are set:
*
* name - generally the syscall name minus the "sys_".
*
* argstr - a string containing the decoded args in an easy-to-read format.
*          It doesn't need to contain everything, but should have all the
*          important args. Set in entry probes only. Values enclosed in
*          square brackets are user-space pointers. Values in curly
*          braces are decoded structs.
*
* retstr - a string containing the return value in an easy-to-read format.
*          Set in return probes only.
*/

So, what you probably want is something like:

stap -e 'probe syscall.* { printf("%s (%d): %s\n", execname(), pid(), name) }'

Which will print out the executable name, its process id and the syscall
name for each syscall probe hit.

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]