HP-UX Linker and Libraries Release Notes (March, 2010)

New Option to Print n Levels of Procedure Calls
A new option -level n is provided to print n levels of procedure calls. Without this option,
pstack normally prints the complete procedure stack. With this option, pstack can be restricted
to print only n levels of procedure calls in the procedure stack.
The following example shows the result of running pstack for a process id 3975.
Example 1 Calling pstack with a process id
-------------------------------- lwpid : 4549 -------------------------------
0: 60000000c0454230 : _read_sys() + 0x30 (/usr/lib/hpux32/libc.so.1)
1: 60000000c0469840 : _read() + 0x80 (/usr/lib/hpux32/libc.so.1)
2: 60000000c04304a0 : __filbuf() + 0x1a0 (/usr/lib/hpux32/libc.so.1)
3: 00000000040009e0 : (unknown) () (unknown)
4: 60000000c0048c90 : main_opd_entry() + 0x50 (/usr/lib/hpux32/dld.so)
The following example shows the usage id -level option is used to print 3 levels of procedures
stack for a process id 3975.
Example 2 Calling pstack with -level option
-------------------------------- lwpid : 4549 -------------------------------
0: 60000000c0454230 : _read_sys() + 0x30 (/usr/lib/hpux32/libc.so.1)
1: 60000000c0469840 : _read() + 0x80 (/usr/lib/hpux32/libc.so.1)
2: 60000000c04304a0 : __filbuf() + 0x1a0 (/usr/lib/hpux32/libc.so.1)
New Argument to Trace the Calling Process
A special argument -1 enables you to trace the calling process without entering the PID of the
process. Hence, you can skip the process of finding the PID by using this argument on a calling
process.
The example below shows the usage of special argument -1 that can be used to run pstack on
the calling process. In this case, the calling process is the shell itself.
8