Search code examples
solaris-10dbxpstack

Displaying all stack history of a process


How can i display all function calls of a process on Solaris?

dbx and pstack prints the call stack. What I want is a list of all the functions called by the process. In other words the output of several pstacks of the process.


Solution

  • You can see all the function calls a process makes, as it makes them, using truss with the -u option.

    truss -u a.out -u : yourprogram args ...
    

    will show all the calls made to functions in your program and to functions in libraries such as libc.

    truss -u a.out -u :: yourprogram args ...
    

    will also trace calls from library functions to other library functions. It'll be a lot more output; a call to printf will result in dozens of other calls to C library functions.