DevOps

strace – diagnostic, debugging and instructional userspace utility

strace is a diagnostic, debugging and instructional userspace utility for Linux.

It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state.

System administrators, diagnosticians and trouble-shooters will find it invaluable for solving problems with programs for which the source is not readily available since they do not need to be recompiled in order to trace them.

Key Features

  • Specifying a filter of syscall names that should be traced (via the -e trace= option): by name, like clone,fork,vfork; using one of the predefined groups, like %ipc or %file; or using regular expression syntax, like -e trace=/clock_.*.
  • Specifying a list of paths to be traced (-P /etc/ld.so.cache, for example).
  • Specifying a list of file descriptors whose I/O should be dumped (-e read= and -e write= options).
  • Counting syscall execution time and count (-T, -c, -C, and -w options).
  • Printing relative or absolute time stamps (-t and -r options).
  • Modifying return and error code of the specified syscalls, and inject signals upon their execution (since strace 4.15, -e inject= option).
  • Extracting information about file descriptors (including sockets, -y option).
  • Printing stack traces, including (since strace 4.21) symbol demangling (-k option).
  • Filtering by syscall return status (-e status= option; since strace 5.2).

Website: strace.io
Support: GitHub Code Repository, GitLab Code Repository
Developer: Dmitry Levin
License: GNU Lesser General Public License v2.1

strace is written in C. Learn C with our recommended free books and free tutorials.


Related Software

Debuggers
LLDBNext generation, high-performance debugger
GhidraSoftware reverse engineering framework
DelveSource level debugger for the Go programming language
GDBThe GNU Debugger
ValgrindA memory debugger and profiler
Radare2Portable reversing framework
BugStalkerRust debugger
XdebugExtension for PHP to aid debugging and development
SeerGUI frontend to GDB
iaitoGraphical interface for radare2
React Native DebuggerStandalone app for debugging React Native apps
KDbgGraphical user interface to GDB
straceDiagnostic, debugging and instructional userspace utility
rrRecord-and-replay debugger
drgnProgrammable debugger that puts scripting at the centre
cgdbLightweight console frontend to the GNU debugger
PuDBConsole-based visual debugger for Python
nndPartially inspired by RemedyBG
bashdbSource-code debugger for bash; follows the GDB command syntax
SysprofProfile an application or entire system
crashLinux kernel crash analysis utility
NemiverStandalone graphical debugger for GNOME

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments