Name

strace

Synopsis

strace [options] command [arguments]

Description

Trace the system calls and signals for command and arguments. strace shows you how data is passed between the program and the system kernel. With no options, strace prints a line to stderr for each system call. It shows the call name, arguments given, the return value, and any error messages generated. A signal is printed with both its signal symbol and a descriptive string.

Options

-a n

Align the return values in column n.

-c

Count all calls and signals and create a summary report when the program has ended.

-d

Debug mode. Print debugging information for strace on stderr.

-e keyword[=[!]values

Pass an expression to strace to limit the types of calls or signals that are traced or change how they are displayed. The values for these expressions can be given as a comma-separated list. Preceding the list with an exclamation mark (!) negates the list. The special values of all and none are valid, as are the values listed with the following keywords.

abbrev= names

Abbreviate output from large structures for system calls listed in names.

read= descriptors

Print all data read from the given file descriptors.

signal= symbols

Trace the listed signal symbols (for example, signal=SIGIO,SIGHUP).

trace= values

Trace the listed values. values may be a list of system call names or one of the following sets of system calls:

file Calls that take a filename as an argument
ipc Interprocess communication
network Network-related
process ...

Get Linux in a Nutshell, Third Edition 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.