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