1PERF-PROBE(1)                     perf Manual                    PERF-PROBE(1)
2
3
4

NAME

6       perf-probe - Define new dynamic tracepoints
7

SYNOPSIS

9       perf probe [options] --add=PROBE [...]
10       or
11       perf probe [options] PROBE
12       or
13       perf probe [options] --del=[GROUP:]EVENT [...]
14       or
15       perf probe --list
16       or
17       perf probe --line=FUNC[:RLN[+NUM|:RLN2]]|SRC:ALN[+NUM|:ALN2]
18

DESCRIPTION

20       This command defines dynamic tracepoint events, by symbol and registers
21       without debuginfo, or by C expressions (C line numbers, C function
22       names, and C local variables) with debuginfo.
23

OPTIONS

25       -k, --vmlinux=PATH
26           Specify vmlinux path which has debuginfo (Dwarf binary).
27
28       -v, --verbose
29           Be more verbose (show parsed arguments, etc).
30
31       -a, --add=
32           Define a probe event (see PROBE SYNTAX for detail).
33
34       -d, --del=
35           Delete probe events. This accepts glob wildcards(*, ?) and
36           character classes(e.g. [a-z], [!A-Z]).
37
38       -l, --list
39           List up current probe events.
40
41       -L, --line=
42           Show source code lines which can be probed. This needs an argument
43           which specifies a range of the source code. (see LINE SYNTAX for
44           detail)
45
46       -f, --force
47           Forcibly add events with existing name.
48
49       -n, --dry-run
50           Dry run. With this option, --add and --del doesn’t execute actual
51           adding and removal operations.
52
53       --max-probes
54           Set the maximum number of probe points for an event. Default is
55           128.
56

PROBE SYNTAX

58       Probe points are defined by following syntax.
59
60           1) Define event based on function name
61            [EVENT=]FUNC[@SRC][:RLN|+OFFS|%return|;PTN] [ARG ...]
62
63           2) Define event based on source file with line number
64            [EVENT=]SRC:ALN [ARG ...]
65
66           3) Define event based on source file with lazy pattern
67            [EVENT=]SRC;PTN [ARG ...]
68
69       EVENT specifies the name of new event, if omitted, it will be set the
70       name of the probed function. Currently, event group name is set as
71       probe. FUNC specifies a probed function name, and it may have one of
72       the following options; +OFFS is the offset from function entry address
73       in bytes, :RLN is the relative-line number from function entry line,
74       and %return means that it probes function return. And ;PTN means lazy
75       matching pattern (see LAZY MATCHING). Note that ;PTN must be the end of
76       the probe point definition. In addition, @SRC specifies a source file
77       which has that function. It is also possible to specify a probe point
78       by the source line number or lazy matching by using SRC:ALN or SRC;PTN
79       syntax, where SRC is the source file path, :ALN is the line number and
80       ;PTN is the lazy matching pattern. ARG specifies the arguments of this
81       probe point, (see PROBE ARGUMENT).
82

PROBE ARGUMENT

84       Each probe argument follows below syntax.
85
86           [NAME=]LOCALVAR|$retval|%REG|@SYMBOL[:TYPE]
87
88       NAME specifies the name of this argument (optional). You can use the
89       name of local variable, local data structure member (e.g. var→field,
90       var.field2), or kprobe-tracer argument format (e.g. $retval, %ax, etc).
91       Note that the name of this argument will be set as the last member name
92       if you specify a local data structure member (e.g. field2 for
93       var→field1.field2.) TYPE casts the type of this argument (optional). If
94       omitted, perf probe automatically set the type based on debuginfo.
95

LINE SYNTAX

97       Line range is descripted by following syntax.
98
99           "FUNC[:RLN[+NUM|-RLN2]]|SRC:ALN[+NUM|-ALN2]"
100
101       FUNC specifies the function name of showing lines. RLN is the start
102       line number from function entry line, and RLN2 is the end line number.
103       As same as probe syntax, SRC means the source file path, ALN is start
104       line number, and ALN2 is end line number in the file. It is also
105       possible to specify how many lines to show by using NUM. So,
106       "source.c:100-120" shows lines between 100th to l20th in source.c file.
107       And "func:10+20" shows 20 lines from 10th line of func function.
108

LAZY MATCHING

110           The lazy line matching is similar to glob matching but ignoring spaces in both of pattern and target. So this accepts wildcards('*', '?') and character classes(e.g. [a-z], [!A-Z]).
111
112       e.g. a=* can matches a=b, a = b, a == b and so on.
113
114       This provides some sort of flexibility and robustness to probe point
115       definitions against minor code changes. For example, actual 10th line
116       of schedule() can be moved easily by modifying schedule(), but the same
117       line matching rq=cpu_rq* may still exist in the function.)
118

EXAMPLES

120       Display which lines in schedule() can be probed:
121
122           ./perf probe --line schedule
123
124       Add a probe on schedule() function 12th line with recording cpu local
125       variable:
126
127           ./perf probe schedule:12 cpu
128           or
129           ./perf probe --add='schedule:12 cpu'
130
131           this will add one or more probes which has the name start with "schedule".
132
133           Add probes on lines in schedule() function which calls update_rq_clock().
134
135           ./perf probe 'schedule;update_rq_clock*'
136           or
137           ./perf probe --add='schedule;update_rq_clock*'
138
139       Delete all probes on schedule().
140
141           ./perf probe --del='schedule*'
142

SEE ALSO

144       perf-trace(1), perf-record(1)
145
146
147
148perf 2.6.35.14-106.fc             11/23/2011                     PERF-PROBE(1)
Impressum