€•‹Œ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/eprobetrace”Œ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/eprobetrace”Œ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/eprobetrace”Œ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/eprobetrace”Œ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/eprobetrace”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/pt_BR/trace/eprobetrace”Œ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/eprobetrace”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ?/var/lib/git/docbuild/linux/Documentation/trace/eprobetrace.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ"Eprobe - Event-based Probe Tracing”h]”hŒ"Eprobe - Event-based Probe Tracing”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇ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Œ%Steven Rostedt ”h]”hŒ paragraph”“”)”}”(hŒ$Steven Rostedt ”h]”(hŒSteven Rostedt <”…””}”(hhÿh²hh³Nh´NubhŒ reference”“”)”}”(hŒrostedt@goodmis.org”h]”hŒrostedt@goodmis.org”…””}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:rostedt@goodmis.org”uh1jhhÿubhŒ>”…””}”(hhÿh²hh³Nh´Nubeh}”(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Œ bullet_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hŒWritten for v6.17 ”h]”hþ)”}”(hŒWritten for v6.17”h]”hŒWritten for v6.17”…””}”(hj@h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K hj<ubah}”(h]”h ]”h"]”h$]”h&]”uh1j:hj7h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j5h³hÇh´K hhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒOverview”h]”hŒOverview”…””}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj\h²hh³hÇh´K ubhþ)”}”(hŒ®Eprobes are dynamic events that are placed on existing events to either dereference a field that is a pointer, or simply to limit what fields are recorded in the trace event.”h]”hŒ®Eprobes are dynamic events that are placed on existing events to either dereference a field that is a pointer, or simply to limit what fields are recorded in the trace event.”…””}”(hjmh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khj\h²hubhþ)”}”(hŒiEprobes depend on kprobe events so to enable this feature, build your kernel with CONFIG_EPROBE_EVENTS=y.”h]”hŒiEprobes depend on kprobe events so to enable this feature, build your kernel with CONFIG_EPROBE_EVENTS=y.”…””}”(hj{h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khj\h²hubhþ)”}”(hŒDEprobes are created via the /sys/kernel/tracing/dynamic_events file.”h]”hŒDEprobes are created via the /sys/kernel/tracing/dynamic_events file.”…””}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Khj\h²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒSynopsis of eprobe_events”h]”hŒSynopsis of eprobe_events”…””}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj—h²hh³hÇh´KubhŒ literal_block”“”)”}”(hX  e[:[EGRP/][EEVENT]] GRP.EVENT [FETCHARGS] : Set a probe -:[EGRP/][EEVENT] : Clear a probe EGRP : Group name of the new event. If omitted, use "eprobes" for it. EEVENT : Event name. If omitted, the event name is generated and will be the same event name as the event it attached to. GRP : Group name of the event to attach to. EVENT : Event name of the event to attach to. FETCHARGS : Arguments. Each probe can have up to 128 args. $FIELD : Fetch the value of the event field called FIELD. @ADDR : Fetch memory at ADDR (ADDR should be in kernel) @SYM[+|-offs] : Fetch memory at SYM +|- offs (SYM should be a data symbol) $comm : Fetch current task comm. +|-[u]OFFS(FETCHARG) : Fetch memory at FETCHARG +|- OFFS address.(\*3)(\*4) \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), VFS layer common type(%pd/%pD), "char", "string", "ustring", "symbol", "symstr" and "bitfield" are supported.”h]”hX  e[:[EGRP/][EEVENT]] GRP.EVENT [FETCHARGS] : Set a probe -:[EGRP/][EEVENT] : Clear a probe EGRP : Group name of the new event. If omitted, use "eprobes" for it. EEVENT : Event name. If omitted, the event name is generated and will be the same event name as the event it attached to. GRP : Group name of the event to attach to. EVENT : Event name of the event to attach to. FETCHARGS : Arguments. Each probe can have up to 128 args. $FIELD : Fetch the value of the event field called FIELD. @ADDR : Fetch memory at ADDR (ADDR should be in kernel) @SYM[+|-offs] : Fetch memory at SYM +|- offs (SYM should be a data symbol) $comm : Fetch current task comm. +|-[u]OFFS(FETCHARG) : Fetch memory at FETCHARG +|- OFFS address.(\*3)(\*4) \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), VFS layer common type(%pd/%pD), "char", "string", "ustring", "symbol", "symstr" and "bitfield" are supported.”…””}”hjªsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´Khj—h²hubeh}”(h]”Œsynopsis-of-eprobe-events”ah ]”h"]”Œsynopsis of eprobe_events”ah$]”h&]”uh1hÈhj\h²hh³hÇh´KubhÉ)”}”(hhh]”(hÎ)”}”(hŒTypes”h]”hŒTypes”…””}”(hjÃh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjÀh²hh³hÇh´K3ubhþ)”}”(hŒmThe FETCHARGS above is very similar to the kprobe events as described in Documentation/trace/kprobetrace.rst.”h]”hŒmThe FETCHARGS above is very similar to the kprobe events as described in Documentation/trace/kprobetrace.rst.”…””}”(hjÑh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K4hjÀh²hubhþ)”}”(hŒýThe difference between eprobes and kprobes FETCHARGS is that eprobes has a $FIELD command that returns the content of the event field of the event that is attached. Eprobes do not have access to registers, stacks and function arguments that kprobes has.”h]”hŒýThe difference between eprobes and kprobes FETCHARGS is that eprobes has a $FIELD command that returns the content of the event field of the event that is attached. Eprobes do not have access to registers, stacks and function arguments that kprobes has.”…””}”(hjßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K7hjÀh²hubhþ)”}”(hŒoIf a field argument is a pointer, it may be dereferenced just like a memory address using the FETCHARGS syntax.”h]”hŒoIf a field argument is a pointer, it may be dereferenced just like a memory address using the FETCHARGS syntax.”…””}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K> /sys/kernel/tracing/dynamic_events # echo 1 > /sys/kernel/tracing/events/sched/switch/enable # cat /sys/kernel/tracing/trace # tracer: nop # # entries-in-buffer/entries-written: 2721/2721 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | sshd-session-1082 [004] d..4. 5041.239906: switch: (sched.sched_switch) prev=1082 next=0 bash-1085 [001] d..4. 5041.240198: switch: (sched.sched_switch) prev=1085 next=141 kworker/u34:5-141 [001] d..4. 5041.240259: switch: (sched.sched_switch) prev=141 next=1085 -0 [004] d..4. 5041.240354: switch: (sched.sched_switch) prev=0 next=1082 bash-1085 [001] d..4. 5041.240385: switch: (sched.sched_switch) prev=1085 next=141 kworker/u34:5-141 [001] d..4. 5041.240410: switch: (sched.sched_switch) prev=141 next=1085 bash-1085 [001] d..4. 5041.240478: switch: (sched.sched_switch) prev=1085 next=0 sshd-session-1082 [004] d..4. 5041.240526: switch: (sched.sched_switch) prev=1082 next=0 -0 [001] d..4. 5041.247524: switch: (sched.sched_switch) prev=0 next=90 -0 [002] d..4. 5041.247545: switch: (sched.sched_switch) prev=0 next=16 kworker/1:1-90 [001] d..4. 5041.247580: switch: (sched.sched_switch) prev=90 next=0 rcu_sched-16 [002] d..4. 5041.247591: switch: (sched.sched_switch) prev=16 next=0 -0 [002] d..4. 5041.257536: switch: (sched.sched_switch) prev=0 next=16 rcu_sched-16 [002] d..4. 5041.257573: switch: (sched.sched_switch) prev=16 next=0”h]”hX$# echo 'e:sched/switch sched.sched_switch prev=$prev_pid:u32 next=$next_pid:u32' >> /sys/kernel/tracing/dynamic_events # echo 1 > /sys/kernel/tracing/events/sched/switch/enable # cat /sys/kernel/tracing/trace # tracer: nop # # entries-in-buffer/entries-written: 2721/2721 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | sshd-session-1082 [004] d..4. 5041.239906: switch: (sched.sched_switch) prev=1082 next=0 bash-1085 [001] d..4. 5041.240198: switch: (sched.sched_switch) prev=1085 next=141 kworker/u34:5-141 [001] d..4. 5041.240259: switch: (sched.sched_switch) prev=141 next=1085 -0 [004] d..4. 5041.240354: switch: (sched.sched_switch) prev=0 next=1082 bash-1085 [001] d..4. 5041.240385: switch: (sched.sched_switch) prev=1085 next=141 kworker/u34:5-141 [001] d..4. 5041.240410: switch: (sched.sched_switch) prev=141 next=1085 bash-1085 [001] d..4. 5041.240478: switch: (sched.sched_switch) prev=1085 next=0 sshd-session-1082 [004] d..4. 5041.240526: switch: (sched.sched_switch) prev=1082 next=0 -0 [001] d..4. 5041.247524: switch: (sched.sched_switch) prev=0 next=90 -0 [002] d..4. 5041.247545: switch: (sched.sched_switch) prev=0 next=16 kworker/1:1-90 [001] d..4. 5041.247580: switch: (sched.sched_switch) prev=90 next=0 rcu_sched-16 [002] d..4. 5041.247591: switch: (sched.sched_switch) prev=16 next=0 -0 [002] d..4. 5041.257536: switch: (sched.sched_switch) prev=0 next=16 rcu_sched-16 [002] d..4. 5041.257573: switch: (sched.sched_switch) prev=16 next=0”…””}”hjŒsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´KihjCh²hubhþ)”}”(hŒpNote, without adding the "u32" after the prev_pid and next_pid, the values would default showing in hexadecimal.”h]”hŒtNote, without adding the “u32†after the prev_pid and next_pid, the values would default showing in hexadecimal.”…””}”(hjšh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KˆhjCh²hubeh}”(h]”Œ example-1”ah ]”h"]”Œ example 1”ah$]”h&]”uh1hÈhj2h²hh³hÇh´KKubhÉ)”}”(hhh]”(hÎ)”}”(hŒ Example 2”h]”hŒ Example 2”…””}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj°h²hh³hÇh´KŒubhþ)”}”(hX]If a specific system call is to be recorded but the syscalls events are not enabled, the raw_syscalls can still be used (syscalls are system call events are not normal events, but are created from the raw_syscalls events within the kernel). In order to trace the openat system call, one can create an event probe on top of the raw_syscalls event: ::”h]”hXZIf a specific system call is to be recorded but the syscalls events are not enabled, the raw_syscalls can still be used (syscalls are system call events are not normal events, but are created from the raw_syscalls events within the kernel). In order to trace the openat system call, one can create an event probe on top of the raw_syscalls event:”…””}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KŽhj°h²hubj©)”}”(hX»# cd /sys/kernel/tracing # cat events/raw_syscalls/sys_enter/format name: sys_enter ID: 395 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:long id; offset:8; size:8; signed:1; field:unsigned long args[6]; offset:16; size:48; signed:0; print fmt: "NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)", REC->id, REC->args[0], REC->args[1], REC->args[2], REC->args[3], REC->args[4], REC->args[5]”h]”hX»# cd /sys/kernel/tracing # cat events/raw_syscalls/sys_enter/format name: sys_enter ID: 395 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:long id; offset:8; size:8; signed:1; field:unsigned long args[6]; offset:16; size:48; signed:0; print fmt: "NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)", REC->id, REC->args[0], REC->args[1], REC->args[2], REC->args[3], REC->args[4], REC->args[5]”…””}”hjÏsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´K•hj°h²hubhþ)”}”(hŒ.From the source code, the sys_openat() has: ::”h]”hŒ+From the source code, the sys_openat() has:”…””}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K¤hj°h²hubj©)”}”(hŒ‰int sys_openat(int dirfd, const char *path, int flags, mode_t mode) { return my_syscall4(__NR_openat, dirfd, path, flags, mode); }”h]”hŒ‰int sys_openat(int dirfd, const char *path, int flags, mode_t mode) { return my_syscall4(__NR_openat, dirfd, path, flags, mode); }”…””}”hjësbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´K§hj°h²hubhþ)”}”(hŒ@The path is the second parameter, and that is what is wanted. ::”h]”hŒ=The path is the second parameter, and that is what is wanted.”…””}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K¬hj°h²hubj©)”}”(hŒ\# echo 'e:openat raw_syscalls.sys_enter nr=$id filename=+8($args):ustring' >> dynamic_events”h]”hŒ\# echo 'e:openat raw_syscalls.sys_enter nr=$id filename=+8($args):ustring' >> dynamic_events”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´K¯hj°h²hubhþ)”}”(hŒsThis is being run on x86_64 where the word size is 8 bytes and the openat system call __NR_openat is set at 257. ::”h]”hŒpThis is being run on x86_64 where the word size is 8 bytes and the openat system call __NR_openat is set at 257.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K±hj°h²hubj©)”}”(hŒ1# echo 'nr == 257' > events/eprobes/openat/filter”h]”hŒ1# echo 'nr == 257' > events/eprobes/openat/filter”…””}”hj#sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´Kµhj°h²hubhþ)”}”(hŒ.Now enable the event and look at the trace. ::”h]”hŒ+Now enable the event and look at the trace.”…””}”(hj1h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´K·hj°h²hubj©)”}”(hXï# echo 1 > events/eprobes/openat/enable # cat trace # tracer: nop # # entries-in-buffer/entries-written: 4/4 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | cat-1298 [003] ...2. 2060.875970: openat: (raw_syscalls.sys_enter) nr=0x101 filename=(fault) cat-1298 [003] ...2. 2060.876197: openat: (raw_syscalls.sys_enter) nr=0x101 filename=(fault) cat-1298 [003] ...2. 2060.879126: openat: (raw_syscalls.sys_enter) nr=0x101 filename=(fault) cat-1298 [003] ...2. 2060.879639: openat: (raw_syscalls.sys_enter) nr=0x101 filename=(fault)”h]”hXï# echo 1 > events/eprobes/openat/enable # cat trace # tracer: nop # # entries-in-buffer/entries-written: 4/4 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | cat-1298 [003] ...2. 2060.875970: openat: (raw_syscalls.sys_enter) nr=0x101 filename=(fault) cat-1298 [003] ...2. 2060.876197: openat: (raw_syscalls.sys_enter) nr=0x101 filename=(fault) cat-1298 [003] ...2. 2060.879126: openat: (raw_syscalls.sys_enter) nr=0x101 filename=(fault) cat-1298 [003] ...2. 2060.879639: openat: (raw_syscalls.sys_enter) nr=0x101 filename=(fault)”…””}”hj?sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´Kºhj°h²hubhþ)”}”(hXThe filename shows "(fault)". This is likely because the filename has not been pulled into memory yet and currently trace events cannot fault in memory that is not present. When an eprobe tries to read memory that has not been faulted in yet, it will show the "(fault)" text.”h]”hXThe filename shows “(fault)â€. This is likely because the filename has not been pulled into memory yet and currently trace events cannot fault in memory that is not present. When an eprobe tries to read memory that has not been faulted in yet, it will show the “(fault)†text.”…””}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÎhj°h²hubhþ)”}”(hXTo get around this, as the kernel will likely pull in this filename and make it present, attaching it to a synthetic event that can pass the address of the filename from the entry of the event to the end of the event, this can be used to show the filename when the system call returns.”h]”hXTo get around this, as the kernel will likely pull in this filename and make it present, attaching it to a synthetic event that can pass the address of the filename from the entry of the event to the end of the event, this can be used to show the filename when the system call returns.”…””}”(hj[h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÓhj°h²hubhþ)”}”(hŒRemove the old eprobe::”h]”hŒRemove the old eprobe:”…””}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KØhj°h²hubj©)”}”(hŒK# echo 1 > events/eprobes/openat/enable # echo '-:openat' >> dynamic_events”h]”hŒK# echo 1 > events/eprobes/openat/enable # echo '-:openat' >> dynamic_events”…””}”hjwsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´KÚhj°h²hubhþ)”}”(hŒEThis time make an eprobe where the address of the filename is saved::”h]”hŒDThis time make an eprobe where the address of the filename is saved:”…””}”(hj…h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´KÝhj°h²hubj©)”}”(hŒ^# echo 'e:openat_start raw_syscalls.sys_enter nr=$id filename=+8($args):x64' >> dynamic_events”h]”hŒ^# echo 'e:openat_start raw_syscalls.sys_enter nr=$id filename=+8($args):x64' >> dynamic_events”…””}”hj“sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´Kßhj°h²hubhþ)”}”(hŒZCreate a synthetic event that passes the address of the filename to the end of the event::”h]”hŒYCreate a synthetic event that passes the address of the filename to the end of the event:”…””}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Káhj°h²hubj©)”}”(hX# echo 's:filename u64 file' >> dynamic_events # echo 'hist:keys=common_pid:f=filename if nr == 257' > events/eprobes/openat_start/trigger # echo 'hist:keys=common_pid:file=$f:onmatch(eprobes.openat_start).trace(filename,$file) if id == 257' > events/raw_syscalls/sys_exit/trigger”h]”hX# echo 's:filename u64 file' >> dynamic_events # echo 'hist:keys=common_pid:f=filename if nr == 257' > events/eprobes/openat_start/trigger # echo 'hist:keys=common_pid:file=$f:onmatch(eprobes.openat_start).trace(filename,$file) if id == 257' > events/raw_syscalls/sys_exit/trigger”…””}”hj¯sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´Kähj°h²hubhþ)”}”(hŒšNow that the address of the filename has been passed to the end of the system call, create another eprobe to attach to the exit event to show the string::”h]”hŒ™Now that the address of the filename has been passed to the end of the system call, create another eprobe to attach to the exit event to show the string:”…””}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Kèhj°h²hubj©)”}”(hXK# echo 'e:openat synthetic.filename filename=+0($file):ustring' >> dynamic_events # echo 1 > events/eprobes/openat/enable # cat trace # tracer: nop # # entries-in-buffer/entries-written: 4/4 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | cat-1331 [001] ...5. 2944.787977: openat: (synthetic.filename) filename="/etc/ld.so.cache" cat-1331 [001] ...5. 2944.788480: openat: (synthetic.filename) filename="/lib/x86_64-linux-gnu/libc.so.6" cat-1331 [001] ...5. 2944.793426: openat: (synthetic.filename) filename="/usr/lib/locale/locale-archive" cat-1331 [001] ...5. 2944.831362: openat: (synthetic.filename) filename="trace"”h]”hXK# echo 'e:openat synthetic.filename filename=+0($file):ustring' >> dynamic_events # echo 1 > events/eprobes/openat/enable # cat trace # tracer: nop # # entries-in-buffer/entries-written: 4/4 #P:8 # # _-----=> irqs-off/BH-disabled # / _----=> need-resched # | / _---=> hardirq/softirq # || / _--=> preempt-depth # ||| / _-=> migrate-disable # |||| / delay # TASK-PID CPU# ||||| TIMESTAMP FUNCTION # | | | ||||| | | cat-1331 [001] ...5. 2944.787977: openat: (synthetic.filename) filename="/etc/ld.so.cache" cat-1331 [001] ...5. 2944.788480: openat: (synthetic.filename) filename="/lib/x86_64-linux-gnu/libc.so.6" cat-1331 [001] ...5. 2944.793426: openat: (synthetic.filename) filename="/usr/lib/locale/locale-archive" cat-1331 [001] ...5. 2944.831362: openat: (synthetic.filename) filename="trace"”…””}”hjËsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´Kìhj°h²hubeh}”(h]”Œ example-2”ah ]”h"]”Œ example 2”ah$]”h&]”uh1hÈhj2h²hh³hÇh´KŒubhÉ)”}”(hhh]”(hÎ)”}”(hŒ Example 3”h]”hŒ Example 3”…””}”(hjäh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjáh²hh³hÇh´Mubhþ)”}”(hŒxIf syscall trace events are available, the above would not need the first eprobe, but it would still need the last one::”h]”hŒwIf syscall trace events are available, the above would not need the first eprobe, but it would still need the last one:”…””}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´Mhjáh²hubj©)”}”(hX…# echo 's:filename u64 file' >> dynamic_events # echo 'hist:keys=common_pid:f=filename' > events/syscalls/sys_enter_openat/trigger # echo 'hist:keys=common_pid:file=$f:onmatch(syscalls.sys_enter_openat).trace(filename,$file)' > events/syscalls/sys_exit_openat/trigger # echo 'e:openat synthetic.filename filename=+0($file):ustring' >> dynamic_events # echo 1 > events/eprobes/openat/enable”h]”hX…# echo 's:filename u64 file' >> dynamic_events # echo 'hist:keys=common_pid:f=filename' > events/syscalls/sys_enter_openat/trigger # echo 'hist:keys=common_pid:file=$f:onmatch(syscalls.sys_enter_openat).trace(filename,$file)' > events/syscalls/sys_exit_openat/trigger # echo 'e:openat synthetic.filename filename=+0($file):ustring' >> dynamic_events # echo 1 > events/eprobes/openat/enable”…””}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j¨h³hÇh´Mhjáh²hubhþ)”}”(hŒ4And this would produce the same result as Example 2.”h]”hŒ4And this would produce the same result as Example 2.”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hýh³hÇh´M hjáh²hubeh}”(h]”Œ example-3”ah ]”h"]”Œ example 3”ah$]”h&]”uh1hÈhj2h²hh³hÇh´Mubeh}”(h]”Œusage-examples”ah ]”h"]”Œusage examples”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KHubeh}”(h]”Œ eprobe-event-based-probe-tracing”ah ]”h"]”Œ"eprobe - event-based probe 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”jWŒ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”}”(j1j.j/j,j½jºjjýj'j$j)j&j­jªjÞjÛj!juŒ nametypes”}”(j1‰j/‰j½‰j‰j'‰j)‰j­‰jÞ‰j!‰uh}”(j.hÊj,j\jºj—jýjÀj$jj&j2jªjCjÛj°jjá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¸ubeŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.