perf-probe.txt (c50f62454f4b489422333cb2e31401d87456bfa1) perf-probe.txt (36a009fe07bdecd201335f982babb8af34b603e2)
1perf-probe(1)
2=============
3
4NAME
5----
6perf-probe - Define new dynamic tracepoints
7
8SYNOPSIS

--- 137 unchanged lines hidden (view full) ---

146 [[GROUP:]EVENT=]FUNC[@SRC][:RLN|+OFFS|%return|;PTN] [ARG ...]
147
148 2) Define event based on source file with line number
149 [[GROUP:]EVENT=]SRC:ALN [ARG ...]
150
151 3) Define event based on source file with lazy pattern
152 [[GROUP:]EVENT=]SRC;PTN [ARG ...]
153
1perf-probe(1)
2=============
3
4NAME
5----
6perf-probe - Define new dynamic tracepoints
7
8SYNOPSIS

--- 137 unchanged lines hidden (view full) ---

146 [[GROUP:]EVENT=]FUNC[@SRC][:RLN|+OFFS|%return|;PTN] [ARG ...]
147
148 2) Define event based on source file with line number
149 [[GROUP:]EVENT=]SRC:ALN [ARG ...]
150
151 3) Define event based on source file with lazy pattern
152 [[GROUP:]EVENT=]SRC;PTN [ARG ...]
153
154 4) Pre-defined SDT events or cached event with name
155 %[PROVIDER:]SDTEVENT
154
155'EVENT' specifies the name of new event, if omitted, it will be set the name of the probed function. You can also specify a group name by 'GROUP', if omitted, set 'probe' is used for kprobe and 'probe_<bin>' is used for uprobe.
156Note that using existing group name can conflict with other events. Especially, using the group name reserved for kernel modules can hide embedded events in the
157modules.
158'FUNC' specifies a probed function name, and it may have one of the following options; '+OFFS' is the offset from function entry address in bytes, ':RLN' is the relative-line number from function entry line, and '%return' means that it probes function return. And ';PTN' means lazy matching pattern (see LAZY MATCHING). Note that ';PTN' must be the end of the probe point definition. In addition, '@SRC' specifies a source file which has that function.
159It is also possible to specify a probe point by the source line number or lazy matching by using 'SRC:ALN' or 'SRC;PTN' syntax, where 'SRC' is the source file path, ':ALN' is the line number and ';PTN' is the lazy matching pattern.
160'ARG' specifies the arguments of this probe point, (see PROBE ARGUMENT).
156
157'EVENT' specifies the name of new event, if omitted, it will be set the name of the probed function. You can also specify a group name by 'GROUP', if omitted, set 'probe' is used for kprobe and 'probe_<bin>' is used for uprobe.
158Note that using existing group name can conflict with other events. Especially, using the group name reserved for kernel modules can hide embedded events in the
159modules.
160'FUNC' specifies a probed function name, and it may have one of the following options; '+OFFS' is the offset from function entry address in bytes, ':RLN' is the relative-line number from function entry line, and '%return' means that it probes function return. And ';PTN' means lazy matching pattern (see LAZY MATCHING). Note that ';PTN' must be the end of the probe point definition. In addition, '@SRC' specifies a source file which has that function.
161It is also possible to specify a probe point by the source line number or lazy matching by using 'SRC:ALN' or 'SRC;PTN' syntax, where 'SRC' is the source file path, ':ALN' is the line number and ';PTN' is the lazy matching pattern.
162'ARG' specifies the arguments of this probe point, (see PROBE ARGUMENT).
163'SDTEVENT' and 'PROVIDER' is the pre-defined event name which is defined by user SDT (Statically Defined Tracing) or the pre-cached probes with event name.
164Note that before using the SDT event, the target binary (on which SDT events are defined) must be scanned by linkperf:perf-buildid-cache[1] to make SDT events as cached events.
161
165
166For details of the SDT, see below.
167https://sourceware.org/gdb/onlinedocs/gdb/Static-Probe-Points.html
168
162PROBE ARGUMENT
163--------------
164Each probe argument follows below syntax.
165
166 [NAME=]LOCALVAR|$retval|%REG|@SYMBOL[:TYPE]
167
168'NAME' specifies the name of this argument (optional). You can use the name of local variable, local data structure member (e.g. var->field, var.field2), local array with fixed index (e.g. array[1], var->array[0], var->pointer[2]), or kprobe-tracer argument format (e.g. $retval, %ax, etc). Note that the name of this argument will be set as the last member name if you specify a local data structure member (e.g. field2 for 'var->field1.field2'.)
169'$vars' and '$params' special arguments are also available for NAME, '$vars' is expanded to the local variables (including function parameters) which can access at given probe point. '$params' is expanded to only the function parameters.

--- 62 unchanged lines hidden (view full) ---

232 ./perf probe -x /bin/zsh zfree or ./perf probe /bin/zsh zfree
233
234Add probes at malloc() function on libc
235
236 ./perf probe -x /lib/libc.so.6 malloc or ./perf probe /lib/libc.so.6 malloc
237
238SEE ALSO
239--------
169PROBE ARGUMENT
170--------------
171Each probe argument follows below syntax.
172
173 [NAME=]LOCALVAR|$retval|%REG|@SYMBOL[:TYPE]
174
175'NAME' specifies the name of this argument (optional). You can use the name of local variable, local data structure member (e.g. var->field, var.field2), local array with fixed index (e.g. array[1], var->array[0], var->pointer[2]), or kprobe-tracer argument format (e.g. $retval, %ax, etc). Note that the name of this argument will be set as the last member name if you specify a local data structure member (e.g. field2 for 'var->field1.field2'.)
176'$vars' and '$params' special arguments are also available for NAME, '$vars' is expanded to the local variables (including function parameters) which can access at given probe point. '$params' is expanded to only the function parameters.

--- 62 unchanged lines hidden (view full) ---

239 ./perf probe -x /bin/zsh zfree or ./perf probe /bin/zsh zfree
240
241Add probes at malloc() function on libc
242
243 ./perf probe -x /lib/libc.so.6 malloc or ./perf probe /lib/libc.so.6 malloc
244
245SEE ALSO
246--------
240linkperf:perf-trace[1], linkperf:perf-record[1]
247linkperf:perf-trace[1], linkperf:perf-record[1], linkperf:perf-buildid-cache[1]