truss - trace system calls by app in AIX 6

recently a bug is assigned to me for kernel cpu being high for my application. to know the system calls called by your application use truss tool which is similar to strace in Linux.

attach truss to running process . use -p to specify the process id and use -c to get seconds,number of calls,errors in system calls used by app.

$truss -c -p pid

do your operations and shutdown the app. see the output on console. you can specify -o in truss command if you want to save output to file. 

I solved one bug using truss , the call to fstatx is being called very heavily, I used a static variable which gets filezie and stores in variable, whenever the file is updated,I updated the filesize variable using fstatx and  used the filesize variable to know the size of file instead of calling fstatx in each iteration.