|
|
904f19 |
From ffc3e46d6ea23ba71eb49c8bc36eb3068968b691 Mon Sep 17 00:00:00 2001
|
|
|
904f19 |
From: Eugene Syromyatnikov <evgsyr@gmail.com>
|
|
|
904f19 |
Date: Tue, 4 Sep 2018 16:45:04 +0200
|
|
|
904f19 |
Subject: [PATCH 11/27] strace.1.in: print names of entities in bold, provide
|
|
|
904f19 |
man page sections
|
|
|
904f19 |
|
|
|
904f19 |
* strace.1.in (.SH DESCRIPTION, .SH OPTIONS): Add man page section
|
|
|
904f19 |
numbers. Make mentions of strace and other entities bold.
|
|
|
904f19 |
|
|
|
904f19 |
Additional changes:
|
|
|
904f19 |
Update auto-generated strace.1
|
|
|
904f19 |
|
|
|
904f19 |
---
|
|
|
904f19 |
strace.1.in | 89 ++++++++++++++++++++++++++++++++++++++++++-------------------
|
|
|
904f19 |
1 file changed, 61 insertions(+), 28 deletions(-)
|
|
|
904f19 |
|
|
|
904f19 |
Index: strace-4.24/strace.1.in
|
|
|
904f19 |
===================================================================
|
|
|
904f19 |
--- strace-4.24.orig/strace.1.in 2018-07-07 12:29:02.000000000 +0200
|
|
|
904f19 |
+++ strace-4.24/strace.1.in 2019-03-10 05:12:00.665873244 +0100
|
|
|
904f19 |
@@ -177,7 +177,7 @@
|
|
|
904f19 |
open("xyzzy", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3
|
|
|
904f19 |
.CE
|
|
|
904f19 |
Here, the third argument of
|
|
|
904f19 |
-.B open
|
|
|
904f19 |
+.BR open (2)
|
|
|
904f19 |
is decoded by breaking down the
|
|
|
904f19 |
flag argument into its three bitwise-OR constituents and printing the
|
|
|
904f19 |
mode value in octal by tradition. Where the traditional or native
|
|
|
904f19 |
@@ -198,7 +198,7 @@
|
|
|
904f19 |
.B st_mode
|
|
|
904f19 |
member is carefully decoded into a bitwise-OR of symbolic and numeric values.
|
|
|
904f19 |
Also notice in this example that the first argument to
|
|
|
904f19 |
-.B lstat
|
|
|
904f19 |
+.BR lstat (2)
|
|
|
904f19 |
is an input to the system call and the second argument is an output.
|
|
|
904f19 |
Since output arguments are not modified if the system call fails, arguments may
|
|
|
904f19 |
not always be dereferenced. For example, retrying the "ls \-l" example
|
|
|
904f19 |
@@ -224,15 +224,16 @@
|
|
|
904f19 |
(32 by default) bytes of strings are printed;
|
|
|
904f19 |
longer strings have an ellipsis appended following the closing quote.
|
|
|
904f19 |
Here is a line from "ls \-l" where the
|
|
|
904f19 |
-.B getpwuid
|
|
|
904f19 |
+.BR getpwuid (3)
|
|
|
904f19 |
library routine is reading the password file:
|
|
|
904f19 |
.CW
|
|
|
904f19 |
read(3, "root::0:0:System Administrator:/"..., 1024) = 422
|
|
|
904f19 |
.CE
|
|
|
904f19 |
While structures are annotated using curly braces, simple pointers
|
|
|
904f19 |
and arrays are printed using square brackets with commas separating
|
|
|
904f19 |
-elements. Here is an example from the command "id" on a system with
|
|
|
904f19 |
-supplementary group ids:
|
|
|
904f19 |
+elements. Here is an example from the command
|
|
|
904f19 |
+.BR id (1)
|
|
|
904f19 |
+on a system with supplementary group ids:
|
|
|
904f19 |
.CW
|
|
|
904f19 |
getgroups(32, [100, 0]) = 2
|
|
|
904f19 |
.CE
|
|
|
904f19 |
@@ -489,7 +490,7 @@
|
|
|
904f19 |
which is useful to seeing what files the process is referencing.
|
|
|
904f19 |
Furthermore, using the abbreviation will ensure that you don't
|
|
|
904f19 |
accidentally forget to include a call like
|
|
|
904f19 |
-.B lstat
|
|
|
904f19 |
+.BR lstat (2)
|
|
|
904f19 |
in the list. Betchya woulda forgot that one.
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.BR "\-e\ trace" = %process
|
|
|
904f19 |
@@ -769,8 +770,7 @@
|
|
|
904f19 |
\fB\-e\ inject\fR= expression with default value of
|
|
|
904f19 |
.I errno
|
|
|
904f19 |
option set to
|
|
|
904f19 |
-.IR ENOSYS .
|
|
|
904f19 |
-
|
|
|
904f19 |
+.BR ENOSYS .
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.BR "\-e\ kvm" = vcpu
|
|
|
904f19 |
Print the exit reason of kvm vcpu. Requires Linux kernel version 4.16.0
|
|
|
904f19 |
@@ -794,10 +794,11 @@
|
|
|
904f19 |
.BI "\-b " syscall
|
|
|
904f19 |
If specified syscall is reached, detach from traced process.
|
|
|
904f19 |
Currently, only
|
|
|
904f19 |
-.I execve
|
|
|
904f19 |
+.BR execve (2)
|
|
|
904f19 |
syscall is supported. This option is useful if you want to trace
|
|
|
904f19 |
-multi-threaded process and therefore require -f, but don't want
|
|
|
904f19 |
-to trace its (potentially very complex) children.
|
|
|
904f19 |
+multi-threaded process and therefore require
|
|
|
904f19 |
+.BR \-f ,
|
|
|
904f19 |
+but don't want to trace its (potentially very complex) children.
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.B \-D
|
|
|
904f19 |
Run tracer process as a detached grandchild, not as parent of the
|
|
|
904f19 |
@@ -816,16 +817,20 @@
|
|
|
904f19 |
.B \-p
|
|
|
904f19 |
.I PID
|
|
|
904f19 |
.B \-f
|
|
|
904f19 |
-will attach all threads of process PID if it is multi-threaded,
|
|
|
904f19 |
-not only thread with thread_id = PID.
|
|
|
904f19 |
+will attach all threads of process
|
|
|
904f19 |
+.I PID
|
|
|
904f19 |
+if it is multi-threaded, not only thread with
|
|
|
904f19 |
+.IR thread_id " = " PID .
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.B \-ff
|
|
|
904f19 |
If the
|
|
|
904f19 |
.B \-o
|
|
|
904f19 |
.I filename
|
|
|
904f19 |
option is in effect, each processes trace is written to
|
|
|
904f19 |
-.I filename.pid
|
|
|
904f19 |
-where pid is the numeric process id of each process.
|
|
|
904f19 |
+.IR filename . pid
|
|
|
904f19 |
+where
|
|
|
904f19 |
+.I pid
|
|
|
904f19 |
+is the numeric process id of each process.
|
|
|
904f19 |
This is incompatible with
|
|
|
904f19 |
.BR \-c ,
|
|
|
904f19 |
since no per-process counts are kept.
|
|
|
904f19 |
@@ -835,11 +840,30 @@
|
|
|
904f19 |
to obtain a combined strace log view.
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.BI "\-I " interruptible
|
|
|
904f19 |
-When strace can be interrupted by signals (such as pressing ^C).
|
|
|
904f19 |
-1: no signals are blocked; 2: fatal signals are blocked while decoding syscall
|
|
|
904f19 |
-(default); 3: fatal signals are always blocked (default if '-o FILE PROG');
|
|
|
904f19 |
-4: fatal signals and SIGTSTP (^Z) are always blocked (useful to make
|
|
|
904f19 |
-strace -o FILE PROG not stop on ^Z).
|
|
|
904f19 |
+When
|
|
|
904f19 |
+.B strace
|
|
|
904f19 |
+can be interrupted by signals (such as pressing
|
|
|
904f19 |
+.BR ^C ).
|
|
|
904f19 |
+.RS
|
|
|
904f19 |
+.TP 4
|
|
|
904f19 |
+.B 1
|
|
|
904f19 |
+no signals are blocked;
|
|
|
904f19 |
+.TQ
|
|
|
904f19 |
+.B 2
|
|
|
904f19 |
+fatal signals are blocked while decoding syscall (default);
|
|
|
904f19 |
+.TQ
|
|
|
904f19 |
+.B 3
|
|
|
904f19 |
+fatal signals are always blocked (default if
|
|
|
904f19 |
+.BR -o " " \fIFILE\fR " " \fIPROG\fR );
|
|
|
904f19 |
+.TQ
|
|
|
904f19 |
+.B 4
|
|
|
904f19 |
+fatal signals and
|
|
|
904f19 |
+.BR SIGTSTP " (" ^Z )
|
|
|
904f19 |
+are always blocked (useful to make
|
|
|
904f19 |
+.BI "strace -o " "FILE PROG"
|
|
|
904f19 |
+not stop on
|
|
|
904f19 |
+.BR ^Z ).
|
|
|
904f19 |
+.RE
|
|
|
904f19 |
.SS Startup
|
|
|
904f19 |
.TP 12
|
|
|
904f19 |
\fB\-E\ \fIvar\fR=\,\fIval\fR
|
|
|
904f19 |
@@ -920,7 +944,8 @@
|
|
|
904f19 |
.B strace
|
|
|
904f19 |
can be used as a wrapper process transparent to the invoking parent process.
|
|
|
904f19 |
Note that parent-child relationship (signal stop notifications,
|
|
|
904f19 |
-getppid() value, etc) between traced process and its parent are not preserved
|
|
|
904f19 |
+.BR getppid (2)
|
|
|
904f19 |
+value, etc) between traced process and its parent are not preserved
|
|
|
904f19 |
unless
|
|
|
904f19 |
.B \-D
|
|
|
904f19 |
is used.
|
|
|
904f19 |
@@ -987,8 +1012,11 @@
|
|
|
904f19 |
definitions during the build time.
|
|
|
904f19 |
Please refer to the output of the
|
|
|
904f19 |
.B strace \-V
|
|
|
904f19 |
-command in order to figure out what support is available in your strace build
|
|
|
904f19 |
-("non-native" refers to an ABI that differs from the ABI strace has):
|
|
|
904f19 |
+command in order to figure out what support is available in your
|
|
|
904f19 |
+.B strace
|
|
|
904f19 |
+build ("non-native" refers to an ABI that differs from the ABI
|
|
|
904f19 |
+.B strace
|
|
|
904f19 |
+has):
|
|
|
904f19 |
.TP 15
|
|
|
904f19 |
.B m32-mpers
|
|
|
904f19 |
.B strace
|
|
|
904f19 |
@@ -1057,17 +1085,22 @@
|
|
|
904f19 |
.LP
|
|
|
904f19 |
On x32, syscalls that are intended to be used by 64-bit processes and not x32
|
|
|
904f19 |
ones (for example,
|
|
|
904f19 |
-.BR readv ,
|
|
|
904f19 |
+.BR readv (2),
|
|
|
904f19 |
that has syscall number 19 on x86_64, with its x32 counterpart has syscall
|
|
|
904f19 |
number 515), but called with
|
|
|
904f19 |
.B __X32_SYSCALL_BIT
|
|
|
904f19 |
-flag being set, are designated with "#64" suffix.
|
|
|
904f19 |
+flag being set, are designated with
|
|
|
904f19 |
+.B "#64"
|
|
|
904f19 |
+suffix.
|
|
|
904f19 |
.LP
|
|
|
904f19 |
On some platforms a process that is attached to with the
|
|
|
904f19 |
.B \-p
|
|
|
904f19 |
-option may observe a spurious EINTR return from the current
|
|
|
904f19 |
-system call that is not restartable. (Ideally, all system calls
|
|
|
904f19 |
-should be restarted on strace attach, making the attach invisible
|
|
|
904f19 |
+option may observe a spurious
|
|
|
904f19 |
+.B EINTR
|
|
|
904f19 |
+return from the current system call that is not restartable.
|
|
|
904f19 |
+(Ideally, all system calls should be restarted on
|
|
|
904f19 |
+.B strace
|
|
|
904f19 |
+attach, making the attach invisible
|
|
|
904f19 |
to the traced process, but a few system calls aren't.
|
|
|
904f19 |
Arguably, every instance of such behavior is a kernel bug.)
|
|
|
904f19 |
This may have an unpredictable effect on the process
|
|
|
904f19 |
Index: strace-4.24/strace.1
|
|
|
904f19 |
===================================================================
|
|
|
904f19 |
--- strace-4.24.orig/strace.1 2018-08-14 02:44:59.000000000 +0200
|
|
|
904f19 |
+++ strace-4.24/strace.1 2019-03-10 05:15:15.101926224 +0100
|
|
|
904f19 |
@@ -53,7 +53,7 @@
|
|
|
904f19 |
. el \
|
|
|
904f19 |
. BR "\\$1"
|
|
|
904f19 |
..
|
|
|
904f19 |
-.TH STRACE 1 "2018-07-07" "strace 4.24"
|
|
|
904f19 |
+.TH STRACE 1 "2019-03-08" "strace 4.24"
|
|
|
904f19 |
.SH NAME
|
|
|
904f19 |
strace \- trace system calls and signals
|
|
|
904f19 |
.SH SYNOPSIS
|
|
|
904f19 |
@@ -177,7 +177,7 @@
|
|
|
904f19 |
open("xyzzy", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3
|
|
|
904f19 |
.CE
|
|
|
904f19 |
Here, the third argument of
|
|
|
904f19 |
-.B open
|
|
|
904f19 |
+.BR open (2)
|
|
|
904f19 |
is decoded by breaking down the
|
|
|
904f19 |
flag argument into its three bitwise-OR constituents and printing the
|
|
|
904f19 |
mode value in octal by tradition. Where the traditional or native
|
|
|
904f19 |
@@ -198,7 +198,7 @@
|
|
|
904f19 |
.B st_mode
|
|
|
904f19 |
member is carefully decoded into a bitwise-OR of symbolic and numeric values.
|
|
|
904f19 |
Also notice in this example that the first argument to
|
|
|
904f19 |
-.B lstat
|
|
|
904f19 |
+.BR lstat (2)
|
|
|
904f19 |
is an input to the system call and the second argument is an output.
|
|
|
904f19 |
Since output arguments are not modified if the system call fails, arguments may
|
|
|
904f19 |
not always be dereferenced. For example, retrying the "ls \-l" example
|
|
|
904f19 |
@@ -224,15 +224,16 @@
|
|
|
904f19 |
(32 by default) bytes of strings are printed;
|
|
|
904f19 |
longer strings have an ellipsis appended following the closing quote.
|
|
|
904f19 |
Here is a line from "ls \-l" where the
|
|
|
904f19 |
-.B getpwuid
|
|
|
904f19 |
+.BR getpwuid (3)
|
|
|
904f19 |
library routine is reading the password file:
|
|
|
904f19 |
.CW
|
|
|
904f19 |
read(3, "root::0:0:System Administrator:/"..., 1024) = 422
|
|
|
904f19 |
.CE
|
|
|
904f19 |
While structures are annotated using curly braces, simple pointers
|
|
|
904f19 |
and arrays are printed using square brackets with commas separating
|
|
|
904f19 |
-elements. Here is an example from the command "id" on a system with
|
|
|
904f19 |
-supplementary group ids:
|
|
|
904f19 |
+elements. Here is an example from the command
|
|
|
904f19 |
+.BR id (1)
|
|
|
904f19 |
+on a system with supplementary group ids:
|
|
|
904f19 |
.CW
|
|
|
904f19 |
getgroups(32, [100, 0]) = 2
|
|
|
904f19 |
.CE
|
|
|
904f19 |
@@ -489,7 +490,7 @@
|
|
|
904f19 |
which is useful to seeing what files the process is referencing.
|
|
|
904f19 |
Furthermore, using the abbreviation will ensure that you don't
|
|
|
904f19 |
accidentally forget to include a call like
|
|
|
904f19 |
-.B lstat
|
|
|
904f19 |
+.BR lstat (2)
|
|
|
904f19 |
in the list. Betchya woulda forgot that one.
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.BR "\-e\ trace" = %process
|
|
|
904f19 |
@@ -769,8 +770,7 @@
|
|
|
904f19 |
\fB\-e\ inject\fR= expression with default value of
|
|
|
904f19 |
.I errno
|
|
|
904f19 |
option set to
|
|
|
904f19 |
-.IR ENOSYS .
|
|
|
904f19 |
-
|
|
|
904f19 |
+.BR ENOSYS .
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.BR "\-e\ kvm" = vcpu
|
|
|
904f19 |
Print the exit reason of kvm vcpu. Requires Linux kernel version 4.16.0
|
|
|
904f19 |
@@ -794,10 +794,11 @@
|
|
|
904f19 |
.BI "\-b " syscall
|
|
|
904f19 |
If specified syscall is reached, detach from traced process.
|
|
|
904f19 |
Currently, only
|
|
|
904f19 |
-.I execve
|
|
|
904f19 |
+.BR execve (2)
|
|
|
904f19 |
syscall is supported. This option is useful if you want to trace
|
|
|
904f19 |
-multi-threaded process and therefore require -f, but don't want
|
|
|
904f19 |
-to trace its (potentially very complex) children.
|
|
|
904f19 |
+multi-threaded process and therefore require
|
|
|
904f19 |
+.BR \-f ,
|
|
|
904f19 |
+but don't want to trace its (potentially very complex) children.
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.B \-D
|
|
|
904f19 |
Run tracer process as a detached grandchild, not as parent of the
|
|
|
904f19 |
@@ -816,16 +817,20 @@
|
|
|
904f19 |
.B \-p
|
|
|
904f19 |
.I PID
|
|
|
904f19 |
.B \-f
|
|
|
904f19 |
-will attach all threads of process PID if it is multi-threaded,
|
|
|
904f19 |
-not only thread with thread_id = PID.
|
|
|
904f19 |
+will attach all threads of process
|
|
|
904f19 |
+.I PID
|
|
|
904f19 |
+if it is multi-threaded, not only thread with
|
|
|
904f19 |
+.IR thread_id " = " PID .
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.B \-ff
|
|
|
904f19 |
If the
|
|
|
904f19 |
.B \-o
|
|
|
904f19 |
.I filename
|
|
|
904f19 |
option is in effect, each processes trace is written to
|
|
|
904f19 |
-.I filename.pid
|
|
|
904f19 |
-where pid is the numeric process id of each process.
|
|
|
904f19 |
+.IR filename . pid
|
|
|
904f19 |
+where
|
|
|
904f19 |
+.I pid
|
|
|
904f19 |
+is the numeric process id of each process.
|
|
|
904f19 |
This is incompatible with
|
|
|
904f19 |
.BR \-c ,
|
|
|
904f19 |
since no per-process counts are kept.
|
|
|
904f19 |
@@ -835,11 +840,30 @@
|
|
|
904f19 |
to obtain a combined strace log view.
|
|
|
904f19 |
.TP
|
|
|
904f19 |
.BI "\-I " interruptible
|
|
|
904f19 |
-When strace can be interrupted by signals (such as pressing ^C).
|
|
|
904f19 |
-1: no signals are blocked; 2: fatal signals are blocked while decoding syscall
|
|
|
904f19 |
-(default); 3: fatal signals are always blocked (default if '-o FILE PROG');
|
|
|
904f19 |
-4: fatal signals and SIGTSTP (^Z) are always blocked (useful to make
|
|
|
904f19 |
-strace -o FILE PROG not stop on ^Z).
|
|
|
904f19 |
+When
|
|
|
904f19 |
+.B strace
|
|
|
904f19 |
+can be interrupted by signals (such as pressing
|
|
|
904f19 |
+.BR ^C ).
|
|
|
904f19 |
+.RS
|
|
|
904f19 |
+.TP 4
|
|
|
904f19 |
+.B 1
|
|
|
904f19 |
+no signals are blocked;
|
|
|
904f19 |
+.TQ
|
|
|
904f19 |
+.B 2
|
|
|
904f19 |
+fatal signals are blocked while decoding syscall (default);
|
|
|
904f19 |
+.TQ
|
|
|
904f19 |
+.B 3
|
|
|
904f19 |
+fatal signals are always blocked (default if
|
|
|
904f19 |
+.BR -o " " \fIFILE\fR " " \fIPROG\fR );
|
|
|
904f19 |
+.TQ
|
|
|
904f19 |
+.B 4
|
|
|
904f19 |
+fatal signals and
|
|
|
904f19 |
+.BR SIGTSTP " (" ^Z )
|
|
|
904f19 |
+are always blocked (useful to make
|
|
|
904f19 |
+.BI "strace -o " "FILE PROG"
|
|
|
904f19 |
+not stop on
|
|
|
904f19 |
+.BR ^Z ).
|
|
|
904f19 |
+.RE
|
|
|
904f19 |
.SS Startup
|
|
|
904f19 |
.TP 12
|
|
|
904f19 |
\fB\-E\ \fIvar\fR=\,\fIval\fR
|
|
|
904f19 |
@@ -920,7 +944,8 @@
|
|
|
904f19 |
.B strace
|
|
|
904f19 |
can be used as a wrapper process transparent to the invoking parent process.
|
|
|
904f19 |
Note that parent-child relationship (signal stop notifications,
|
|
|
904f19 |
-getppid() value, etc) between traced process and its parent are not preserved
|
|
|
904f19 |
+.BR getppid (2)
|
|
|
904f19 |
+value, etc) between traced process and its parent are not preserved
|
|
|
904f19 |
unless
|
|
|
904f19 |
.B \-D
|
|
|
904f19 |
is used.
|
|
|
904f19 |
@@ -987,8 +1012,11 @@
|
|
|
904f19 |
definitions during the build time.
|
|
|
904f19 |
Please refer to the output of the
|
|
|
904f19 |
.B strace \-V
|
|
|
904f19 |
-command in order to figure out what support is available in your strace build
|
|
|
904f19 |
-("non-native" refers to an ABI that differs from the ABI strace has):
|
|
|
904f19 |
+command in order to figure out what support is available in your
|
|
|
904f19 |
+.B strace
|
|
|
904f19 |
+build ("non-native" refers to an ABI that differs from the ABI
|
|
|
904f19 |
+.B strace
|
|
|
904f19 |
+has):
|
|
|
904f19 |
.TP 15
|
|
|
904f19 |
.B m32-mpers
|
|
|
904f19 |
.B strace
|
|
|
904f19 |
@@ -1057,17 +1085,22 @@
|
|
|
904f19 |
.LP
|
|
|
904f19 |
On x32, syscalls that are intended to be used by 64-bit processes and not x32
|
|
|
904f19 |
ones (for example,
|
|
|
904f19 |
-.BR readv ,
|
|
|
904f19 |
+.BR readv (2),
|
|
|
904f19 |
that has syscall number 19 on x86_64, with its x32 counterpart has syscall
|
|
|
904f19 |
number 515), but called with
|
|
|
904f19 |
.B __X32_SYSCALL_BIT
|
|
|
904f19 |
-flag being set, are designated with "#64" suffix.
|
|
|
904f19 |
+flag being set, are designated with
|
|
|
904f19 |
+.B "#64"
|
|
|
904f19 |
+suffix.
|
|
|
904f19 |
.LP
|
|
|
904f19 |
On some platforms a process that is attached to with the
|
|
|
904f19 |
.B \-p
|
|
|
904f19 |
-option may observe a spurious EINTR return from the current
|
|
|
904f19 |
-system call that is not restartable. (Ideally, all system calls
|
|
|
904f19 |
-should be restarted on strace attach, making the attach invisible
|
|
|
904f19 |
+option may observe a spurious
|
|
|
904f19 |
+.B EINTR
|
|
|
904f19 |
+return from the current system call that is not restartable.
|
|
|
904f19 |
+(Ideally, all system calls should be restarted on
|
|
|
904f19 |
+.B strace
|
|
|
904f19 |
+attach, making the attach invisible
|
|
|
904f19 |
to the traced process, but a few system calls aren't.
|
|
|
904f19 |
Arguably, every instance of such behavior is a kernel bug.)
|
|
|
904f19 |
This may have an unpredictable effect on the process
|