€•¿gŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ&/translations/zh_CN/trace/uprobetracer”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/zh_TW/trace/uprobetracer”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/it_IT/trace/uprobetracer”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/ja_JP/trace/uprobetracer”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/ko_KR/trace/uprobetracer”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ&/translations/sp_SP/trace/uprobetracer”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ)Uprobe-tracer: Uprobe-based Event Tracing”h]”hŒ)Uprobe-tracer: Uprobe-based Event Tracing”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒ@/var/lib/git/docbuild/linux/Documentation/trace/uprobetracer.rst”h KubhŒ field_list”“”)”}”(hhh]”hŒfield”“”)”}”(hhh]”(hŒ field_name”“”)”}”(hŒAuthor”h]”hŒAuthor”…””}”(hhÃhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÁhh¾hŸh¶h KubhŒ field_body”“”)”}”(hŒSrikar Dronamraju ”h]”hŒ paragraph”“”)”}”(hŒSrikar Dronamraju”h]”hŒSrikar Dronamraju”…””}”(hhÙhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h KhhÓubah}”(h]”h ]”h"]”h$]”h&]”uh1hÑhh¾ubeh}”(h]”h ]”h"]”h$]”h&]”uh1h¼hŸh¶h Khh¹hžhubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒOverview”h]”hŒOverview”…””}”(hhühžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hhùhžhhŸh¶h K ubhØ)”}”(hŒŠUprobe based trace events are similar to kprobe based trace events. To enable this feature, build your kernel with CONFIG_UPROBE_EVENTS=y.”h]”hŒŠUprobe based trace events are similar to kprobe based trace events. To enable this feature, build your kernel with CONFIG_UPROBE_EVENTS=y.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K hhùhžhubhØ)”}”(hŒçSimilar to the kprobe-event tracer, this doesn't need to be activated via current_tracer. Instead of that, add probe points via /sys/kernel/tracing/uprobe_events, and enable it via /sys/kernel/tracing/events/uprobes//enable.”h]”hŒéSimilar to the kprobe-event tracer, this doesn’t need to be activated via current_tracer. Instead of that, add probe points via /sys/kernel/tracing/uprobe_events, and enable it via /sys/kernel/tracing/events/uprobes//enable.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K hhùhžhubhØ)”}”(hŒˆHowever unlike kprobe-event tracer, the uprobe event interface expects the user to calculate the offset of the probepoint in the object.”h]”hŒˆHowever unlike kprobe-event tracer, the uprobe event interface expects the user to calculate the offset of the probepoint in the object.”…””}”(hj&hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h KhhùhžhubhØ)”}”(hŒ•You can also use /sys/kernel/tracing/dynamic_events instead of uprobe_events. That interface will provide unified access to other dynamic events too.”h]”hŒ•You can also use /sys/kernel/tracing/dynamic_events instead of uprobe_events. That interface will provide unified access to other dynamic events too.”…””}”(hj4hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h Khhùhžhubeh}”(h]”Œoverview”ah ]”h"]”Œoverview”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K ubh¢)”}”(hhh]”(h§)”}”(hŒSynopsis of uprobe_tracer”h]”hŒSynopsis of uprobe_tracer”…””}”(hjMhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjJhžhhŸh¶h KubhŒ literal_block”“”)”}”(hXp[:[GRP/][EVENT]] PATH:OFFSET [FETCHARGS] : Set a uprobe r[:[GRP/][EVENT]] PATH:OFFSET [FETCHARGS] : Set a return uprobe (uretprobe) p[:[GRP/][EVENT]] PATH:OFFSET%return [FETCHARGS] : Set a return uprobe (uretprobe) -:[GRP/][EVENT] : Clear uprobe or uretprobe event GRP : Group name. If omitted, "uprobes" is the default value. EVENT : Event name. If omitted, the event name is generated based on PATH+OFFSET. PATH : Path to an executable or a library. OFFSET : Offset where the probe is inserted. OFFSET%return : Offset where the return probe is inserted. FETCHARGS : Arguments. Each probe can have up to 128 args. %REG : Fetch register REG @ADDR : Fetch memory at ADDR (ADDR should be in userspace) @+OFFSET : Fetch memory at OFFSET (OFFSET from same file as PATH) $stackN : Fetch Nth entry of stack (N >= 0) $stack : Fetch stack address. $retval : Fetch return value.(\*1) $comm : Fetch current task comm. +|-[u]OFFS(FETCHARG) : Fetch memory at FETCHARG +|- OFFS address.(\*2)(\*3) \IMM : Store an immediate value to the argument. NAME=FETCHARG : Set NAME as the argument name of FETCHARG. FETCHARG:TYPE : Set TYPE as the type of FETCHARG. Currently, basic types (u8/u16/u32/u64/s8/s16/s32/s64), hexadecimal types (x8/x16/x32/x64), "string" and bitfield are supported. (\*1) only for return probe. (\*2) this is useful for fetching a field of data structures. (\*3) Unlike kprobe event, "u" prefix will just be ignored, because uprobe events can access only user-space memory.”h]”hXp[:[GRP/][EVENT]] PATH:OFFSET [FETCHARGS] : Set a uprobe r[:[GRP/][EVENT]] PATH:OFFSET [FETCHARGS] : Set a return uprobe (uretprobe) p[:[GRP/][EVENT]] PATH:OFFSET%return [FETCHARGS] : Set a return uprobe (uretprobe) -:[GRP/][EVENT] : Clear uprobe or uretprobe event GRP : Group name. If omitted, "uprobes" is the default value. EVENT : Event name. If omitted, the event name is generated based on PATH+OFFSET. PATH : Path to an executable or a library. OFFSET : Offset where the probe is inserted. OFFSET%return : Offset where the return probe is inserted. FETCHARGS : Arguments. Each probe can have up to 128 args. %REG : Fetch register REG @ADDR : Fetch memory at ADDR (ADDR should be in userspace) @+OFFSET : Fetch memory at OFFSET (OFFSET from same file as PATH) $stackN : Fetch Nth entry of stack (N >= 0) $stack : Fetch stack address. $retval : Fetch return value.(\*1) $comm : Fetch current task comm. +|-[u]OFFS(FETCHARG) : Fetch memory at FETCHARG +|- OFFS address.(\*2)(\*3) \IMM : Store an immediate value to the argument. NAME=FETCHARG : Set NAME as the argument name of FETCHARG. FETCHARG:TYPE : Set TYPE as the type of FETCHARG. Currently, basic types (u8/u16/u32/u64/s8/s16/s32/s64), hexadecimal types (x8/x16/x32/x64), "string" and bitfield are supported. (\*1) only for return probe. (\*2) this is useful for fetching a field of data structures. (\*3) Unlike kprobe event, "u" prefix will just be ignored, because uprobe events can access only user-space memory.”…””}”hj]sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j[hŸh¶h KhjJhžhubeh}”(h]”Œsynopsis-of-uprobe-tracer”ah ]”h"]”Œsynopsis of uprobe_tracer”ah$]”h&]”uh1h¡hh£hžhhŸh¶h Kubh¢)”}”(hhh]”(h§)”}”(hŒTypes”h]”hŒTypes”…””}”(hjxhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjuhžhhŸh¶h K>ubhØ)”}”(hXgSeveral types are supported for fetch-args. Uprobe tracer will access memory by given type. Prefix 's' and 'u' means those types are signed and unsigned respectively. 'x' prefix implies it is unsigned. Traced arguments are shown in decimal ('s' and 'u') or hexadecimal ('x'). Without type casting, 'x32' or 'x64' is used depends on the architecture (e.g. x86-32 uses x32, and x86-64 uses x64). String type is a special type, which fetches a "null-terminated" string from user space. Bitfield is another special type, which takes 3 parameters, bit-width, bit- offset, and container-size (usually 32). The syntax is::”h]”hXŠSeveral types are supported for fetch-args. Uprobe tracer will access memory by given type. Prefix ‘s’ and ‘u’ means those types are signed and unsigned respectively. ‘x’ prefix implies it is unsigned. Traced arguments are shown in decimal (‘s’ and ‘u’) or hexadecimal (‘x’). Without type casting, ‘x32’ or ‘x64’ is used depends on the architecture (e.g. x86-32 uses x32, and x86-64 uses x64). String type is a special type, which fetches a “null-terminated†string from user space. Bitfield is another special type, which takes 3 parameters, bit-width, bit- offset, and container-size (usually 32). The syntax is:”…””}”(hj†hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K?hjuhžhubj\)”}”(hŒ*b@/”h]”hŒ*b@/”…””}”hj”sbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h KJhjuhžhubhØ)”}”(hŒCFor $comm, the default type is "string"; any other type is invalid.”h]”hŒGFor $comm, the default type is “stringâ€; any other type is invalid.”…””}”(hj¢hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h KLhjuhžhubeh}”(h]”Œtypes”ah ]”h"]”Œtypes”ah$]”h&]”uh1h¡hh£hžhhŸh¶h K>ubh¢)”}”(hhh]”(h§)”}”(hŒEvent Profiling”h]”hŒEvent Profiling”…””}”(hj»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hj¸hžhhŸh¶h KPubhØ)”}”(hŒÅYou can check the total number of probe hits per event via /sys/kernel/tracing/uprobe_profile. The first column is the filename, the second is the event name, the third is the number of probe hits.”h]”hŒÅYou can check the total number of probe hits per event via /sys/kernel/tracing/uprobe_profile. The first column is the filename, the second is the event name, the third is the number of probe hits.”…””}”(hjÉhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h KQhj¸hžhubeh}”(h]”Œevent-profiling”ah ]”h"]”Œevent profiling”ah$]”h&]”uh1h¡hh£hžhhŸh¶h KPubh¢)”}”(hhh]”(h§)”}”(hŒUsage examples”h]”hŒUsage examples”…””}”(hjâhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hjßhžhhŸh¶h KVubhŒ block_quote”“”)”}”(hXJ* Add a probe as a new uprobe event, write a new definition to uprobe_events as below (sets a uprobe at an offset of 0x4245c0 in the executable /bin/bash):: echo 'p /bin/bash:0x4245c0' > /sys/kernel/tracing/uprobe_events * Add a probe as a new uretprobe event:: echo 'r /bin/bash:0x4245c0' > /sys/kernel/tracing/uprobe_events * Unset registered event:: echo '-:p_bash_0x4245c0' >> /sys/kernel/tracing/uprobe_events * Print out the events that are registered:: cat /sys/kernel/tracing/uprobe_events * Clear all events:: echo > /sys/kernel/tracing/uprobe_events ”h]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒÝAdd a probe as a new uprobe event, write a new definition to uprobe_events as below (sets a uprobe at an offset of 0x4245c0 in the executable /bin/bash):: echo 'p /bin/bash:0x4245c0' > /sys/kernel/tracing/uprobe_events ”h]”(hØ)”}”(hŒšAdd a probe as a new uprobe event, write a new definition to uprobe_events as below (sets a uprobe at an offset of 0x4245c0 in the executable /bin/bash)::”h]”hŒ™Add a probe as a new uprobe event, write a new definition to uprobe_events as below (sets a uprobe at an offset of 0x4245c0 in the executable /bin/bash):”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h KWhjýubj\)”}”(hŒ?echo 'p /bin/bash:0x4245c0' > /sys/kernel/tracing/uprobe_events”h]”hŒ?echo 'p /bin/bash:0x4245c0' > /sys/kernel/tracing/uprobe_events”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h KZhjýubeh}”(h]”h ]”h"]”h$]”h&]”uh1jûhjøubjü)”}”(hŒiAdd a probe as a new uretprobe event:: echo 'r /bin/bash:0x4245c0' > /sys/kernel/tracing/uprobe_events ”h]”(hØ)”}”(hŒ&Add a probe as a new uretprobe event::”h]”hŒ%Add a probe as a new uretprobe event:”…””}”(hj'hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K\hj#ubj\)”}”(hŒ?echo 'r /bin/bash:0x4245c0' > /sys/kernel/tracing/uprobe_events”h]”hŒ?echo 'r /bin/bash:0x4245c0' > /sys/kernel/tracing/uprobe_events”…””}”hj5sbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h K^hj#ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jûhjøubjü)”}”(hŒYUnset registered event:: echo '-:p_bash_0x4245c0' >> /sys/kernel/tracing/uprobe_events ”h]”(hØ)”}”(hŒUnset registered event::”h]”hŒUnset registered event:”…””}”(hjMhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K`hjIubj\)”}”(hŒ=echo '-:p_bash_0x4245c0' >> /sys/kernel/tracing/uprobe_events”h]”hŒ=echo '-:p_bash_0x4245c0' >> /sys/kernel/tracing/uprobe_events”…””}”hj[sbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h KbhjIubeh}”(h]”h ]”h"]”h$]”h&]”uh1jûhjøubjü)”}”(hŒSPrint out the events that are registered:: cat /sys/kernel/tracing/uprobe_events ”h]”(hØ)”}”(hŒ*Print out the events that are registered::”h]”hŒ)Print out the events that are registered:”…””}”(hjshžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h Kdhjoubj\)”}”(hŒ%cat /sys/kernel/tracing/uprobe_events”h]”hŒ%cat /sys/kernel/tracing/uprobe_events”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h Kfhjoubeh}”(h]”h ]”h"]”h$]”h&]”uh1jûhjøubjü)”}”(hŒ>Clear all events:: echo > /sys/kernel/tracing/uprobe_events ”h]”(hØ)”}”(hŒClear all events::”h]”hŒClear all events:”…””}”(hj™hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h Khhj•ubj\)”}”(hŒ(echo > /sys/kernel/tracing/uprobe_events”h]”hŒ(echo > /sys/kernel/tracing/uprobe_events”…””}”hj§sbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h Kjhj•ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jûhjøubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1jöhŸh¶h KWhjòubah}”(h]”h ]”h"]”h$]”h&]”uh1jðhŸh¶h KWhjßhžhubhØ)”}”(hŒ‹Following example shows how to dump the instruction pointer and %ax register at the probed text address. Probe zfree function in /bin/zsh::”h]”hŒŠFollowing example shows how to dump the instruction pointer and %ax register at the probed text address. Probe zfree function in /bin/zsh:”…””}”(hjÉhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h Klhjßhžhubj\)”}”(hŒò# cd /sys/kernel/tracing/ # cat /proc/`pgrep zsh`/maps | grep /bin/zsh | grep r-xp 00400000-0048a000 r-xp 00000000 08:03 130904 /bin/zsh # objdump -T /bin/zsh | grep -w zfree 0000000000446420 g DF .text 0000000000000012 Base zfree”h]”hŒò# cd /sys/kernel/tracing/ # cat /proc/`pgrep zsh`/maps | grep /bin/zsh | grep r-xp 00400000-0048a000 r-xp 00000000 08:03 130904 /bin/zsh # objdump -T /bin/zsh | grep -w zfree 0000000000446420 g DF .text 0000000000000012 Base zfree”…””}”hj×sbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h KohjßhžhubhØ)”}”(hŒv0x46420 is the offset of zfree in object /bin/zsh that is loaded at 0x00400000. Hence the command to uprobe would be::”h]”hŒu0x46420 is the offset of zfree in object /bin/zsh that is loaded at 0x00400000. Hence the command to uprobe would be:”…””}”(hjåhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h Kuhjßhžhubj\)”}”(hŒ?# echo 'p:zfree_entry /bin/zsh:0x46420 %ip %ax' > uprobe_events”h]”hŒ?# echo 'p:zfree_entry /bin/zsh:0x46420 %ip %ax' > uprobe_events”…””}”hjósbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h KxhjßhžhubhØ)”}”(hŒ)And the same for the uretprobe would be::”h]”hŒ(And the same for the uretprobe would be:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h Kzhjßhžhubj\)”}”(hŒ?# echo 'r:zfree_exit /bin/zsh:0x46420 %ip %ax' >> uprobe_events”h]”hŒ?# echo 'r:zfree_exit /bin/zsh:0x46420 %ip %ax' >> uprobe_events”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h K|hjßhžhubhŒnote”“”)”}”(hŒMUser has to explicitly calculate the offset of the probe-point in the object.”h]”hØ)”}”(hŒMUser has to explicitly calculate the offset of the probe-point in the object.”h]”hŒMUser has to explicitly calculate the offset of the probe-point in the object.”…””}”(hj#hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K~hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjßhžhhŸh¶h NubhØ)”}”(hŒRWe can see the events that are registered by looking at the uprobe_events file. ::”h]”hŒOWe can see the events that are registered by looking at the uprobe_events file.”…””}”(hj7hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h Khjßhžhubj\)”}”(hŒŠ# cat uprobe_events p:uprobes/zfree_entry /bin/zsh:0x00046420 arg1=%ip arg2=%ax r:uprobes/zfree_exit /bin/zsh:0x00046420 arg1=%ip arg2=%ax”h]”hŒŠ# cat uprobe_events p:uprobes/zfree_entry /bin/zsh:0x00046420 arg1=%ip arg2=%ax r:uprobes/zfree_exit /bin/zsh:0x00046420 arg1=%ip arg2=%ax”…””}”hjEsbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h K„hjßhžhubhØ)”}”(hŒVFormat of events can be seen by viewing the file events/uprobes/zfree_entry/format. ::”h]”hŒSFormat of events can be seen by viewing the file events/uprobes/zfree_entry/format.”…””}”(hjShžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h Kˆhjßhžhubj\)”}”(hX÷# cat events/uprobes/zfree_entry/format name: zfree_entry ID: 922 format: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:int common_padding; offset:8; size:4; signed:1; field:unsigned long __probe_ip; offset:12; size:4; signed:0; field:u32 arg1; offset:16; size:4; signed:0; field:u32 arg2; offset:20; size:4; signed:0; print fmt: "(%lx) arg1=%lx arg2=%lx", REC->__probe_ip, REC->arg1, REC->arg2”h]”hX÷# cat events/uprobes/zfree_entry/format name: zfree_entry ID: 922 format: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:int common_padding; offset:8; size:4; signed:1; field:unsigned long __probe_ip; offset:12; size:4; signed:0; field:u32 arg1; offset:16; size:4; signed:0; field:u32 arg2; offset:20; size:4; signed:0; print fmt: "(%lx) arg1=%lx arg2=%lx", REC->__probe_ip, REC->arg1, REC->arg2”…””}”hjasbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h K‹hjßhžhubhØ)”}”(hŒoRight after definition, each event is disabled by default. For tracing these events, you need to enable it by::”h]”hŒnRight after definition, each event is disabled by default. For tracing these events, you need to enable it by:”…””}”(hjohžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K›hjßhžhubj\)”}”(hŒ # echo 1 > events/uprobes/enable”h]”hŒ # echo 1 > events/uprobes/enable”…””}”hj}sbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h KžhjßhžhubhØ)”}”(hŒ tracing_on # sleep 20 # echo 0 > tracing_on”h]”hŒ6# echo 1 > tracing_on # sleep 20 # echo 0 > tracing_on”…””}”hj™sbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h K£hjßhžhubhØ)”}”(hŒ$Also, you can disable the event by::”h]”hŒ#Also, you can disable the event by:”…””}”(hj§hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K§hjßhžhubj\)”}”(hŒ # echo 0 > events/uprobes/enable”h]”hŒ # echo 0 > events/uprobes/enable”…””}”hjµsbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h K©hjßhžhubhØ)”}”(hŒHAnd you can see the traced information via /sys/kernel/tracing/trace. ::”h]”hŒEAnd you can see the traced information via /sys/kernel/tracing/trace.”…””}”(hjÃhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K«hjßhžhubj\)”}”(hXõ# cat trace # tracer: nop # # TASK-PID CPU# TIMESTAMP FUNCTION # | | | | | zsh-24842 [006] 258544.995456: zfree_entry: (0x446420) arg1=446420 arg2=79 zsh-24842 [007] 258545.000270: zfree_exit: (0x446540 <- 0x446420) arg1=446540 arg2=0 zsh-24842 [002] 258545.043929: zfree_entry: (0x446420) arg1=446420 arg2=79 zsh-24842 [004] 258547.046129: zfree_exit: (0x446540 <- 0x446420) arg1=446540 arg2=0”h]”hXõ# cat trace # tracer: nop # # TASK-PID CPU# TIMESTAMP FUNCTION # | | | | | zsh-24842 [006] 258544.995456: zfree_entry: (0x446420) arg1=446420 arg2=79 zsh-24842 [007] 258545.000270: zfree_exit: (0x446540 <- 0x446420) arg1=446540 arg2=0 zsh-24842 [002] 258545.043929: zfree_entry: (0x446420) arg1=446420 arg2=79 zsh-24842 [004] 258547.046129: zfree_exit: (0x446540 <- 0x446420) arg1=446540 arg2=0”…””}”hjÑsbah}”(h]”h ]”h"]”h$]”h&]”jkjluh1j[hŸh¶h K®hjßhžhubhØ)”}”(hŒÎOutput shows us uprobe was triggered for a pid 24842 with ip being 0x446420 and contents of ax register being 79. And uretprobe was triggered with ip at 0x446540 with counterpart function entry at 0x446420.”h]”hŒÎOutput shows us uprobe was triggered for a pid 24842 with ip being 0x446420 and contents of ax register being 79. And uretprobe was triggered with ip at 0x446540 with counterpart function entry at 0x446420.”…””}”(hjßhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hŸh¶h K¸hjßhžhubeh}”(h]”Œusage-examples”ah ]”h"]”Œusage examples”ah$]”h&]”uh1h¡hh£hžhhŸh¶h KVubeh}”(h]”Œ(uprobe-tracer-uprobe-based-event-tracing”ah ]”h"]”Œ)uprobe-tracer: uprobe-based event tracing”ah$]”h&]”uh1h¡hhhžhhŸh¶h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h¶uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¦NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h¶Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(júj÷jGjDjrjojµj²jÜjÙjòjïuŒ nametypes”}”(jú‰jG‰jr‰jµ‰j܉jò‰uh}”(j÷h£jDhùjojJj²jujÙj¸jïjßuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”(hŒsystem_message”“”)”}”(hhh]”hØ)”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…””}”(hj‡hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hj„ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œline”K‚Œsource”h¶uh1j‚hjßhžhhŸh¶h K‚ubjƒ)”}”(hhh]”hØ)”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…””}”(hj£hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hj ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jŒline”K‰Œsource”h¶uh1j‚hjßhžhhŸh¶h K‰ubjƒ)”}”(hhh]”hØ)”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…””}”(hj¾hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hj»ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jŒline”K¡Œsource”h¶uh1j‚hjßhžhhŸh¶h K¡ubjƒ)”}”(hhh]”hØ)”}”(hŒfPossible title underline, too short for the title. Treating it as ordinary text because it's so short.”h]”hŒhPossible title underline, too short for the title. Treating it as ordinary text because it’s so short.”…””}”(hjÙhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h×hjÖubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jŒline”K¬Œsource”h¶uh1j‚hjßhžhhŸh¶h K¬ubeŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.