hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/Documentation/trace/uprobetracer.rst
....@@ -18,12 +18,17 @@
1818 However unlike kprobe-event tracer, the uprobe event interface expects the
1919 user to calculate the offset of the probepoint in the object.
2020
21
+You can also use /sys/kernel/debug/tracing/dynamic_events instead of
22
+uprobe_events. That interface will provide unified access to other
23
+dynamic events too.
24
+
2125 Synopsis of uprobe_tracer
2226 -------------------------
2327 ::
2428
2529 p[:[GRP/]EVENT] PATH:OFFSET [FETCHARGS] : Set a uprobe
2630 r[:[GRP/]EVENT] PATH:OFFSET [FETCHARGS] : Set a return uprobe (uretprobe)
31
+ p[:[GRP/]EVENT] PATH:OFFSET%return [FETCHARGS] : Set a return uprobe (uretprobe)
2732 -:[GRP/]EVENT : Clear uprobe or uretprobe event
2833
2934 GRP : Group name. If omitted, "uprobes" is the default value.
....@@ -31,6 +36,7 @@
3136 on PATH+OFFSET.
3237 PATH : Path to an executable or a library.
3338 OFFSET : Offset where the probe is inserted.
39
+ OFFSET%return : Offset where the return probe is inserted.
3440
3541 FETCHARGS : Arguments. Each probe can have up to 128 args.
3642 %REG : Fetch register REG
....@@ -38,16 +44,19 @@
3844 @+OFFSET : Fetch memory at OFFSET (OFFSET from same file as PATH)
3945 $stackN : Fetch Nth entry of stack (N >= 0)
4046 $stack : Fetch stack address.
41
- $retval : Fetch return value.(*)
47
+ $retval : Fetch return value.(\*1)
4248 $comm : Fetch current task comm.
43
- +|-offs(FETCHARG) : Fetch memory at FETCHARG +|- offs address.(**)
49
+ +|-[u]OFFS(FETCHARG) : Fetch memory at FETCHARG +|- OFFS address.(\*2)(\*3)
50
+ \IMM : Store an immediate value to the argument.
4451 NAME=FETCHARG : Set NAME as the argument name of FETCHARG.
4552 FETCHARG:TYPE : Set TYPE as the type of FETCHARG. Currently, basic types
4653 (u8/u16/u32/u64/s8/s16/s32/s64), hexadecimal types
4754 (x8/x16/x32/x64), "string" and bitfield are supported.
4855
49
- (*) only for return probe.
50
- (**) this is useful for fetching a field of data structures.
56
+ (\*1) only for return probe.
57
+ (\*2) this is useful for fetching a field of data structures.
58
+ (\*3) Unlike kprobe event, "u" prefix will just be ignored, becuse uprobe
59
+ events can access only user-space memory.
5160
5261 Types
5362 -----
....@@ -69,10 +78,9 @@
6978
7079 Event Profiling
7180 ---------------
72
-You can check the total number of probe hits and probe miss-hits via
73
-/sys/kernel/debug/tracing/uprobe_profile.
74
-The first column is event name, the second is the number of probe hits,
75
-the third is the number of probe miss-hits.
81
+You can check the total number of probe hits per event via
82
+/sys/kernel/debug/tracing/uprobe_profile. The first column is the filename,
83
+the second is the event name, the third is the number of probe hits.
7684
7785 Usage examples
7886 --------------
....@@ -149,10 +157,15 @@
149157
150158 # echo 1 > events/uprobes/enable
151159
152
-Lets disable the event after sleeping for some time.
160
+Lets start tracing, sleep for some time and stop tracing.
153161 ::
154162
163
+ # echo 1 > tracing_on
155164 # sleep 20
165
+ # echo 0 > tracing_on
166
+
167
+Also, you can disable the event by::
168
+
156169 # echo 0 > events/uprobes/enable
157170
158171 And you can see the traced information via /sys/kernel/debug/tracing/trace.