Section 7.7. Threads trace Tool

7.7. Threads trace Tool

A tool to trace thread execution using the New POSIX Threads Library (NPTL) with as few intrusions as possible is available through an open-source project called NPTL trace tool.[11] The tool, designed to help developers of multithreaded applications, can generate a trace that describes the behavior of threads and provide help needed to understand complex situations such as race conditions, deadlocks, and lock contentions.


The trace tool starts when the application to be traced starts executing and stops as soon as the application stops. The trace produced can be viewed in text or graphical format. As of this writing, the tool is available only as a beta version (0.8.1). It currently traces 15 of the most common POSIX thread routines and four objects.[12] Platforms currently supported by the trace tool are the IA32, IA64, and PowerPC architecture.

[12] Condition variables, mutexes, barriers, and threads

The tool requires the user to download the glibc source and apply several patches to the NPTL library. These patches are included in the NPTL TRace tool distribution and add the necessary trace hooks needed to trace thread execution. Although the tool is in its early stages of development,[13] it shows how the open-source community contributes to the advancement of Linux.

[13] Use with extreme care at this point.

UNIX to Linux Porting. A Comprehensive Reference
UNIX to Linux Porting: A Comprehensive Reference
ISBN: 0131871099
EAN: 2147483647
Year: 2004
Pages: 175 © 2008-2017.
If you may any questions please contact us: