HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 61 (of 101)
Chapter 11 Software Development
October 29, 2013
The open() system call shows that the process opened the file "/tmp/xyz" for reading and
writing. The third argument is undocumented in the manpage. This is such a difference between
the system call and the libc function. The return value 3 is a reference number to be used for
subsequent system calls to access this file. This number is called the file descriptor. write()
used this file descriptor and sent 13 bytes to the file. Note that tusc prints two digits for each
byte of an input or output buffer to provide monospaced output for printable characters
(character + blank) and special characters (symbol or hexadecimal value). The return code 13
confirms that 13 bytes have been written.
An interesting option here might be -s <namelist> to make tusc filter the system calls and
display only those specified in the comma separated name list:
$ tusc s open,write,read,close program|PID
This tusc invocation will only print the listed system calls. This combination might be useful to
see the file access of a process. Alternatively, system calls can be excluded from the trace. This
can ease the trace analysis if a process does certain system calls over and over again, but which
might not be of interest:
$ tusc s ! sigprocmask program|PID
kmeminfo
kmeminfo can provide information about the memory usage of either the complete system or a
running process. The latter can be very helpful when analysing memory related problems,
because it shows the usage of the process address space. Here is a typical output for the process
memory:
$ kmeminfo -pid 3523
:
Process's memory regions (in pages):
Process "java", pid 3523, 32bit, R_EXEC_MAGIC:
type space vaddr ref virt phys swap
TEXT 0xd22f400.0x0000000000001000 1 5 4 1
DATA 0xd22f400.0x0000000000006000 1 2042 2041 2048
MMAP 0xd22f400.0x00000000679ff000 1 513 257 515
MMAP 0xd22f400.0x0000000067c00000 1 24576 1281 1344
MMAP 0xd22f400.0x000000006dc00000 1 8192 86 107
MMAP 0xd22f400.0x000000006fcbd000 1 33 18 34
MMAP 0xd22f400.0x000000006fcde000 1 33 18 34
: