Skip to content

Commit

Permalink
tools: fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
asd142513 committed Jul 8, 2022
1 parent 5370855 commit ea3c885
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
16 changes: 8 additions & 8 deletions man/man8/argdist.8
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Trace only functions in the process PID.
Trace only functions in the thread TID.
.TP
\-z STRING_SIZE
When collecting string arguments (of type char*), collect up to STRING_SIZE
When collecting string arguments (of type char*), collect up to STRING_SIZE
characters. Longer strings will be truncated.
.TP
\-i INTERVAL
Expand All @@ -48,21 +48,21 @@ probe, which parameters to collect, how to aggregate them, and whether to perfor
any filtering. See SPECIFIER SYNTAX below.
.TP
\-I header
One or more header files that should be included in the BPF program. This
One or more header files that should be included in the BPF program. This
enables the use of structure definitions, enumerations, and constants that
are available in these headers. You should provide the same path you would
include in the BPF program, e.g. 'linux/blkdev.h' or 'linux/time.h'. Note: in
many cases, argdist will deduce the necessary header files automatically.
many cases, argdist will deduce the necessary header files automatically.
.SH SPECIFIER SYNTAX
The general specifier syntax is as follows:

.B {p,r,t,u}:{[library],category}:function(signature)[:type[,type...]:expr[,expr...][:filter]][#label]
.B {p,r,t,u}:{[library],category}:function(signature):type[,type...]:expr[,expr...][:filter]][#label]
.TP
.B {p,r,t,u}
Probe type \- "p" for function entry, "r" for function return, "t" for kernel
tracepoint, "u" for USDT probe; \-H for histogram collection, \-C for frequency count.
Indicates where to place the probe and whether the probe should collect frequency
count information, or aggregate the collected values into a histogram. Counting
count information, or aggregate the collected values into a histogram. Counting
probes will collect the number of times every parameter value was observed,
whereas histogram probes will collect the parameter values into a histogram.
Only integral types can be used with histogram probes; there is no such limitation
Expand All @@ -80,7 +80,7 @@ The category of the kernel tracepoint. For example: net, sched, block.
.B function(signature)
The function to probe, and its signature.
The function name must match exactly for the probe to be placed. The signature,
on the other hand, is only required if you plan to collect parameter values
on the other hand, is only required if you plan to collect parameter values
based on that signature. For example, if you only want to collect the first
parameter, you don't have to specify the rest of the parameters in the signature.
When capturing kernel tracepoints, this should be the name of the event, e.g.
Expand All @@ -101,7 +101,7 @@ parameters, such as "size % 10".
Tracepoints may access a special structure called "args" that is formatted
according to the tracepoint format (which you can obtain using tplist).
For example, the block:block_rq_complete tracepoint can access args->nr_sector.
USDT probes may access the arguments defined by the tracing program in the
USDT probes may access the arguments defined by the tracing program in the
special arg1, arg2, ... variables. To obtain their types, use the tplist tool.
Return probes can use the argument values received by the
function when it was entered, through the $entry(paramname) special variable.
Expand All @@ -124,7 +124,7 @@ literal string, and the second argument can be a runtime string.
.TP
.B [label]
The label that will be displayed when printing the probed values. By default,
this is the probe specifier.
this is the probe specifier.
.SH EXAMPLES
.TP
Print a histogram of allocation sizes passed to kmalloc:
Expand Down
1 change: 1 addition & 0 deletions man/man8/funclatency.8
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ CONFIG_BPF and bcc.
pattern
Function name or search pattern. Supports "*" wildcards. See EXAMPLES.
You can also use \-r for regular expressions.
.TP
\-h
Print usage message.
.TP
Expand Down
21 changes: 11 additions & 10 deletions man/man8/trace.8
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ trace \- Trace a function and print its arguments or return value, optionally ev
probe [probe ...]
.SH DESCRIPTION
trace probes functions you specify and displays trace messages if a particular
condition is met. You can control the message format to display function
arguments and return values.
condition is met. You can control the message format to display function
arguments and return values.

Since this uses BPF, only the root user can use this tool.
.SH REQUIREMENTS
Expand All @@ -35,7 +35,7 @@ When collecting string arguments (of type char*), collect up to STRING_SIZE
characters. Longer strings will be truncated.
.TP
\-s SYM_FILE_LIST
When collecting stack trace in build id format, use the coma separated list for
When collecting stack trace in build id format, use the comma separated list for
symbol resolution.
.TP
\-S
Expand Down Expand Up @@ -75,6 +75,7 @@ Print the kernel stack for each event.
.TP
\-U
Print the user stack for each event.
.TP
\-a
Print virtual address in kernel and user stacks.
.TP
Expand Down Expand Up @@ -138,15 +139,15 @@ retval in a return probe. If necessary, use C cast operators to coerce the
arguments to the desired type. For example, if arg1 is of type int, use the
expression ((int)arg1 < 0) to trace only invocations where arg1 is negative.
Note that only arg1-arg6 are supported, and only if the function is using the
standard x86_64 convention where the first six arguments are in the RDI, RSI,
RDX, RCX, R8, R9 registers. If no predicate is specified, all function
standard x86_64 convention where the first six arguments are in the RDI, RSI,
RDX, RCX, R8, R9 registers. If no predicate is specified, all function
invocations are traced.

The predicate expression may also use the STRCMP pseudo-function to compare
a predefined string to a string argument. For example: STRCMP("test", arg1).
The order of arguments is important: the first argument MUST be a quoted
literal string, and the second argument can be a runtime string, most typically
an argument.
an argument.
.TP
.B ["format string"[, arguments]]
A printf-style format string that will be used for the trace message. You can
Expand All @@ -164,14 +165,14 @@ process, such as sprintf.

In tracepoints, both the predicate and the arguments may refer to the tracepoint
format structure, which is stored in the special "args" variable. For example, the
block:block_rq_complete tracepoint can print or filter by args->nr_sector. To
discover the format of your tracepoint, use the tplist tool.
block:block_rq_complete tracepoint can print or filter by args->nr_sector. To
discover the format of your tracepoint, use the tplist tool.

In USDT probes, the arg1, ..., argN variables refer to the probe's arguments.
To determine which arguments your probe has, use the tplist tool.

The predicate expression and the format specifier replacements for printing
may also use the following special keywords: $pid, $tgid to refer to the
may also use the following special keywords: $pid, $tgid to refer to the
current process' pid and tgid; $uid, $gid to refer to the current user's
uid and gid; $cpu to refer to the current processor number.
.SH EXAMPLES
Expand All @@ -190,7 +191,7 @@ Trace all malloc calls and print the size of the requested allocation:
.TP
Trace returns from the readline function in bash and print the return value as a string:
#
.B trace 'r:bash:readline """%s"", retval'
.B trace 'r:bash:readline """%s"", retval'
.TP
Trace the block:block_rq_complete tracepoint and print the number of sectors completed:
#
Expand Down
2 changes: 1 addition & 1 deletion tools/argdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def __str__(self):
class Tool(object):
examples = """
Probe specifier syntax:
{p,r,t,u}:{[library],category}:function(signature)[:type[,type...]:expr[,expr...][:filter]][#label]
{p,r,t,u}:{[library],category}:function(signature):type[,type...]:expr[,expr...][:filter]][#label]
Where:
p,r,t,u -- probe at function entry, function exit, kernel
tracepoint, or USDT probe
Expand Down
2 changes: 1 addition & 1 deletion tools/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ def __init__(self):
help="allow to use STRCMP with binary values")
parser.add_argument('-s', "--sym_file_list", type=str,
metavar="SYM_FILE_LIST", dest="sym_file_list",
help="coma separated list of symbol files to use \
help="comma separated list of symbol files to use \
for symbol resolution")
parser.add_argument("-K", "--kernel-stack",
action="store_true", help="output kernel stack trace")
Expand Down
2 changes: 1 addition & 1 deletion tools/trace_example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ optional arguments:
only print the msg of event containing this string
-B, --bin_cmp allow to use STRCMP with binary values
-s SYM_FILE_LIST, --sym_file_list SYM_FILE_LIST
coma separated list of symbol files to use for symbol
comma separated list of symbol files to use for symbol
resolution
-K, --kernel-stack output kernel stack trace
-U, --user-stack output user stack trace
Expand Down

0 comments on commit ea3c885

Please sign in to comment.