{
    "content": [
        {
            "type": "text",
            "text": "# strace (man)\n\n## NAME\n\nstrace - trace system calls and signals\n\n## SYNOPSIS\n\nstrace [-ACdffhikqqrtttTvVwxxyyzZ] [-I n] [-b execve] [-e expr]... [-O overhead] [-S sortby]\n[-U columns] [-a column] [-o file] [-s strsize] [-X format] [-P path]... [-p pid]...\n[--seccomp-bpf] { -p pid | [-DDD] [-E var[=val]]... [-u username] command [args] }\nstrace -c [-dfwzZ] [-I n] [-b execve] [-e expr]... [-O overhead] [-S sortby] [-U columns]\n[-P path]... [-p pid]... [--seccomp-bpf] { -p pid | [-DDD] [-E var[=val]]...\n[-u username] command [args] }\n\n## DESCRIPTION\n\nIn  the  simplest  case  strace runs the specified command until it exits.  It intercepts and\nrecords the system calls which are called by a process and the signals which are received  by\na  process.   The name of each system call, its arguments and its return value are printed on\nstandard error or to the file specified with the -o option.\n\n## TLDR\n\n> Troubleshooting tool for tracing system calls.\n\n- Start tracing a specific process by its PID:\n  `sudo strace {{-p|--attach}} {{pid}}`\n- Trace a process and filter output by system call [e]xpression:\n  `sudo strace {{-p|--attach}} {{pid}} -e {{system_call,system_call2,...}}`\n- Count time, calls, and errors for each system call and report a summary on program exit:\n  `sudo strace {{-p|--attach}} {{pid}} {{-c|--summary-only}}`\n- Show the time spent in every system call and specify the maximum string size to print:\n  `sudo strace {{-p|--attach}} {{pid}} {{-T|--syscall-times}} {{-s|--string-limit}} {{32}}`\n- Start tracing a program by executing it:\n  `strace {{program}}`\n- Start tracing file operations of a program:\n  `strace -e trace=file {{program}}`\n- Start tracing network operations of a program as well as all its forked and child processes, saving the output to a file:\n  `strace {{-f|--follow-forks}} -e trace=network {{-o|--output}} {{trace.txt}} {{program}}`\n\n*Source: tldr-pages*\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (90 subsections)\n- **DIAGNOSTICS**\n- **SETUID INSTALLATION**\n- **MULTIPLE PERSONALITIES SUPPORT**\n- **NOTES**\n- **BUGS**\n- **HISTORY**\n- **REPORTING BUGS**\n- **SEE ALSO**\n- **AUTHORS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "strace",
        "section": "",
        "mode": "man",
        "summary": "strace - trace system calls and signals",
        "synopsis": "strace [-ACdffhikqqrtttTvVwxxyyzZ] [-I n] [-b execve] [-e expr]... [-O overhead] [-S sortby]\n[-U columns] [-a column] [-o file] [-s strsize] [-X format] [-P path]... [-p pid]...\n[--seccomp-bpf] { -p pid | [-DDD] [-E var[=val]]... [-u username] command [args] }\nstrace -c [-dfwzZ] [-I n] [-b execve] [-e expr]... [-O overhead] [-S sortby] [-U columns]\n[-P path]... [-p pid]... [--seccomp-bpf] { -p pid | [-DDD] [-E var[=val]]...\n[-u username] command [args] }",
        "tldr_summary": "Troubleshooting tool for tracing system calls.",
        "tldr_examples": [
            {
                "description": "Start tracing a specific process by its PID",
                "command": "sudo strace {{-p|--attach}} {{pid}}"
            },
            {
                "description": "Trace a process and filter output by system call [e]xpression",
                "command": "sudo strace {{-p|--attach}} {{pid}} -e {{system_call,system_call2,...}}"
            },
            {
                "description": "Count time, calls, and errors for each system call and report a summary on program exit",
                "command": "sudo strace {{-p|--attach}} {{pid}} {{-c|--summary-only}}"
            },
            {
                "description": "Show the time spent in every system call and specify the maximum string size to print",
                "command": "sudo strace {{-p|--attach}} {{pid}} {{-T|--syscall-times}} {{-s|--string-limit}} {{32}}"
            },
            {
                "description": "Start tracing a program by executing it",
                "command": "strace {{program}}"
            },
            {
                "description": "Start tracing file operations of a program",
                "command": "strace -e trace=file {{program}}"
            },
            {
                "description": "Start tracing network operations of a program as well as all its forked and child processes, saving the output to a file",
                "command": "strace {{-f|--follow-forks}} -e trace=network {{-o|--output}} {{trace.txt}} {{program}}"
            }
        ],
        "tldr_source": "official",
        "flags": [
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "them. The format of the expression is: [qualifier=][!]value[,value]... where qualifier is one of trace (or t), abbrev (or a), verbose (or v), raw (or x), signal (or signals or s), read (or reads or r), write (or writes or w), fault, inject, status, quiet (or silent or silence or q), decode-fds (or de‐‐ code-fd), decode-pids (or decode-pid), or kvm, and value is a qualifier-dependent symbol or number. The default qualifier is trace. Using an exclamation mark negates the set of values. For example, -e open means literally -e trace=open which in turn means trace only the open system call. By contrast, -e trace=!open means to trace every system call except open. In addition, the special values all and none have the obvious meanings. Note that some shells use the exclamation point for history expansion even inside quoted arguments. If so, you must escape the exclamation point with a backslash."
            },
            {
                "flag": "-E",
                "long": null,
                "arg": null,
                "description": "--env=var=val Run command with var=val in its list of environment variables."
            },
            {
                "flag": "-E",
                "long": null,
                "arg": null,
                "description": "--env=var Remove var from the inherited list of environment variables before passing it on to the command."
            },
            {
                "flag": "-p",
                "long": null,
                "arg": null,
                "description": "--attach=pid Attach to the process with the process ID pid and begin tracing. The trace may be terminated at any time by a keyboard interrupt signal (CTRL-C). strace will respond by detaching itself from the traced process(es) leaving it (them) to con‐ tinue running. Multiple -p options can be used to attach to many processes in addition to command (which is optional if at least one -p option is given). Mul‐ tiple process IDs, separated by either comma (“,”), space (“ ”), tab, or newline character, can be provided as an argument to a single -p option, so, for example, -p \"$(pidof PROG)\" and -p \"$(pgrep PROG)\" syntaxes are supported."
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": "--user=username Run command with the user ID, group ID, and supplementary groups of username. This option is only useful when running as root and enables the correct execution of setuid and/or setgid binaries. Unless this option is used setuid and setgid programs are executed without effective privileges."
            },
            {
                "flag": "-b",
                "long": null,
                "arg": null,
                "description": "--detach-on=syscall If specified syscall is reached, detach from traced process. Currently, only ex‐‐ ecve(2) syscall is supported. This option is useful if you want to trace multi- threaded process and therefore require -f, but don't want to trace its (poten‐ tially very complex) children."
            },
            {
                "flag": "-D",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--daemonize",
                "arg": null,
                "description": "--daemonize=grandchild Run tracer process as a grandchild, not as the parent of the tracee. This re‐ duces the visible effect of strace by keeping the tracee a direct child of the calling process."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "--daemonize=pgroup --daemonize=pgrp Run tracer process as tracee's grandchild in a separate process group. In addi‐ tion to reduction of the visible effect of strace, it also avoids killing of strace with kill(2) issued to the whole process group."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "--daemonize=session Run tracer process as tracee's grandchild in a separate session (\"true daemonisa‐ tion\"). In addition to reduction of the visible effect of strace, it also avoids killing of strace upon session termination."
            },
            {
                "flag": "-f",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--follow-forks",
                "arg": null,
                "description": "Trace child processes as they are created by currently traced processes as a re‐ sult of the fork(2), vfork(2) and clone(2) system calls. Note that -p PID -f will attach all threads of process PID if it is multi-threaded, not only thread with threadid = PID."
            },
            {
                "flag": "",
                "long": "--output-separately",
                "arg": null,
                "description": "If the --output=filename option is in effect, each processes trace is written to filename.pid where pid is the numeric process id of each process."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--output-separately",
                "arg": null,
                "description": "Combine the effects of --follow-forks and --output-separately options. This is incompatible with -c, since no per-process counts are kept. One might want to consider using strace-log-merge(1) to obtain a combined strace log view."
            },
            {
                "flag": "-I",
                "long": null,
                "arg": null,
                "description": "--interruptible=interruptible When strace can be interrupted by signals (such as pressing CTRL-C). 1, anywhere no signals are blocked; 2, waiting fatal signals are blocked while decoding syscall (default); 3, never fatal signals are always blocked (default if -o FILE PROG); 4, nevertstp fatal signals and SIGTSTP (CTRL-Z) are always blocked (useful to make strace -o FILE PROG not stop on CTRL-Z, default if -D)."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--trace=syscallset Trace only the specified set of system calls. syscallset is defined as [!]value[,value], and value can be one of the following: syscall Trace specific syscall, specified by its name (but see NOTES). ?value Question mark before the syscall qualification allows suppression of error in case no syscalls matched the qualification provided. /regex Trace only those system calls that match the regex. You can use POSIX Extended Regular Expression syntax (see regex(7)). syscall@64 Trace syscall only for the 64-bit personality. syscall@32 Trace syscall only for the 32-bit personality. syscall@x32 Trace syscall only for the 32-on-64-bit personality. %file file Trace all system calls which take a file name as an argument. You can think of this as an abbreviation for -e trace=open,stat,chmod,unlink,... which is useful to seeing what files the process is referencing. Furthermore, using the abbrevia‐ tion will ensure that you don't accidentally forget to include a call like lstat(2) in the list. Betchya woulda forgot that one. The syntax without a preceding percent sign (\"-e trace=file\") is deprecated. %process process Trace system calls associated with process lifecycle (creation, exec, termination). The syntax without a preceding percent sign (\"-e trace=process\") is deprecated. %net %network network Trace all the network related system calls. The syntax without a preceding percent sign (\"-e trace=network\") is deprecated. %signal signal Trace all signal related system calls. The syntax without a preced‐ ing percent sign (\"-e trace=signal\") is deprecated. %ipc ipc Trace all IPC related system calls. The syntax without a preceding percent sign (\"-e trace=ipc\") is deprecated. %desc desc Trace all file descriptor related system calls. The syntax without a preceding percent sign (\"-e trace=desc\") is deprecated. %memory memory Trace all memory mapping related system calls. The syntax without a preceding percent sign (\"-e trace=memory\") is deprecated. %creds Trace system calls that read or modify user and group identifiers or capability sets. %stat Trace stat syscall variants. %lstat Trace lstat syscall variants. %fstat Trace fstat, fstatat, and statx syscall variants. %%stat Trace syscalls used for requesting file status (stat, lstat, fstat, fstatat, statx, and their variants). %statfs Trace statfs, statfs64, statvfs, osfstatfs, and osfstatfs64 system calls. The same effect can be achieved with -e trace=/^(.*)?statv?fs regular expression. %fstatfs Trace fstatfs, fstatfs64, fstatvfs, osffstatfs, and osffstatfs64 system calls. The same effect can be achieved with -e trace=/fs‐‐ tatv?fs regular expression. %%statfs Trace syscalls related to file system statistics (statfs-like, fs‐ tatfs-like, and ustat). The same effect can be achieved with -e trace=/statv?fs|fsstat|ustat regular expression. %clock Trace system calls that read or modify system clocks. %pure Trace syscalls that always succeed and have no arguments. Cur‐ rently, this list includes arcgettls(2), getdtablesize(2), gete‐‐ gid(2), getegid32(2), geteuid(2), geteuid32(2), getgid(2), get‐‐ gid32(2), getpagesize(2), getpgrp(2), getpid(2), getppid(2), getthreadarea(2) (on architectures other than x86), gettid(2), gettls(2), getuid(2), getuid32(2), getxgid(2), getxpid(2), getxuid(2), kernfeatures(2), and metaggettls(2) syscalls. The -c option is useful for determining which system calls might be useful to trace. For example, trace=open,close,read,write means to only trace those four system calls. Be careful when making inferences about the user/kernel boundary if only a subset of system calls are being monitored. The default is trace=all."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--signal=set Trace only the specified subset of signals. The default is signal=all. For ex‐ ample, signal=!SIGIO (or signal=!io) causes SIGIO signals not to be traced."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--status=set Print only system calls with the specified return status. The default is sta‐‐ tus=all. When using the status qualifier, because strace waits for system calls to return before deciding whether they should be printed or not, the traditional order of events may not be preserved anymore. If two system calls are executed by concurrent threads, strace will first print both the entry and exit of the first system call to exit, regardless of their respective entry time. The entry and exit of the second system call to exit will be printed afterwards. Here is an example when select(2) is called, but a different thread calls clockget‐‐ time(2) before select(2) finishes: [pid 28779] 1130322148.939977 clockgettime(CLOCKREALTIME, {1130322148, 939977000}) = 0 [pid 28772] 1130322148.438139 select(4, [3], NULL, NULL, NULL) = 1 (in [3]) set can include the following elements: successful Trace system calls that returned without an error code. The -z op‐ tion has the effect of status=successful. failed Trace system calls that returned with an error code. The -Z option has the effect of status=failed. unfinished Trace system calls that did not return. This might happen, for ex‐ ample, due to an execve call in a neighbour thread. unavailable Trace system calls that returned but strace failed to fetch the er‐ ror status. detached Trace system calls for which strace detached before the return."
            },
            {
                "flag": "-P",
                "long": null,
                "arg": null,
                "description": "--trace-path=path Trace only system calls accessing path. Multiple -P options can be used to spec‐ ify several paths."
            },
            {
                "flag": "-z",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--successful-only",
                "arg": null,
                "description": "Print only syscalls that returned without an error code."
            },
            {
                "flag": "-Z",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--failed-only",
                "arg": null,
                "description": "Print only syscalls that returned with an error code."
            },
            {
                "flag": "-a",
                "long": null,
                "arg": null,
                "description": "--columns=column Align return values in a specific column (default column 40)."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--abbrev=syscallset Abbreviate the output from printing each member of large structures. The syntax of the syscallset specification is the same as in the -e trace option. The de‐ fault is abbrev=all. The -v option has the effect of abbrev=none."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--verbose=syscallset Dereference structures for the specified set of system calls. The syntax of the syscallset specification is the same as in the -e trace option. The default is verbose=all."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--raw=syscallset Print raw, undecoded arguments for the specified set of system calls. The syntax of the syscallset specification is the same as in the -e trace option. This op‐ tion has the effect of causing all arguments to be printed in hexadecimal. This is mostly useful if you don't trust the decoding or you need to know the actual numeric value of an argument. See also -X raw option."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--read=set Perform a full hexadecimal and ASCII dump of all the data read from file descrip‐ tors listed in the specified set. For example, to see all input activity on file descriptors 3 and 5 use -e read=3,5. Note that this is independent from the nor‐ mal tracing of the read(2) system call which is controlled by the option -e trace=read."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--write=set Perform a full hexadecimal and ASCII dump of all the data written to file de‐ scriptors listed in the specified set. For example, to see all output activity on file descriptors 3 and 5 use -e write=3,5. Note that this is independent from the normal tracing of the write(2) system call which is controlled by the option -e trace=write."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--quiet=set --silent=set --silence=set Suppress various information messages. The default is quiet=none. set can in‐ clude the following elements: attach Suppress messages about attaching and detaching (\"[ Process NNNN attached ]\", \"[ Process NNNN detached ]\"). exit Suppress messages about process exits (\"+++ exited with SSS +++\"). path-resolution Suppress messages about resolution of paths provided via the -P option (\"Requested path \"...\" resolved into \"...\"\"). personality Suppress messages about process personality changes (\"[ Process PID=NNNN runs in PPP mode. ]\"). thread-execve superseded Suppress messages about process being superseded by execve(2) in another thread (\"+++ superseded by execve in pid NNNN +++\")."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--decode-fds=set Decode various information associated with file descriptors. The default is de‐‐ code-fds=none. set can include the following elements: path Print file paths. Also enables printing of tracee's current working di‐ rectory when ATFDCWD constant is used. socket Print socket protocol-specific information, dev Print character/block device numbers. pidfd Print PIDs associated with pidfd file descriptors."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--decode-pids=set Decode various information associated with process IDs (and also thread IDs, process group IDs, and session IDs). The default is decode-pids=none. set can include the following elements: comm Print command names associated with thread or process IDs. pidns Print thread, process, process group, and session IDs in strace's PID namespace if the tracee is in a different PID namespace."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--kvm=vcpu Print the exit reason of kvm vcpu. Requires Linux kernel version 4.16.0 or higher."
            },
            {
                "flag": "-i",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--instruction-pointer",
                "arg": null,
                "description": "Print the instruction pointer at the time of the system call."
            },
            {
                "flag": "-n",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--syscall-number",
                "arg": null,
                "description": "Print the syscall number."
            },
            {
                "flag": "-k",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--stack-traces",
                "arg": null,
                "description": "Print the execution stack trace of the traced processes after each system call."
            },
            {
                "flag": "-o",
                "long": null,
                "arg": null,
                "description": "--output=filename Write the trace output to the file filename rather than to stderr. filename.pid form is used if -ff option is supplied. If the argument begins with '|' or '!', the rest of the argument is treated as a command and all output is piped to it. This is convenient for piping the debugging output to a program without affecting the redirections of executed programs. The latter is not compatible with -ff op‐ tion currently."
            },
            {
                "flag": "-A",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--output-append-mode",
                "arg": null,
                "description": "Open the file provided in the -o option in append mode."
            },
            {
                "flag": "-q",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--quiet",
                "arg": null,
                "description": "--quiet=attach,personality Suppress messages about attaching, detaching, and personality changes. This hap‐ pens automatically when output is redirected to a file and the command is run di‐ rectly instead of attaching."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "--quiet=attach,personality,exit Suppress messages attaching, detaching, personality changes, and about process exit status."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "--quiet=all Suppress all suppressible messages (please refer to the -e quiet option descrip‐ tion for the full list of suppressible messages)."
            },
            {
                "flag": "-r",
                "long": null,
                "arg": null,
                "description": "--relative-timestamps[=precision] Print a relative timestamp upon entry to each system call. This records the time difference between the beginning of successive system calls. precision can be one of s (for seconds), ms (milliseconds), us (microseconds), or ns (nanosec‐ onds), and allows setting the precision of time value being printed. Default is"
            },
            {
                "flag": "-s",
                "long": null,
                "arg": null,
                "description": "--string-limit=strsize Specify the maximum string size to print (the default is 32). Note that file‐ names are not considered strings and are always printed in full. --absolute-timestamps[=[[format:]format],[[precision:]precision]] --timestamps[=[[format:]format],[[precision:]precision]] Prefix each line of the trace with the wall clock time in the specified format with the specified precision. format can be one of the following: none No time stamp is printed. Can be used to override the previous setting. time Wall clock time (strftime(3) format string is %T). unix Number of seconds since the epoch (strftime(3) format string is %s). precision can be one of s (for seconds), ms (milliseconds), us (microseconds), or"
            },
            {
                "flag": "-t",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--absolute-timestamps",
                "arg": null,
                "description": "Prefix each line of the trace with the wall clock time."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "--absolute-timestamps=precision:us If given twice, the time printed will include the microseconds."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "--absolute-timestamps=format:unix,precision:us If given thrice, the time printed will include the microseconds and the leading portion will be printed as the number of seconds since the epoch."
            },
            {
                "flag": "-T",
                "long": null,
                "arg": null,
                "description": "--syscall-times[=precision] Show the time spent in system calls. This records the time difference between the beginning and the end of each system call. precision can be one of s (for seconds), ms (milliseconds), us (microseconds), or ns (nanoseconds), and allows setting the precision of time value being printed. Default is us (microseconds)."
            },
            {
                "flag": "-v",
                "long": null,
                "arg": null,
                "description": "--no-abbrev Print unabbreviated versions of environment, stat, termios, etc. calls. These structures are very common in calls and so the default behavior displays a rea‐ sonable subset of structure members. Use this option to get all of the gory de‐ tails. --strings-in-hex[=option] Control usage of escape sequences with hexadecimal numbers in the printed strings. Normally (when no --strings-in-hex or -x option is supplied), escape sequences are used to print non-printable and non-ASCII characters (that is, characters with a character code less than 32 or greater than 127), or to disam‐ biguate the output (so, for quotes and other characters that encase the printed string, for example, angle brackets, in case of file descriptor path output); for the former use case, unless it is a white space character that has a symbolic es‐ cape sequence defined in the C standard (that is, “\\t” for a horizontal tab, “\\n” for a newline, “\\v” for a vertical tab, “\\f” for a form feed page break, and “\\r” for a carriage return) are printed using escape sequences with numbers that cor‐ respond to their byte values, with octal number format being the default. option can be one of the following: none Hexadecimal numbers are not used in the output at all. When there is a need to emit an escape sequence, octal numbers are used. non-ascii-chars Hexadecimal numbers are used instead of octal in the escape se‐ quences. non-ascii Strings that contain non-ASCII characters are printed using es‐ cape sequences with hexadecimal numbers. all All strings are printed using escape sequences with hexadecimal numbers. When the option is supplied without an argument, all is assumed."
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": "--strings-in-hex=non-ascii Print all non-ASCII strings in hexadecimal string format."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "--strings-in-hex[=all] Print all strings in hexadecimal string format."
            },
            {
                "flag": "-X",
                "long": null,
                "arg": null,
                "description": "--const-print-style=format Set the format for printing of named constants and flags. Supported format val‐ ues are: raw Raw number output, without decoding. abbrev Output a named constant or a set of flags instead of the raw number if they are found. This is the default strace behaviour. verbose Output both the raw value and the decoded string (as a comment)."
            },
            {
                "flag": "-y",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--decode-fds",
                "arg": null,
                "description": "--decode-fds=path Print paths associated with file descriptor arguments and with the ATFDCWD con‐ stant."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "--decode-fds=all Print all available information associated with file descriptors: protocol-spe‐ cific information associated with socket file descriptors, block/character device number associated with device file descriptors, and PIDs associated with pidfd file descriptors."
            },
            {
                "flag": "",
                "long": "--pidns-translation",
                "arg": null,
                "description": "--decode-pids=pidns If strace and tracee are in different PID namespaces, print PIDs in strace's namespace, too."
            },
            {
                "flag": "-Y",
                "long": null,
                "arg": null,
                "description": "--decode-pids=comm Print command names for PIDs."
            },
            {
                "flag": "-c",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--summary-only",
                "arg": null,
                "description": "Count time, calls, and errors for each system call and report a summary on pro‐ gram exit, suppressing the regular output. This attempts to show system time (CPU time spent running in the kernel) independent of wall clock time. If -c is used with -f, only aggregate totals for all traced processes are kept."
            },
            {
                "flag": "-C",
                "long": null,
                "arg": null,
                "description": "--summary Like -c but also print regular output while processes are running."
            },
            {
                "flag": "-O",
                "long": null,
                "arg": null,
                "description": "--summary-syscall-overhead=overhead Set the overhead for tracing system calls to overhead. This is useful for over‐ riding the default heuristic for guessing how much time is spent in mere measur‐ ing when timing system calls using the -c option. The accuracy of the heuristic can be gauged by timing a given program run without tracing (using time(1)) and comparing the accumulated system call time to the total produced using -c. The format of overhead specification is described in section Time specification format description."
            },
            {
                "flag": "-S",
                "long": null,
                "arg": null,
                "description": "--summary-sort-by=sortby Sort the output of the histogram printed by the -c option by the specified crite‐ rion. Legal values are time (or time-percent or time-total or total-time), min-time (or shortest or time-min), max-time (or longest or time-max), avg-time (or time-avg), calls (or count), errors (or error), name (or syscall or syscall-name), and nothing (or none); default is time."
            },
            {
                "flag": "-U",
                "long": null,
                "arg": null,
                "description": "--summary-columns=columns Configure a set (and order) of columns being shown in the call summary. The col‐ umns argument is a comma-separated list with items being one of the following: time-percent (or time) Percentage of cumulative time consumed by a specific system call. total-time (or time-total) Total system (or wall clock, if -w option is provided) time consumed by a specific system call. min-time (or shortest or time-min) Minimum observed call duration. max-time (or longest or time-max) Maximum observed call duration. avg-time (or time-avg) Average call duration. calls (or count) Call count. errors (or error) Error count. name (or syscall or syscall-name) Syscall name. The default value is time-percent,total-time,avg-time,calls,errors,name. If the name field is not supplied explicitly, it is added as the last column."
            },
            {
                "flag": "-w",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": "--summary-wall-clock",
                "arg": null,
                "description": "Summarise the time difference between the beginning and end of each system call. The default is to summarise the system time."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "ter=delay][:delayexit=delay][:pokeen‐‐ ter=@argN=DATAN,@argM=DATAM...][:pokeexit=@argN=DATAN,@argM=DATAM...][:when=expr] --inject=syscallset[:error=errno|:retval=value][:signal=sig][:syscall=syscall][:delayen‐‐ ter=delay][:de‐‐ layexit=delay][:pokeen‐‐ ter=@argN=DATAN,@argM=DATAM...][:pokeexit=@argN=DATAN,@argM=DATAM...][:when=expr] Perform syscall tampering for the specified set of syscalls. The syntax of the syscallset specification is the same as in the -e trace option. At least one of error, retval, signal, delayenter, delayexit, pokeenter, or pokeexit options has to be specified. error and retval are mutually exclusive. If :error=errno option is specified, a fault is injected into a syscall invoca‐ tion: the syscall number is replaced by -1 which corresponds to an invalid syscall (unless a syscall is specified with :syscall= option), and the error code is specified using a symbolic errno value like ENOSYS or a numeric value within 1..4095 range. If :retval=value option is specified, success injection is performed: the syscall number is replaced by -1, but a bogus success value is returned to the callee. If :signal=sig option is specified with either a symbolic value like SIGSEGV or a numeric value within 1..SIGRTMAX range, that signal is delivered on entering ev‐ ery syscall specified by the set. If :delayenter=delay or :delayexit=delay options are specified, delay injection is performed: the tracee is delayed by time period specified by delay on entering or exiting the syscall, respectively. The format of delay specification is de‐ scribed in section Time specification format description. If :pokeenter=@argN=DATAN,@argM=DATAM... or :pokeexit=@argN=DATAN,@argM=DATAM... options are specified, tracee's memory at locations, pointed to by system call arguments argN and argM (going from arg1 to arg7) is overwritten by data DATAN and DATAM (specified in hexadecimal format; for example :pokeenter=@arg1=0000DEAD0000BEEF). :pokeenter modifies memory on syscall enter, and :pokeexit - on exit. If :signal=sig option is specified without :error=errno, :retval=value or :de‐‐ lay{enter,exit}=usecs options, then only a signal sig is delivered without a syscall fault or delay injection. Conversely, :error=errno or :retval=value op‐ tion without :delayenter=delay, :delayexit=delay or :signal=sig options injects a fault without delivering a signal or injecting a delay, etc. If :signal=sig option is specified together with :error=errno or :retval=value, then both injection of a fault or success and signal delivery are performed. if :syscall=syscall option is specified, the corresponding syscall with no side effects is injected instead of -1. Currently, only \"pure\" (see -e trace=%pure description) syscalls can be specified there. Unless a :when=expr subexpression is specified, an injection is being made into every invocation of each syscall from the set. The format of the subexpression is: first[..last][+[step]] Number first stands for the first invocation number in the range, number last stands for the last invocation number in the range, and step stands for the step between two consecutive invocations. The following combinations are useful: first For every syscall from the set, perform an injection for the syscall invocation number first only. first..last For every syscall from the set, perform an injection for the syscall invocation number first and all subsequent invocations until the invocation number last (inclusive). first+ For every syscall from the set, perform injections for the syscall invocation number first and all subsequent invocations. first..last+ For every syscall from the set, perform injections for the syscall invocation number first and all subsequent invocations until the invocation number last (inclusive). first+step For every syscall from the set, perform injections for syscall invocations number first, first+step, first+step+step, and so on. first..last+step Same as the previous, but consider only syscall invocations with numbers up to last (inclusive). For example, to fail each third and subsequent chdir syscalls with ENOENT, use -e inject=chdir:error=ENOENT:when=3+. The valid range for numbers first and step is 1..65535, and for number last is 1..65534. An injection expression can contain only one error= or retval= specification, and only one signal= specification. If an injection expression contains multiple when= specifications, the last one takes precedence. Accounting of syscalls that are subject to injection is done per syscall and per tracee. Specification of syscall injection can be combined with other syscall filtering options, for example, -P /dev/urandom -e inject=file:error=ENOENT."
            },
            {
                "flag": "-e",
                "long": null,
                "arg": null,
                "description": "--fault=syscallset[:error=errno][:when=expr] Perform syscall fault injection for the specified set of syscalls. This is equivalent to more generic -e inject= expression with default value of errno option set to ENOSYS."
            },
            {
                "flag": "-d",
                "long": null,
                "arg": null,
                "description": "--debug Show some debugging output of strace itself on the standard error."
            },
            {
                "flag": "-F",
                "long": null,
                "arg": null,
                "description": "may be removed in future releases. Usage of multiple instances of -F option is still equivalent to a single -f, and it is ignored at all if used along with one or more instances of -f option."
            },
            {
                "flag": "-h",
                "long": null,
                "arg": null,
                "description": "--help Print the help summary."
            },
            {
                "flag": "",
                "long": "--seccomp-bpf",
                "arg": null,
                "description": "Try to enable use of seccomp-bpf (see seccomp(2)) to have ptrace(2)-stops only when system calls that are being traced occur in the traced processes. This op‐ tion has no effect unless -f/--follow-forks is also specified. --seccomp-bpf is also not applicable to processes attached using -p/--attach option. An attempt to enable system calls filtering using seccomp-bpf may fail for various reasons, e.g. there are too many system calls to filter, the seccomp API is not available, or strace itself is being traced. In cases when seccomp-bpf filter setup failed, strace proceeds as usual and stops traced processes on every system call."
            },
            {
                "flag": "-V",
                "long": null,
                "arg": null,
                "description": "--version Print the version number of strace."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "strace-log-merge",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/strace-log-merge/1/json"
            },
            {
                "name": "ltrace",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/ltrace/1/json"
            },
            {
                "name": "perf-trace",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/perf-trace/1/json"
            },
            {
                "name": "trace-cmd",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/trace-cmd/1/json"
            },
            {
                "name": "time",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/time/1/json"
            },
            {
                "name": "ptrace",
                "section": "2",
                "url": "https://www.chedong.com/phpMan.php/man/ptrace/2/json"
            },
            {
                "name": "proc",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/proc/5/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 108,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "General",
                        "lines": 1
                    },
                    {
                        "name": "-e",
                        "lines": 17,
                        "flag": "-e"
                    },
                    {
                        "name": "Startup",
                        "lines": 1
                    },
                    {
                        "name": "-E",
                        "lines": 3,
                        "flag": "-E"
                    },
                    {
                        "name": "-E",
                        "lines": 3,
                        "flag": "-E"
                    },
                    {
                        "name": "-p",
                        "lines": 10,
                        "flag": "-p"
                    },
                    {
                        "name": "-u",
                        "lines": 6,
                        "flag": "-u"
                    },
                    {
                        "name": "Tracing",
                        "lines": 1
                    },
                    {
                        "name": "-b",
                        "lines": 6,
                        "flag": "-b"
                    },
                    {
                        "name": "-D",
                        "lines": 1,
                        "flag": "-D"
                    },
                    {
                        "name": "--daemonize",
                        "lines": 5,
                        "long": "--daemonize"
                    },
                    {
                        "name": "-DD",
                        "lines": 6
                    },
                    {
                        "name": "-DDD",
                        "lines": 5
                    },
                    {
                        "name": "-f",
                        "lines": 1,
                        "flag": "-f"
                    },
                    {
                        "name": "--follow-forks",
                        "lines": 5,
                        "long": "--follow-forks"
                    },
                    {
                        "name": "--output-separately",
                        "lines": 3,
                        "long": "--output-separately"
                    },
                    {
                        "name": "-ff",
                        "lines": 1
                    },
                    {
                        "name": "--follow-forks --output-separately",
                        "lines": 6,
                        "long": "--output-separately"
                    },
                    {
                        "name": "-I",
                        "lines": 9,
                        "flag": "-I"
                    },
                    {
                        "name": "Filtering",
                        "lines": 1
                    },
                    {
                        "name": "-e",
                        "lines": 93,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 4,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 26,
                        "flag": "-e"
                    },
                    {
                        "name": "-P",
                        "lines": 4,
                        "flag": "-P"
                    },
                    {
                        "name": "-z",
                        "lines": 1,
                        "flag": "-z"
                    },
                    {
                        "name": "--successful-only",
                        "lines": 2,
                        "long": "--successful-only"
                    },
                    {
                        "name": "-Z",
                        "lines": 1,
                        "flag": "-Z"
                    },
                    {
                        "name": "--failed-only",
                        "lines": 2,
                        "long": "--failed-only"
                    },
                    {
                        "name": "Output format",
                        "lines": 1
                    },
                    {
                        "name": "-a",
                        "lines": 3,
                        "flag": "-a"
                    },
                    {
                        "name": "-e",
                        "lines": 5,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 5,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 7,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 6,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 6,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 18,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 10,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 9,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 3,
                        "flag": "-e"
                    },
                    {
                        "name": "-i",
                        "lines": 1,
                        "flag": "-i"
                    },
                    {
                        "name": "--instruction-pointer",
                        "lines": 2,
                        "long": "--instruction-pointer"
                    },
                    {
                        "name": "-n",
                        "lines": 1,
                        "flag": "-n"
                    },
                    {
                        "name": "--syscall-number",
                        "lines": 2,
                        "long": "--syscall-number"
                    },
                    {
                        "name": "-k",
                        "lines": 1,
                        "flag": "-k"
                    },
                    {
                        "name": "--stack-traces",
                        "lines": 2,
                        "long": "--stack-traces"
                    },
                    {
                        "name": "-o",
                        "lines": 8,
                        "flag": "-o"
                    },
                    {
                        "name": "-A",
                        "lines": 1,
                        "flag": "-A"
                    },
                    {
                        "name": "--output-append-mode",
                        "lines": 2,
                        "long": "--output-append-mode"
                    },
                    {
                        "name": "-q",
                        "lines": 1,
                        "flag": "-q"
                    },
                    {
                        "name": "--quiet",
                        "lines": 5,
                        "long": "--quiet"
                    },
                    {
                        "name": "-qq",
                        "lines": 4
                    },
                    {
                        "name": "-qqq",
                        "lines": 3
                    },
                    {
                        "name": "-r",
                        "lines": 5,
                        "flag": "-r"
                    },
                    {
                        "name": "us  (microseconds)",
                        "lines": 3
                    },
                    {
                        "name": "-s",
                        "lines": 16,
                        "flag": "-s"
                    },
                    {
                        "name": "ns (nanoseconds)",
                        "lines": 1
                    },
                    {
                        "name": "-t",
                        "lines": 1,
                        "flag": "-t"
                    },
                    {
                        "name": "--absolute-timestamps",
                        "lines": 2,
                        "long": "--absolute-timestamps"
                    },
                    {
                        "name": "-tt",
                        "lines": 3
                    },
                    {
                        "name": "-ttt",
                        "lines": 4
                    },
                    {
                        "name": "-T",
                        "lines": 6,
                        "flag": "-T"
                    },
                    {
                        "name": "-v",
                        "lines": 31,
                        "flag": "-v"
                    },
                    {
                        "name": "-x",
                        "lines": 3,
                        "flag": "-x"
                    },
                    {
                        "name": "-xx",
                        "lines": 3
                    },
                    {
                        "name": "-X",
                        "lines": 9,
                        "flag": "-X"
                    },
                    {
                        "name": "-y",
                        "lines": 1,
                        "flag": "-y"
                    },
                    {
                        "name": "--decode-fds",
                        "lines": 4,
                        "long": "--decode-fds"
                    },
                    {
                        "name": "-yy",
                        "lines": 6
                    },
                    {
                        "name": "--pidns-translation",
                        "lines": 4,
                        "long": "--pidns-translation"
                    },
                    {
                        "name": "-Y",
                        "lines": 3,
                        "flag": "-Y"
                    },
                    {
                        "name": "Statistics",
                        "lines": 1
                    },
                    {
                        "name": "-c",
                        "lines": 1,
                        "flag": "-c"
                    },
                    {
                        "name": "--summary-only",
                        "lines": 5,
                        "long": "--summary-only"
                    },
                    {
                        "name": "-C",
                        "lines": 2,
                        "flag": "-C"
                    },
                    {
                        "name": "-O",
                        "lines": 10,
                        "flag": "-O"
                    },
                    {
                        "name": "-S",
                        "lines": 7,
                        "flag": "-S"
                    },
                    {
                        "name": "-U",
                        "lines": 19,
                        "flag": "-U"
                    },
                    {
                        "name": "-w",
                        "lines": 1,
                        "flag": "-w"
                    },
                    {
                        "name": "--summary-wall-clock",
                        "lines": 3,
                        "long": "--summary-wall-clock"
                    },
                    {
                        "name": "Tampering",
                        "lines": 1
                    },
                    {
                        "name": "-e",
                        "lines": 93,
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "lines": 6,
                        "flag": "-e"
                    },
                    {
                        "name": "Miscellaneous",
                        "lines": 1
                    },
                    {
                        "name": "-d",
                        "lines": 2,
                        "flag": "-d"
                    },
                    {
                        "name": "-F",
                        "lines": 4,
                        "flag": "-F"
                    },
                    {
                        "name": "-h",
                        "lines": 2,
                        "flag": "-h"
                    },
                    {
                        "name": "--seccomp-bpf",
                        "lines": 9,
                        "long": "--seccomp-bpf"
                    },
                    {
                        "name": "-V",
                        "lines": 2,
                        "flag": "-V"
                    },
                    {
                        "name": "Time specification format description",
                        "lines": 2
                    },
                    {
                        "name": "s (seconds), ms (milliseconds), us (microseconds),",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "SETUID INSTALLATION",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "MULTIPLE PERSONALITIES SUPPORT",
                "lines": 39,
                "subsections": []
            },
            {
                "name": "NOTES",
                "lines": 36,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "strace - trace system calls and signals\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "strace [-ACdffhikqqrtttTvVwxxyyzZ] [-I n] [-b execve] [-e expr]... [-O overhead] [-S sortby]\n[-U columns] [-a column] [-o file] [-s strsize] [-X format] [-P path]... [-p pid]...\n[--seccomp-bpf] { -p pid | [-DDD] [-E var[=val]]... [-u username] command [args] }\n\nstrace -c [-dfwzZ] [-I n] [-b execve] [-e expr]... [-O overhead] [-S sortby] [-U columns]\n[-P path]... [-p pid]... [--seccomp-bpf] { -p pid | [-DDD] [-E var[=val]]...\n[-u username] command [args] }\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "In  the  simplest  case  strace runs the specified command until it exits.  It intercepts and\nrecords the system calls which are called by a process and the signals which are received  by\na  process.   The name of each system call, its arguments and its return value are printed on\nstandard error or to the file specified with the -o option.\n\nstrace is a useful diagnostic, instructional, and debugging tool.  System administrators, di‐\nagnosticians  and trouble-shooters will find it invaluable for solving problems with programs\nfor which the source is not readily available since they do not need to be recompiled in  or‐\nder  to trace them.  Students, hackers and the overly-curious will find that a great deal can\nbe learned about a system and its system calls by tracing even ordinary programs.   And  pro‐\ngrammers  will  find  that  since  system  calls  and  signals  are events that happen at the\nuser/kernel interface, a close examination of this boundary is very useful for bug isolation,\nsanity checking and attempting to capture race conditions.\n\nEach  line in the trace contains the system call name, followed by its arguments in parenthe‐\nses and its return value.  An example from stracing the command \"cat /dev/null\" is:\n\nopen(\"/dev/null\", ORDONLY) = 3\n\nErrors (typically a return value of -1) have the errno symbol and error string appended.\n\nopen(\"/foo/bar\", ORDONLY) = -1 ENOENT (No such file or directory)\n\nSignals are printed as signal symbol and decoded siginfo structure.  An excerpt from stracing\nand interrupting the command \"sleep 666\" is:\n\nsigsuspend([] <unfinished ...>\n--- SIGINT {sisigno=SIGINT, sicode=SIUSER, sipid=...} ---\n+++ killed by SIGINT +++\n\nIf a system call is being executed and meanwhile another one is being called from a different\nthread/process then strace will try to preserve the order of those events and mark the  ongo‐\ning call as being unfinished.  When the call returns it will be marked as resumed.\n\n[pid 28772] select(4, [3], NULL, NULL, NULL <unfinished ...>\n[pid 28779] clockgettime(CLOCKREALTIME, {1130322148, 939977000}) = 0\n[pid 28772] <... select resumed> )      = 1 (in [3])\n\nInterruption  of a (restartable) system call by a signal delivery is processed differently as\nkernel terminates the system call and also arranges its immediate reexecution after the  sig‐\nnal handler completes.\n\nread(0, 0x7ffff72cf5cf, 1)              = ? ERESTARTSYS (To be restarted)\n--- SIGALRM ... ---\nrtsigreturn(0xe)                       = 0\nread(0, \"\", 1)                          = 0\n\nArguments are printed in symbolic form with passion.  This example shows the shell performing\n\">>xyzzy\" output redirection:\n\nopen(\"xyzzy\", OWRONLY|OAPPEND|OCREAT, 0666) = 3\n\nHere, the second and the third argument of open(2) are decoded by breaking down the flag  ar‐\ngument  into its three bitwise-OR constituents and printing the mode value in octal by tradi‐\ntion.  Where the traditional or native usage differs from ANSI or POSIX, the latter forms are\npreferred.  In some cases, strace output is proven to be more readable than the source.\n\nStructure  pointers  are  dereferenced and the members are displayed as appropriate.  In most\ncases, arguments are formatted in the most C-like fashion possible.  For example, the essence\nof the command \"ls -l /dev/null\" is captured as:\n\nlstat(\"/dev/null\", {stmode=SIFCHR|0666, strdev=makedev(0x1, 0x3), ...}) = 0\n\nNotice  how  the 'struct stat' argument is dereferenced and how each member is displayed sym‐\nbolically.  In particular, observe how the stmode member is carefully decoded  into  a  bit‐\nwise-OR  of symbolic and numeric values.  Also notice in this example that the first argument\nto lstat(2) is an input to the system call and the second argument is an output.  Since  out‐\nput arguments are not modified if the system call fails, arguments may not always be derefer‐\nenced.  For example, retrying the \"ls -l\" example with a non-existent file produces the  fol‐\nlowing line:\n\nlstat(\"/foo/bar\", 0xb004) = -1 ENOENT (No such file or directory)\n\nIn this case the porch light is on but nobody is home.\n\nSyscalls  unknown  to  strace are printed raw, with the unknown system call number printed in\nhexadecimal form and prefixed with \"syscall\":\n\nsyscall0xbad(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = -1 ENOSYS (Function not implemented)\n\n\nCharacter pointers are dereferenced and printed as C  strings.   Non-printing  characters  in\nstrings  are  normally represented by ordinary C escape codes.  Only the first strsize (32 by\ndefault) bytes of strings are printed; longer strings have an ellipsis appended following the\nclosing  quote.  Here is a line from \"ls -l\" where the getpwuid(3) library routine is reading\nthe password file:\n\nread(3, \"root::0:0:System Administrator:/\"..., 1024) = 422\n\nWhile structures are annotated using curly braces, simple pointers and arrays are printed us‐\ning  square  brackets  with  commas separating elements.  Here is an example from the command\nid(1) on a system with supplementary group ids:\n\ngetgroups(32, [100, 0]) = 2\n\nOn the other hand, bit-sets are also shown using square brackets, but set elements are  sepa‐\nrated only by a space.  Here is the shell, preparing to execute an external command:\n\nsigprocmask(SIGBLOCK, [CHLD TTOU], []) = 0\n\nHere,  the  second argument is a bit-set of two signals, SIGCHLD and SIGTTOU.  In some cases,\nthe bit-set is so full that printing out the unset elements is more valuable.  In that  case,\nthe bit-set is prefixed by a tilde like this:\n\nsigprocmask(SIGUNBLOCK, ~[], NULL) = 0\n\nHere, the second argument represents the full set of all signals.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "General",
                        "content": ""
                    },
                    {
                        "name": "-e",
                        "content": "them.  The format of the expression is:\n\n[qualifier=][!]value[,value]...\n\nwhere qualifier is one of trace (or t), abbrev (or a), verbose (or  v),  raw  (or\nx),  signal  (or  signals  or  s),  read (or reads or r), write (or writes or w),\nfault, inject, status, quiet (or silent or silence  or  q),  decode-fds  (or  de‐‐\ncode-fd), decode-pids (or decode-pid), or kvm, and value is a qualifier-dependent\nsymbol or number.  The default qualifier is trace.   Using  an  exclamation  mark\nnegates  the  set  of values.  For example, -e open means literally -e trace=open\nwhich in turn means trace only the open system call.  By contrast, -e trace=!open\nmeans  to  trace  every system call except open.  In addition, the special values\nall and none have the obvious meanings.\n\nNote that some shells use the exclamation point for history expansion even inside\nquoted arguments.  If so, you must escape the exclamation point with a backslash.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "Startup",
                        "content": ""
                    },
                    {
                        "name": "-E",
                        "content": "--env=var=val\nRun command with var=val in its list of environment variables.\n",
                        "flag": "-E"
                    },
                    {
                        "name": "-E",
                        "content": "--env=var   Remove  var from the inherited list of environment variables before passing it on\nto the command.\n",
                        "flag": "-E"
                    },
                    {
                        "name": "-p",
                        "content": "--attach=pid\nAttach to the process with the process ID pid and begin tracing.  The  trace  may\nbe  terminated  at any time by a keyboard interrupt signal (CTRL-C).  strace will\nrespond by detaching itself from the traced process(es) leaving it (them) to con‐\ntinue  running.   Multiple  -p options can be used to attach to many processes in\naddition to command (which is optional if at least one -p option is given).  Mul‐\ntiple  process IDs, separated by either comma (“,”), space (“ ”), tab, or newline\ncharacter, can be provided as an argument to a single -p option, so, for example,\n-p \"$(pidof PROG)\" and -p \"$(pgrep PROG)\" syntaxes are supported.\n",
                        "flag": "-p"
                    },
                    {
                        "name": "-u",
                        "content": "--user=username\nRun  command  with  the  user ID, group ID, and supplementary groups of username.\nThis option is only useful when running as root and enables the correct execution\nof  setuid  and/or setgid binaries.  Unless this option is used setuid and setgid\nprograms are executed without effective privileges.\n",
                        "flag": "-u"
                    },
                    {
                        "name": "Tracing",
                        "content": ""
                    },
                    {
                        "name": "-b",
                        "content": "--detach-on=syscall\nIf specified syscall is reached, detach from traced process.  Currently, only ex‐‐\necve(2)  syscall is supported.  This option is useful if you want to trace multi-\nthreaded process and therefore require -f, but don't want to  trace  its  (poten‐\ntially very complex) children.\n",
                        "flag": "-b"
                    },
                    {
                        "name": "-D",
                        "content": "",
                        "flag": "-D"
                    },
                    {
                        "name": "--daemonize",
                        "content": "--daemonize=grandchild\nRun  tracer  process  as a grandchild, not as the parent of the tracee.  This re‐\nduces the visible effect of strace by keeping the tracee a direct  child  of  the\ncalling process.\n",
                        "long": "--daemonize"
                    },
                    {
                        "name": "-DD",
                        "content": "--daemonize=pgroup\n--daemonize=pgrp\nRun  tracer process as tracee's grandchild in a separate process group.  In addi‐\ntion to reduction of the visible effect of strace,  it  also  avoids  killing  of\nstrace with kill(2) issued to the whole process group.\n"
                    },
                    {
                        "name": "-DDD",
                        "content": "--daemonize=session\nRun tracer process as tracee's grandchild in a separate session (\"true daemonisa‐\ntion\").  In addition to reduction of the visible effect of strace, it also avoids\nkilling of strace upon session termination.\n"
                    },
                    {
                        "name": "-f",
                        "content": "",
                        "flag": "-f"
                    },
                    {
                        "name": "--follow-forks",
                        "content": "Trace  child processes as they are created by currently traced processes as a re‐\nsult of the fork(2), vfork(2) and clone(2) system calls.  Note  that  -p  PID  -f\nwill  attach  all threads of process PID if it is multi-threaded, not only thread\nwith threadid = PID.\n",
                        "long": "--follow-forks"
                    },
                    {
                        "name": "--output-separately",
                        "content": "If the --output=filename option is in effect, each processes trace is written  to\nfilename.pid where pid is the numeric process id of each process.\n",
                        "long": "--output-separately"
                    },
                    {
                        "name": "-ff",
                        "content": ""
                    },
                    {
                        "name": "--follow-forks --output-separately",
                        "content": "Combine  the  effects of --follow-forks and --output-separately options.  This is\nincompatible with -c, since no per-process counts are kept.\n\nOne might want to consider using strace-log-merge(1) to obtain a combined  strace\nlog view.\n",
                        "long": "--output-separately"
                    },
                    {
                        "name": "-I",
                        "content": "--interruptible=interruptible\nWhen strace can be interrupted by signals (such as pressing CTRL-C).\n\n1, anywhere    no signals are blocked;\n2, waiting     fatal signals are blocked while decoding syscall (default);\n3, never       fatal signals are always blocked (default if -o FILE PROG);\n4, nevertstp  fatal  signals  and SIGTSTP (CTRL-Z) are always blocked (useful to\nmake strace -o FILE PROG not stop on CTRL-Z, default if -D).\n",
                        "flag": "-I"
                    },
                    {
                        "name": "Filtering",
                        "content": ""
                    },
                    {
                        "name": "-e",
                        "content": "--trace=syscallset\nTrace only the  specified  set  of  system  calls.   syscallset  is  defined  as\n[!]value[,value], and value can be one of the following:\n\nsyscall      Trace specific syscall, specified by its name (but see NOTES).\n\n?value       Question mark before the syscall qualification allows suppression of\nerror in case no syscalls matched the qualification provided.\n\n/regex       Trace only those system calls that match the  regex.   You  can  use\nPOSIX Extended Regular Expression syntax (see regex(7)).\n\nsyscall@64   Trace syscall only for the 64-bit personality.\n\nsyscall@32   Trace syscall only for the 32-bit personality.\n\nsyscall@x32  Trace syscall only for the 32-on-64-bit personality.\n\n%file\nfile         Trace  all  system calls which take a file name as an argument.  You\ncan     think     of     this     as     an     abbreviation     for\n-e trace=open,stat,chmod,unlink,...   which is useful to seeing what\nfiles the process is referencing.  Furthermore, using the  abbrevia‐\ntion  will  ensure  that  you don't accidentally forget to include a\ncall like lstat(2) in the list.  Betchya  woulda  forgot  that  one.\nThe  syntax  without  a  preceding percent sign (\"-e trace=file\") is\ndeprecated.\n\n%process\nprocess      Trace system calls  associated  with  process  lifecycle  (creation,\nexec,  termination).   The  syntax  without a preceding percent sign\n(\"-e trace=process\") is deprecated.\n\n%net\n%network\nnetwork      Trace all the network related system calls.  The  syntax  without  a\npreceding percent sign (\"-e trace=network\") is deprecated.\n\n%signal\nsignal       Trace all signal related system calls.  The syntax without a preced‐\ning percent sign (\"-e trace=signal\") is deprecated.\n\n%ipc\nipc          Trace all IPC related system calls.  The syntax without a  preceding\npercent sign (\"-e trace=ipc\") is deprecated.\n\n%desc\ndesc         Trace  all file descriptor related system calls.  The syntax without\na preceding percent sign (\"-e trace=desc\") is deprecated.\n\n%memory\nmemory       Trace all memory mapping related system calls.  The syntax without a\npreceding percent sign (\"-e trace=memory\") is deprecated.\n\n%creds       Trace system calls that read or modify user and group identifiers or\ncapability sets.\n\n%stat        Trace stat syscall variants.\n\n%lstat       Trace lstat syscall variants.\n\n%fstat       Trace fstat, fstatat, and statx syscall variants.\n\n%%stat       Trace syscalls used for requesting file status (stat, lstat,  fstat,\nfstatat, statx, and their variants).\n\n%statfs      Trace statfs, statfs64, statvfs, osfstatfs, and osfstatfs64 system\ncalls.     The    same    effect    can     be     achieved     with\n-e trace=/^(.*)?statv?fs regular expression.\n\n%fstatfs     Trace  fstatfs,  fstatfs64, fstatvfs, osffstatfs, and osffstatfs64\nsystem calls.  The same effect can be  achieved  with  -e trace=/fs‐‐\ntatv?fs regular expression.\n\n%%statfs     Trace  syscalls  related to file system statistics (statfs-like, fs‐\ntatfs-like, and ustat).   The  same  effect  can  be  achieved  with\n-e trace=/statv?fs|fsstat|ustat regular expression.\n\n%clock       Trace system calls that read or modify system clocks.\n\n%pure        Trace  syscalls  that  always  succeed  and have no arguments.  Cur‐\nrently, this list includes  arcgettls(2),  getdtablesize(2),  gete‐‐\ngid(2),  getegid32(2),  geteuid(2),  geteuid32(2),  getgid(2),  get‐‐\ngid32(2),   getpagesize(2),   getpgrp(2),   getpid(2),   getppid(2),\ngetthreadarea(2)  (on  architectures  other  than x86), gettid(2),\ngettls(2),   getuid(2),   getuid32(2),   getxgid(2),    getxpid(2),\ngetxuid(2), kernfeatures(2), and metaggettls(2) syscalls.\n\nThe  -c  option  is  useful for determining which system calls might be useful to\ntrace.  For example, trace=open,close,read,write means to only trace  those  four\nsystem  calls.   Be careful when making inferences about the user/kernel boundary\nif only a subset of system calls are being monitored.  The default is trace=all.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--signal=set\nTrace only the specified subset of signals.  The default is signal=all.  For  ex‐\nample, signal=!SIGIO (or signal=!io) causes SIGIO signals not to be traced.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--status=set\nPrint  only  system  calls with the specified return status.  The default is sta‐‐\ntus=all.  When using the status qualifier, because strace waits for system  calls\nto  return before deciding whether they should be printed or not, the traditional\norder of events may not be preserved anymore.  If two system calls  are  executed\nby  concurrent  threads,  strace  will first print both the entry and exit of the\nfirst system call to exit, regardless of their respective entry time.  The  entry\nand  exit  of the second system call to exit will be printed afterwards.  Here is\nan example when select(2) is called, but  a  different  thread  calls  clockget‐‐\ntime(2) before select(2) finishes:\n\n[pid 28779] 1130322148.939977 clockgettime(CLOCKREALTIME, {1130322148, 939977000}) = 0\n[pid 28772] 1130322148.438139 select(4, [3], NULL, NULL, NULL) = 1 (in [3])\n\nset can include the following elements:\n\nsuccessful   Trace  system calls that returned without an error code.  The -z op‐\ntion has the effect of status=successful.\nfailed       Trace system calls that returned with an error code.  The -Z  option\nhas the effect of status=failed.\nunfinished   Trace  system calls that did not return.  This might happen, for ex‐\nample, due to an execve call in a neighbour thread.\nunavailable  Trace system calls that returned but strace failed to fetch the  er‐\nror status.\ndetached     Trace system calls for which strace detached before the return.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-P",
                        "content": "--trace-path=path\nTrace only system calls accessing path.  Multiple -P options can be used to spec‐\nify several paths.\n",
                        "flag": "-P"
                    },
                    {
                        "name": "-z",
                        "content": "",
                        "flag": "-z"
                    },
                    {
                        "name": "--successful-only",
                        "content": "Print only syscalls that returned without an error code.\n",
                        "long": "--successful-only"
                    },
                    {
                        "name": "-Z",
                        "content": "",
                        "flag": "-Z"
                    },
                    {
                        "name": "--failed-only",
                        "content": "Print only syscalls that returned with an error code.\n",
                        "long": "--failed-only"
                    },
                    {
                        "name": "Output format",
                        "content": ""
                    },
                    {
                        "name": "-a",
                        "content": "--columns=column\nAlign return values in a specific column (default column 40).\n",
                        "flag": "-a"
                    },
                    {
                        "name": "-e",
                        "content": "--abbrev=syscallset\nAbbreviate the output from printing each member of large structures.  The  syntax\nof  the syscallset specification is the same as in the -e trace option.  The de‐\nfault is abbrev=all.  The -v option has the effect of abbrev=none.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--verbose=syscallset\nDereference structures for the specified set of system calls.  The syntax of  the\nsyscallset  specification is the same as in the -e trace option.  The default is\nverbose=all.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--raw=syscallset\nPrint raw, undecoded arguments for the specified set of system calls.  The syntax\nof the syscallset specification is the same as in the -e trace option.  This op‐\ntion has the effect of causing all arguments to be printed in hexadecimal.   This\nis  mostly  useful if you don't trust the decoding or you need to know the actual\nnumeric value of an argument.  See also -X raw option.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--read=set  Perform a full hexadecimal and ASCII dump of all the data read from file descrip‐\ntors listed in the specified set.  For example, to see all input activity on file\ndescriptors 3 and 5 use -e read=3,5.  Note that this is independent from the nor‐\nmal  tracing  of  the  read(2)  system  call  which  is  controlled by the option\n-e trace=read.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--write=set Perform a full hexadecimal and ASCII dump of all the data  written  to  file  de‐\nscriptors  listed  in the specified set.  For example, to see all output activity\non file descriptors 3 and 5 use -e write=3,5.  Note that this is independent from\nthe  normal tracing of the write(2) system call which is controlled by the option\n-e trace=write.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--quiet=set\n--silent=set\n--silence=set\nSuppress various information messages.  The default is quiet=none.  set  can  in‐\nclude the following elements:\n\nattach           Suppress messages about attaching and detaching (\"[ Process NNNN\nattached ]\", \"[ Process NNNN detached ]\").\nexit             Suppress messages about process  exits  (\"+++  exited  with  SSS\n+++\").\npath-resolution  Suppress  messages about resolution of paths provided via the -P\noption (\"Requested path \"...\" resolved into \"...\"\").\npersonality      Suppress messages about process personality changes (\"[  Process\nPID=NNNN runs in PPP mode. ]\").\nthread-execve\nsuperseded       Suppress messages about process being superseded by execve(2) in\nanother thread (\"+++ superseded by execve in pid NNNN +++\").\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--decode-fds=set\nDecode various information associated with file descriptors.  The default is  de‐‐\ncode-fds=none.  set can include the following elements:\n\npath    Print  file paths.  Also enables printing of tracee's current working di‐\nrectory when ATFDCWD constant is used.\nsocket  Print socket protocol-specific information,\ndev     Print character/block device numbers.\npidfd   Print PIDs associated with pidfd file descriptors.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--decode-pids=set\nDecode various information associated with process  IDs  (and  also  thread  IDs,\nprocess  group  IDs, and session IDs).  The default is decode-pids=none.  set can\ninclude the following elements:\n\ncomm    Print command names associated with thread or process IDs.\npidns   Print thread, process, process group, and session  IDs  in  strace's  PID\nnamespace if the tracee is in a different PID namespace.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--kvm=vcpu  Print  the  exit  reason  of  kvm  vcpu.  Requires Linux kernel version 4.16.0 or\nhigher.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-i",
                        "content": "",
                        "flag": "-i"
                    },
                    {
                        "name": "--instruction-pointer",
                        "content": "Print the instruction pointer at the time of the system call.\n",
                        "long": "--instruction-pointer"
                    },
                    {
                        "name": "-n",
                        "content": "",
                        "flag": "-n"
                    },
                    {
                        "name": "--syscall-number",
                        "content": "Print the syscall number.\n",
                        "long": "--syscall-number"
                    },
                    {
                        "name": "-k",
                        "content": "",
                        "flag": "-k"
                    },
                    {
                        "name": "--stack-traces",
                        "content": "Print the execution stack trace of the traced processes after each system call.\n",
                        "long": "--stack-traces"
                    },
                    {
                        "name": "-o",
                        "content": "--output=filename\nWrite the trace output to the file filename rather than to stderr.   filename.pid\nform  is used if -ff option is supplied.  If the argument begins with '|' or '!',\nthe rest of the argument is treated as a command and all output is piped  to  it.\nThis is convenient for piping the debugging output to a program without affecting\nthe redirections of executed programs.  The latter is not compatible with -ff op‐\ntion currently.\n",
                        "flag": "-o"
                    },
                    {
                        "name": "-A",
                        "content": "",
                        "flag": "-A"
                    },
                    {
                        "name": "--output-append-mode",
                        "content": "Open the file provided in the -o option in append mode.\n",
                        "long": "--output-append-mode"
                    },
                    {
                        "name": "-q",
                        "content": "",
                        "flag": "-q"
                    },
                    {
                        "name": "--quiet",
                        "content": "--quiet=attach,personality\nSuppress messages about attaching, detaching, and personality changes.  This hap‐\npens automatically when output is redirected to a file and the command is run di‐\nrectly instead of attaching.\n",
                        "long": "--quiet"
                    },
                    {
                        "name": "-qq",
                        "content": "--quiet=attach,personality,exit\nSuppress  messages  attaching,  detaching, personality changes, and about process\nexit status.\n"
                    },
                    {
                        "name": "-qqq",
                        "content": "--quiet=all Suppress all suppressible messages (please refer to the -e quiet option  descrip‐\ntion for the full list of suppressible messages).\n"
                    },
                    {
                        "name": "-r",
                        "content": "--relative-timestamps[=precision]\nPrint a relative timestamp upon entry to each system call.  This records the time\ndifference between the beginning of successive system calls.   precision  can  be\none  of  s  (for  seconds), ms (milliseconds), us (microseconds), or ns (nanosec‐\nonds), and allows setting the precision of time value being printed.  Default  is",
                        "flag": "-r"
                    },
                    {
                        "name": "us  (microseconds)",
                        "content": "measuring time difference and not the wall clock time, its measurements can  dif‐\nfer from the difference in time reported by the -t option.\n"
                    },
                    {
                        "name": "-s",
                        "content": "--string-limit=strsize\nSpecify  the  maximum  string size to print (the default is 32).  Note that file‐\nnames are not considered strings and are always printed in full.\n\n--absolute-timestamps[=[[format:]format],[[precision:]precision]]\n--timestamps[=[[format:]format],[[precision:]precision]]\nPrefix each line of the trace with the wall clock time in  the  specified  format\nwith the specified precision.  format can be one of the following:\n\nnone          No  time  stamp  is  printed.  Can be used to override the previous\nsetting.\ntime          Wall clock time (strftime(3) format string is %T).\nunix          Number of seconds since the epoch  (strftime(3)  format  string  is\n%s).\n\nprecision can be one of s (for seconds), ms (milliseconds), us (microseconds), or",
                        "flag": "-s"
                    },
                    {
                        "name": "ns (nanoseconds)",
                        "content": ""
                    },
                    {
                        "name": "-t",
                        "content": "",
                        "flag": "-t"
                    },
                    {
                        "name": "--absolute-timestamps",
                        "content": "Prefix each line of the trace with the wall clock time.\n",
                        "long": "--absolute-timestamps"
                    },
                    {
                        "name": "-tt",
                        "content": "--absolute-timestamps=precision:us\nIf given twice, the time printed will include the microseconds.\n"
                    },
                    {
                        "name": "-ttt",
                        "content": "--absolute-timestamps=format:unix,precision:us\nIf given thrice, the time printed will include the microseconds and  the  leading\nportion will be printed as the number of seconds since the epoch.\n"
                    },
                    {
                        "name": "-T",
                        "content": "--syscall-times[=precision]\nShow  the  time  spent in system calls.  This records the time difference between\nthe beginning and the end of each system call.  precision can be one  of  s  (for\nseconds),  ms  (milliseconds), us (microseconds), or ns (nanoseconds), and allows\nsetting the precision of time value being printed.  Default is us (microseconds).\n",
                        "flag": "-T"
                    },
                    {
                        "name": "-v",
                        "content": "--no-abbrev Print unabbreviated versions of environment, stat, termios, etc.   calls.   These\nstructures  are  very common in calls and so the default behavior displays a rea‐\nsonable subset of structure members.  Use this option to get all of the gory  de‐\ntails.\n\n--strings-in-hex[=option]\nControl  usage  of  escape  sequences  with  hexadecimal  numbers  in the printed\nstrings.  Normally (when no --strings-in-hex or -x option  is  supplied),  escape\nsequences  are  used  to  print  non-printable and non-ASCII characters (that is,\ncharacters with a character code less than 32 or greater than 127), or to  disam‐\nbiguate  the  output (so, for quotes and other characters that encase the printed\nstring, for example, angle brackets, in case of file descriptor path output); for\nthe former use case, unless it is a white space character that has a symbolic es‐\ncape sequence defined in the C standard (that is, “\\t” for a horizontal tab, “\\n”\nfor a newline, “\\v” for a vertical tab, “\\f” for a form feed page break, and “\\r”\nfor a carriage return) are printed using escape sequences with numbers that  cor‐\nrespond to their byte values, with octal number format being the default.  option\ncan be one of the following:\n\nnone             Hexadecimal numbers are not used in the  output  at  all.   When\nthere  is  a  need to emit an escape sequence, octal numbers are\nused.\nnon-ascii-chars  Hexadecimal numbers are used instead of octal in the escape  se‐\nquences.\nnon-ascii        Strings  that contain non-ASCII characters are printed using es‐\ncape sequences with hexadecimal numbers.\nall              All strings are printed using escape sequences with  hexadecimal\nnumbers.\n\nWhen the option is supplied without an argument, all is assumed.\n",
                        "flag": "-v"
                    },
                    {
                        "name": "-x",
                        "content": "--strings-in-hex=non-ascii\nPrint all non-ASCII strings in hexadecimal string format.\n",
                        "flag": "-x"
                    },
                    {
                        "name": "-xx",
                        "content": "--strings-in-hex[=all]\nPrint all strings in hexadecimal string format.\n"
                    },
                    {
                        "name": "-X",
                        "content": "--const-print-style=format\nSet  the format for printing of named constants and flags.  Supported format val‐\nues are:\n\nraw       Raw number output, without decoding.\nabbrev    Output a named constant or a set of flags instead of the raw number  if\nthey are found.  This is the default strace behaviour.\nverbose   Output both the raw value and the decoded string (as a comment).\n",
                        "flag": "-X"
                    },
                    {
                        "name": "-y",
                        "content": "",
                        "flag": "-y"
                    },
                    {
                        "name": "--decode-fds",
                        "content": "--decode-fds=path\nPrint  paths associated with file descriptor arguments and with the ATFDCWD con‐\nstant.\n",
                        "long": "--decode-fds"
                    },
                    {
                        "name": "-yy",
                        "content": "--decode-fds=all\nPrint all available information associated with file  descriptors:  protocol-spe‐\ncific information associated with socket file descriptors, block/character device\nnumber associated with device file descriptors, and PIDs  associated  with  pidfd\nfile descriptors.\n"
                    },
                    {
                        "name": "--pidns-translation",
                        "content": "--decode-pids=pidns\nIf  strace  and  tracee  are  in different PID namespaces, print PIDs in strace's\nnamespace, too.\n",
                        "long": "--pidns-translation"
                    },
                    {
                        "name": "-Y",
                        "content": "--decode-pids=comm\nPrint command names for PIDs.\n",
                        "flag": "-Y"
                    },
                    {
                        "name": "Statistics",
                        "content": ""
                    },
                    {
                        "name": "-c",
                        "content": "",
                        "flag": "-c"
                    },
                    {
                        "name": "--summary-only",
                        "content": "Count time, calls, and errors for each system call and report a summary  on  pro‐\ngram  exit,  suppressing  the  regular output.  This attempts to show system time\n(CPU time spent running in the kernel) independent of wall clock time.  If -c  is\nused with -f, only aggregate totals for all traced processes are kept.\n",
                        "long": "--summary-only"
                    },
                    {
                        "name": "-C",
                        "content": "--summary   Like -c but also print regular output while processes are running.\n",
                        "flag": "-C"
                    },
                    {
                        "name": "-O",
                        "content": "--summary-syscall-overhead=overhead\nSet  the overhead for tracing system calls to overhead.  This is useful for over‐\nriding the default heuristic for guessing how much time is spent in mere  measur‐\ning  when timing system calls using the -c option.  The accuracy of the heuristic\ncan be gauged by timing a given program run without tracing (using  time(1))  and\ncomparing the accumulated system call time to the total produced using -c.\n\nThe  format  of overhead specification is described in section Time specification\nformat description.\n",
                        "flag": "-O"
                    },
                    {
                        "name": "-S",
                        "content": "--summary-sort-by=sortby\nSort the output of the histogram printed by the -c option by the specified crite‐\nrion.   Legal  values  are  time  (or  time-percent or time-total or total-time),\nmin-time (or shortest or time-min), max-time (or longest or  time-max),  avg-time\n(or  time-avg),  calls  (or  count),  errors  (or  error),  name  (or  syscall or\nsyscall-name), and nothing (or none); default is time.\n",
                        "flag": "-S"
                    },
                    {
                        "name": "-U",
                        "content": "--summary-columns=columns\nConfigure a set (and order) of columns being shown in the call summary.  The col‐\numns argument is a comma-separated list with items being one of the following:\n\ntime-percent (or time)              Percentage  of  cumulative time consumed by a\nspecific system call.\ntotal-time (or time-total)          Total system (or wall clock, if -w option  is\nprovided)  time consumed by a specific system\ncall.\nmin-time (or shortest or time-min)  Minimum observed call duration.\nmax-time (or longest or time-max)   Maximum observed call duration.\navg-time (or time-avg)              Average call duration.\ncalls (or count)                    Call count.\nerrors (or error)                   Error count.\nname (or syscall or syscall-name)   Syscall name.\n\nThe default value is time-percent,total-time,avg-time,calls,errors,name.  If  the\nname field is not supplied explicitly, it is added as the last column.\n",
                        "flag": "-U"
                    },
                    {
                        "name": "-w",
                        "content": "",
                        "flag": "-w"
                    },
                    {
                        "name": "--summary-wall-clock",
                        "content": "Summarise  the time difference between the beginning and end of each system call.\nThe default is to summarise the system time.\n",
                        "long": "--summary-wall-clock"
                    },
                    {
                        "name": "Tampering",
                        "content": ""
                    },
                    {
                        "name": "-e",
                        "content": "ter=delay][:delayexit=delay][:pokeen‐‐\nter=@argN=DATAN,@argM=DATAM...][:pokeexit=@argN=DATAN,@argM=DATAM...][:when=expr]\n--inject=syscallset[:error=errno|:retval=value][:signal=sig][:syscall=syscall][:delayen‐‐\nter=delay][:de‐‐\nlayexit=delay][:pokeen‐‐\nter=@argN=DATAN,@argM=DATAM...][:pokeexit=@argN=DATAN,@argM=DATAM...][:when=expr]\nPerform  syscall  tampering for the specified set of syscalls.  The syntax of the\nsyscallset specification is the same as in the -e trace option.\n\nAt least one of error, retval, signal, delayenter,  delayexit,  pokeenter,  or\npokeexit options has to be specified.  error and retval are mutually exclusive.\n\nIf  :error=errno  option is specified, a fault is injected into a syscall invoca‐\ntion: the syscall number is replaced  by  -1  which  corresponds  to  an  invalid\nsyscall (unless a syscall is specified with :syscall= option), and the error code\nis specified using a symbolic errno value like ENOSYS or a numeric  value  within\n1..4095 range.\n\nIf :retval=value option is specified, success injection is performed: the syscall\nnumber is replaced by -1, but a bogus success value is returned to the callee.\n\nIf :signal=sig option is specified with either a symbolic value like SIGSEGV or a\nnumeric  value within 1..SIGRTMAX range, that signal is delivered on entering ev‐\nery syscall specified by the set.\n\nIf :delayenter=delay or :delayexit=delay options are specified, delay injection\nis performed: the tracee is delayed by time period specified by delay on entering\nor exiting the syscall, respectively.  The format of delay specification  is  de‐\nscribed in section Time specification format description.\n\nIf                   :pokeenter=@argN=DATAN,@argM=DATAM...                    or\n:pokeexit=@argN=DATAN,@argM=DATAM... options are specified, tracee's  memory  at\nlocations,  pointed to by system call arguments argN and argM (going from arg1 to\narg7) is overwritten by data DATAN and DATAM (specified  in  hexadecimal  format;\nfor  example :pokeenter=@arg1=0000DEAD0000BEEF).  :pokeenter modifies memory on\nsyscall enter, and :pokeexit - on exit.\n\nIf :signal=sig option is specified without :error=errno,  :retval=value  or  :de‐‐\nlay{enter,exit}=usecs  options,  then  only  a signal sig is delivered without a\nsyscall fault or delay injection.  Conversely, :error=errno or :retval=value  op‐\ntion without :delayenter=delay, :delayexit=delay or :signal=sig options injects\na fault without delivering a signal or injecting a delay, etc.\n\nIf :signal=sig option is specified together with :error=errno  or  :retval=value,\nthen both injection of a fault or success and signal delivery are performed.\n\nif  :syscall=syscall  option is specified, the corresponding syscall with no side\neffects is injected instead of -1.  Currently, only \"pure\"  (see  -e  trace=%pure\ndescription) syscalls can be specified there.\n\nUnless  a  :when=expr subexpression is specified, an injection is being made into\nevery invocation of each syscall from the set.\n\nThe format of the subexpression is:\n\nfirst[..last][+[step]]\n\nNumber first stands for the first invocation number in  the  range,  number  last\nstands  for the last invocation number in the range, and step stands for the step\nbetween two consecutive invocations.  The following combinations are useful:\n\nfirst             For every syscall from the set, perform an  injection  for  the\nsyscall invocation number first only.\nfirst..last       For  every  syscall  from the set, perform an injection for the\nsyscall invocation number first and all subsequent  invocations\nuntil the invocation number last (inclusive).\nfirst+            For  every  syscall  from  the  set, perform injections for the\nsyscall invocation number first and all subsequent invocations.\nfirst..last+      For every syscall from the  set,  perform  injections  for  the\nsyscall  invocation number first and all subsequent invocations\nuntil the invocation number last (inclusive).\nfirst+step        For every syscall from the set, perform injections for  syscall\ninvocations  number  first, first+step, first+step+step, and so\non.\nfirst..last+step  Same as the previous, but  consider  only  syscall  invocations\nwith numbers up to last (inclusive).\n\nFor  example,  to  fail each third and subsequent chdir syscalls with ENOENT, use\n-e inject=chdir:error=ENOENT:when=3+.\n\nThe valid range for numbers first and step is 1..65535, and for  number  last  is\n1..65534.\n\nAn injection expression can contain only one error= or retval= specification, and\nonly one signal= specification.  If an  injection  expression  contains  multiple\nwhen= specifications, the last one takes precedence.\n\nAccounting  of syscalls that are subject to injection is done per syscall and per\ntracee.\n\nSpecification of syscall injection can be combined with other  syscall  filtering\noptions, for example, -P /dev/urandom -e inject=file:error=ENOENT.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "-e",
                        "content": "--fault=syscallset[:error=errno][:when=expr]\nPerform syscall fault injection for the specified set of syscalls.\n\nThis  is  equivalent  to more generic -e inject= expression with default value of\nerrno option set to ENOSYS.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "Miscellaneous",
                        "content": ""
                    },
                    {
                        "name": "-d",
                        "content": "--debug     Show some debugging output of strace itself on the standard error.\n",
                        "flag": "-d"
                    },
                    {
                        "name": "-F",
                        "content": "may  be  removed in future releases.  Usage of multiple instances of -F option is\nstill equivalent to a single -f, and it is ignored at all if used along with  one\nor more instances of -f option.\n",
                        "flag": "-F"
                    },
                    {
                        "name": "-h",
                        "content": "--help      Print the help summary.\n",
                        "flag": "-h"
                    },
                    {
                        "name": "--seccomp-bpf",
                        "content": "Try  to  enable  use of seccomp-bpf (see seccomp(2)) to have ptrace(2)-stops only\nwhen system calls that are being traced occur in the traced processes.  This  op‐\ntion  has no effect unless -f/--follow-forks is also specified.  --seccomp-bpf is\nalso not applicable to processes attached using -p/--attach option.   An  attempt\nto  enable system calls filtering using seccomp-bpf may fail for various reasons,\ne.g. there are too many system calls to filter, the seccomp API is not available,\nor strace itself is being traced.  In cases when seccomp-bpf filter setup failed,\nstrace proceeds as usual and stops traced processes on every system call.\n",
                        "long": "--seccomp-bpf"
                    },
                    {
                        "name": "-V",
                        "content": "--version   Print the version number of strace.\n",
                        "flag": "-V"
                    },
                    {
                        "name": "Time specification format description",
                        "content": "Time values can be specified as a decimal floating point number (in a format accepted by str‐‐\ntod(3)),  optionally followed by one of the following suffices that specify the unit of time:"
                    },
                    {
                        "name": "s (seconds), ms (milliseconds), us (microseconds),",
                        "content": "specified, the value is interpreted as microseconds.\n\nThe described format is used for -O, -e inject=delayenter, and -e inject=delayexit options.\n"
                    }
                ]
            },
            "DIAGNOSTICS": {
                "content": "When  command  exits,  strace exits with the same exit status.  If command is terminated by a\nsignal, strace terminates itself with the same signal, so that strace can be used as a  wrap‐\nper  process transparent to the invoking parent process.  Note that parent-child relationship\n(signal stop notifications, getppid(2) value, etc) between traced process and its parent  are\nnot preserved unless -D is used.\n\nWhen  using  -p  without a command, the exit status of strace is zero unless no processes has\nbeen attached or there was an unexpected error in doing the tracing.\n",
                "subsections": []
            },
            "SETUID INSTALLATION": {
                "content": "If strace is installed setuid to root then the invoking user will be able to  attach  to  and\ntrace  processes  owned by any user.  In addition setuid and setgid programs will be executed\nand traced with the correct effective privileges.  Since only users trusted  with  full  root\nprivileges should be allowed to do these things, it only makes sense to install strace as se‐\ntuid to root when the users who can execute it are restricted to those users  who  have  this\ntrust.   For  example, it makes sense to install a special version of strace with mode 'rwsr-\nxr--', user root and group trace, where members of the trace group are trusted users.  If you\ndo  use  this  feature, please remember to install a regular non-setuid version of strace for\nordinary users to use.\n",
                "subsections": []
            },
            "MULTIPLE PERSONALITIES SUPPORT": {
                "content": "On some architectures, strace supports decoding of syscalls for processes that use  different\nABI  rather  than  the  one  strace  uses.  Specifically, in addition to decoding native ABI,\nstrace can decode the following ABIs on the following architectures:\n\n┌───────────────────┬─────────────────────────┐\n│Architecture       │ ABIs supported          │\n├───────────────────┼─────────────────────────┤\n│x8664             │ i386, x32 [1]; i386 [2] │\n├───────────────────┼─────────────────────────┤\n│AArch64            │ ARM 32-bit EABI         │\n├───────────────────┼─────────────────────────┤\n│PowerPC 64-bit [3] │ PowerPC 32-bit          │\n├───────────────────┼─────────────────────────┤\n│s390x              │ s390                    │\n├───────────────────┼─────────────────────────┤\n│SPARC 64-bit       │ SPARC 32-bit            │\n├───────────────────┼─────────────────────────┤\n│TILE 64-bit        │ TILE 32-bit             │\n└───────────────────┴─────────────────────────┘\n[1]  When strace is built as an x8664 application\n[2]  When strace is built as an x32 application\n[3]  Big endian only\n\nThis support is optional and relies on ability to generate and  parse  structure  definitions\nduring  the build time.  Please refer to the output of the strace -V command in order to fig‐\nure out what support is available in your strace build (\"non-native\" refers to  an  ABI  that\ndiffers from the ABI strace has):\n\nm32-mpers      strace can trace and properly decode non-native 32-bit binaries.\nno-m32-mpers   strace can trace, but cannot properly decode non-native 32-bit binaries.\nmx32-mpers     strace can trace and properly decode non-native 32-on-64-bit binaries.\nno-mx32-mpers  strace can trace, but cannot properly decode non-native 32-on-64-bit binaries.\n\nIf the output contains neither m32-mpers nor no-m32-mpers, then decoding of non-native 32-bit\nbinaries is not implemented at all or not applicable.\n\nLikewise, if the output contains neither mx32-mpers nor no-mx32-mpers, then decoding of  non-\nnative 32-on-64-bit binaries is not implemented at all or not applicable.\n",
                "subsections": []
            },
            "NOTES": {
                "content": "It is a pity that so much tracing clutter is produced by systems employing shared libraries.\n\nIt  is  instructive  to  think  about  system call inputs and outputs as data-flow across the\nuser/kernel boundary.  Because user-space and  kernel-space  are  separate  and  address-pro‐\ntected,  it  is  sometimes possible to make deductive inferences about process behavior using\ninputs and outputs as propositions.\n\nIn some cases, a system call will differ from the documented behavior  or  have  a  different\nname.   For example, the faccessat(2) system call does not have flags argument, and the setr‐‐\nlimit(2) library function uses prlimit64(2) system call on modern (2.6.38+)  kernels.   These\ndiscrepancies  are  normal but idiosyncratic characteristics of the system call interface and\nare accounted for by C library wrapper functions.\n\nSome system calls have different names in  different  architectures  and  personalities.   In\nthese  cases,  system  call  filtering  and  printing uses the names that match corresponding\nNR* kernel macros of the tracee's architecture and personality.  There are two  exceptions\nfrom  this  general  rule:  armfadvise6464(2) ARM syscall and xtensafadvise6464(2) Xtensa\nsyscall are filtered and printed as fadvise6464(2).\n\nOn x32, syscalls that are intended to be used by 64-bit processes and not x32 ones (for exam‐\nple,  readv(2),  that  has  syscall number 19 on x8664, with its x32 counterpart has syscall\nnumber 515), but called with X32SYSCALLBIT flag being set, are designated with  #64  suf‐\nfix.\n\nOn  some  platforms  a  process that is attached to with the -p option may observe a spurious\nEINTR return from the current system call that is  not  restartable.   (Ideally,  all  system\ncalls  should  be  restarted  on  strace  attach,  making  the attach invisible to the traced\nprocess, but a few system calls aren't.  Arguably, every instance of such behavior is a  ker‐\nnel  bug.)   This may have an unpredictable effect on the process if the process takes no ac‐\ntion to restart the system call.\n\nAs strace executes the specified command directly and does  not  employ  a  shell  for  that,\nscripts without shebang that usually run just fine when invoked by shell fail to execute with\nENOEXEC error.  It is advisable to manually supply a shell as a command with  the  script  as\nits argument.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Programs that use the setuid bit do not have effective user ID privileges while being traced.\n\nA traced process runs slowly (but check out the --seccomp-bpf option).\n\nTraced processes which are descended from command may be left running after an interrupt sig‐\nnal (CTRL-C).\n",
                "subsections": []
            },
            "HISTORY": {
                "content": "The original strace was written by Paul Kranenburg for SunOS and was inspired  by  its  trace\nutility.   The  SunOS version of strace was ported to Linux and enhanced by Branko Lankester,\nwho also wrote the Linux kernel support.  Even though  Paul  released  strace  2.5  in  1992,\nBranko's work was based on Paul's strace 1.5 release from 1991.  In 1993, Rick Sladkey merged\nstrace 2.5 for SunOS and the second release of strace for Linux, added many of  the  features\nof  truss(1)  from  SVR4, and produced an strace that worked on both platforms.  In 1994 Rick\nported strace to SVR4 and Solaris and wrote the automatic configuration support.  In 1995  he\nported strace to Irix and tired of writing about himself in the third person.\n\nBeginning  with  1996,  strace was maintained by Wichert Akkerman.  During his tenure, strace\ndevelopment migrated to CVS; ports to FreeBSD and many architectures on Linux (including ARM,\nIA-64,  MIPS,  PA-RISC, PowerPC, s390, SPARC) were introduced.  In 2002, the burden of strace\nmaintainership was transferred to Roland McGrath.  Since then, strace gained support for sev‐\neral  new  Linux  architectures  (AMD64,  s390x, SuperH), bi-architecture support for some of\nthem, and received numerous additions and improvements in syscalls decoders on Linux;  strace\ndevelopment migrated to git during that period.  Since 2009, strace is actively maintained by\nDmitry Levin.  strace gained support for AArch64, ARC, AVR32, Blackfin, Meta, Nios II,  Open‐\nRISC  1000, RISC-V, Tile/TileGx, Xtensa architectures since that time.  In 2012, unmaintained\nand apparently broken support for non-Linux operating systems was  removed.   Also,  in  2012\nstrace  gained  support for path tracing and file descriptor path decoding.  In 2014, support\nfor stack traces printing was added.  In 2016, syscall fault injection was implemented.\n\nFor the additional information, please refer to the NEWS file and  strace  repository  commit\nlog.\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "Problems    with    strace    should    be    reported    to    the   strace   mailing   list\n⟨mailto:strace-devel@lists.strace.io⟩.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "strace-log-merge(1), ltrace(1), perf-trace(1), trace-cmd(1), time(1), ptrace(2), proc(5)\n\nstrace Home Page ⟨https://strace.io/⟩\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "The complete list of strace contributors can be found in the CREDITS file.\n\n\n\nstrace 5.16                                  2022-01-04                                    STRACE(1)",
                "subsections": []
            }
        }
    }
}