7.5. Debugging with the truss command

The truss command traces library and system calls and signal activity for a process.[3] It allows you to see all the system calls being made by a process, the parameters passed by those calls, and any data or errors returned from those calls. You can watch what your application is requesting from AIX and the results of those requests on live.

[3] The truss command has been supported on AIX, starting from Version 5.1. Several enhancements have been made in AIX 5L Version 5.2.

To demonstrate how it works, we present an application, which is composed of the four source files shown in Example 7-4.

Example 7-4. Source codes of prog_to_truss
 /* main.c */ int main(int argc, char *argv[]) { func9_1(1); func9_3(2); ...

Get Developing and Porting C and C++ Applications on AIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.