€•,ŠŒ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Œ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”…””}”(hhõhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:rostedt@goodmis.org”uh1hóhhë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&hj#hžhhŸh³h Nubah}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j!hŸh³h K hh¶hžhubhµ)”}”(hhh]”(hº)”}”(hŒOverview”h]”hŒOverview”…””}”(hjKhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjHhž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.”…””}”(hjYhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1héhŸh³h KhjHhž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.”…””}”(hjghžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1héhŸh³h KhjHhž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.”…””}”(hjuhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1héhŸh³h KhjHhž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´hjHhž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”…””}”hjxsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j”hŸh³h Kihj/hž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ˆhj/hžhubeh}”(h]”Œ example-1”ah ]”h"]”Œ example 1”ah$]”h&]”uh1h´hjhž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”…””}”hjósbah}”(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”…””}”hjsbah}”(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.”…””}”(hjhž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.”…””}”(hj9hž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.”…””}”(hjGhž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:”…””}”(hjUhž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”…””}”hjcsbah}”(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:”…””}”(hjqhž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”…””}”hjsbah}”(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:”…””}”(hjhž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´hjhž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”…””}”hjìsbah}”(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.”…””}”(hjúhž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´hjhž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”jCŒ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”}”(jjjjj©j¦jìjéjjjjj™j–jÊjÇj j uŒ nametypes”}”(j‰j‰j©‰jì‰j‰j‰j™‰jʉj ‰uh}”(jh¶jjHj¦jƒjéj¬jjïjjj–j/jÇ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¸ubeŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.