<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-rng/kernel/trace/trace_probe.h, branch linus/master</title>
<subtitle>Development tree for the kernel CSPRNG</subtitle>
<id>https://git.zx2c4.com/linux-rng/atom/kernel/trace/trace_probe.h?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-rng/atom/kernel/trace/trace_probe.h?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/'/>
<updated>2026-07-28T14:55:35Z</updated>
<entry>
<title>tracing/probes: Treating longer symbol name on event comparation</title>
<updated>2026-07-28T14:55:35Z</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-28T04:40:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=c00e735410d7269c0c655219cf42846da6b435c7'/>
<id>urn:sha1:c00e735410d7269c0c655219cf42846da6b435c7</id>
<content type='text'>
MAX_COMMON_HEAD_LEN (63) was used to allocate a temporary buffer for
formatting command heads in trace_kprobe_match_command_head() and
trace_uprobe_match_command_head(). However, the buffer size is too
short for some longer symbols. Especially, with rust code, the symbol
can be mangled and become very long.

Refactor trace_kprobe_match_command_head() to perform direct string
comparisons using strcmp() and strncmp(), eliminating the need for a
temporary buffer and removing the MAX_COMMON_HEAD_LEN string length
restriction on probe symbol names.

For trace_uprobe_match_command_head(), since tu-&gt;filename is already
matched via strncmp(), use a fixed 64-byte stack buffer solely for
formatting offset and ref_ctr_offset (which requires at most 39 bytes).

With all users converted, remove the MAX_COMMON_HEAD_LEN definition from
trace_probe.h.

Link: https://lore.kernel.org/all/178521361102.34226.9650586522488974115.stgit@devnote2/

Reported-by: Zhan Xusheng &lt;zhanxusheng1024@gmail.com&gt;
Link: https://lore.kernel.org/all/20260724023317.624074-1-zhanxusheng@xiaomi.com/
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
</entry>
<entry>
<title>tracing/probes: Remove redundant boolean conversion in trace_probe_has_single_file()</title>
<updated>2026-07-21T08:59:42Z</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-20T10:43:48Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=794b5640aa7b295623c1d6b6fc2fe229a30aad0d'/>
<id>urn:sha1:794b5640aa7b295623c1d6b6fc2fe229a30aad0d</id>
<content type='text'>
list_is_singular() returns a boolean value, so the double negation (!!)
in trace_probe_has_single_file() is redundant. Remove it.

Link: https://lore.kernel.org/all/178454422826.296567.4382363406595169533.stgit@devnote2/

Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
</entry>
<entry>
<title>tracing/probes: Remove duplicate MAX_ARRAY_LEN macro definition</title>
<updated>2026-07-21T08:59:39Z</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-20T10:43:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=323853e2d125ec1a99df61893fb546728f4d738e'/>
<id>urn:sha1:323853e2d125ec1a99df61893fb546728f4d738e</id>
<content type='text'>
MAX_ARRAY_LEN is defined twice in trace_probe.h. Remove the redundant
definition.

Link: https://lore.kernel.org/all/178454421926.296567.6649983666070787570.stgit@devnote2/

Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;</content>
</entry>
<entry>
<title>tracing/probes: Eliminate recursion in parse_probe_arg()</title>
<updated>2026-07-14T13:43:40Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-14T01:10:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=1a0ffe10bfb91efc730f2d34c6875c1084b0a462'/>
<id>urn:sha1:1a0ffe10bfb91efc730f2d34c6875c1084b0a462</id>
<content type='text'>
To avoid potential stack overflows on limited kernel stacks, convert
parse_probe_arg() from a recursive function into a loop-based
implementation with a simple local state stack.

Since recursion is eliminated using a loop with a fixed-size
stack in the context, this restricts the dereference nesting
depth. The maximum nesting depth of dereferences is now restricted
to the same limit as typecasts (TRACEPROBE_MAX_NESTED_LEVEL, which
is 8) and reports the same TOO_MANY_NESTED error. Update ftrace
selftests to reflect this restriction and simplify the checks.

Note that this change slightly alters the behavior of nested
dereferencing in fetcharg. Previously, dereferencing without BTF
allowed for up to 14 levels of nesting, whereas dereferencing
with BTF was limited to 3 levels. With this change, the nesting
depth is now limited to 8 levels in both cases.

Link: https://lore.kernel.org/all/178399141396.27810.5390060618628718661.stgit@devnote2/

Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
<entry>
<title>tracing/probes: Extend max length of argument string</title>
<updated>2026-07-14T13:43:40Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-14T01:10:04Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=47e4ec68716624642f7108535960835bae7eff13'/>
<id>urn:sha1:47e4ec68716624642f7108535960835bae7eff13</id>
<content type='text'>
To support BTF argument parsing (such as accessing fields within nested
structures via typecasting), the maximum argument string length needs
to be extended. Extend MAX_ARGSTR_LEN from 63 to 255.

Since MAX_ARGSTR_LEN was previously reused to format command heads in
trace_*probe_match_command_head() functions, introduce a dedicated
MAX_COMMON_HEAD_LEN (63) macro for matching command heads and switch
these functions to use the new macro.

Link: https://lore.kernel.org/all/178399140457.27810.11387684872148824707.stgit@devnote2/

Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
<entry>
<title>tracing/probes: Sort ERRORS list in trace_probe.h alphabetically</title>
<updated>2026-07-14T13:43:40Z</updated>
<author>
<name>Masami Hiramatsu</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-14T01:09:55Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=0b420da72e45bc71fc2a8c9b230cd37585452188'/>
<id>urn:sha1:0b420da72e45bc71fc2a8c9b230cd37585452188</id>
<content type='text'>
Sort the C-macro ERRORS list alphabetically in trace_probe.h to make
it easier to find and maintain error entries.

Link: https://lore.kernel.org/all/178399139516.27810.14930549550788208142.stgit@devnote2/

Assisted-by: Antigravity:gemini-3.5-flash
Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
<entry>
<title>tracing/probes: Add this_cpu_read() and this_cpu_ptr() dereference method to fetcharg</title>
<updated>2026-07-14T13:43:16Z</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-02T12:12:42Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=49b0a3f6052975d5c25721ec75dce557cc933d90'/>
<id>urn:sha1:49b0a3f6052975d5c25721ec75dce557cc933d90</id>
<content type='text'>
When tracing the kernel local variables, sometimes we need to get the
CPU local variables. To access it, current simple dereference is not
enough.

Thus, introduce a special this_cpu_read() dereference to access per-cpu
variable for the current CPU (accessing other CPU variable may race with
updates on other CPUs). Also this_cpu_ptr() is for accessing per-cpu
pointer.

Those are working as same as the kernel percpu macro.

Link: https://lore.kernel.org/all/178271367680.1176915.4711734074448973989.stgit@devnote2/

Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
<entry>
<title>tracing/probes: Add $current variable support</title>
<updated>2026-07-14T13:43:16Z</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-02T12:12:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=738b78ee4bfa5e290f155be1e946bc2ae5660dfd'/>
<id>urn:sha1:738b78ee4bfa5e290f155be1e946bc2ae5660dfd</id>
<content type='text'>
Since we can use the BTF to cast value to a structure pointer type,
it is useful to introduce "$current" special variable support to
fetcharg.

User can define a fetcharg to access current task_struct properties
using BTF info. e.g.

  $current-&gt;cpus_ptr

Link: https://lore.kernel.org/all/178271366709.1176915.15320906169981578568.stgit@devnote2/

Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
<entry>
<title>tracing/probes: Support field specifier option for typecast</title>
<updated>2026-07-14T13:43:16Z</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-02T12:12:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=f2183452402508ad68ea01eed18ae8eecfcd8f0a'/>
<id>urn:sha1:f2183452402508ad68ea01eed18ae8eecfcd8f0a</id>
<content type='text'>
Add a field specifier option for the typecast. This works like
container_of() macro.

    (STRUCT[,FIELD[.FIELD2...]])VAR

This is equivalent to :

    container_of(VAR, struct STRUCT, FIELD[.FIELD2...])

For example:

 echo "f tick_nohz_handler next_tick=(tick_sched,sched_timer)timer-&gt;next_tick" &gt;&gt; dynamic_events

This will trace tick_nohz_handler() with its tick_sched::next_tick which
is converted from @timer by contianer_of(tick, struct tick_sched, sched_timer).
So, if you enabkle both fprobes:tick_nohz_handler__entry and
timer:hrtimer_expire_entry events, we will see something like:


          &lt;idle&gt;-0       [002] d.h1.  3778.087272: hrtimer_expire_entry: hrtimer=00000000d63db328 f
unction=tick_nohz_handler now=3777450051040
          &lt;idle&gt;-0       [002] d.h1.  3778.087281: tick_nohz_handler__entry: (tick_nohz_handler+0x4
/0x140) next_tick=3777450000000


Link: https://lore.kernel.org/all/178271365745.1176915.725923927180862257.stgit@devnote2/

Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
<entry>
<title>tracing/probes: Type casting always involves nested calls</title>
<updated>2026-07-14T13:43:16Z</updated>
<author>
<name>Masami Hiramatsu (Google)</name>
<email>mhiramat@kernel.org</email>
</author>
<published>2026-07-02T12:12:41Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-rng/commit/?id=52c76ec18ebacdcf7e227c06f4215bc49e5d284c'/>
<id>urn:sha1:52c76ec18ebacdcf7e227c06f4215bc49e5d284c</id>
<content type='text'>
This allows type casting to various fetchargs without parentheses
by recursively calling parse_probe_arg on the target when type
casting is used.

For example, this allows the following expressions:
 - (STRUCT)%REG-&gt;FIELD
 - (STRUCT)$stackN-&gt;FIELD
 - (STRUCT)@SYM-&gt;FIELD

Note that @SYM+/-OFFSET with typecast needs parentheses like:
  - (STRUCT)(@SYM-8)-&gt;FIELD

Link: https://lore.kernel.org/all/178271364804.1176915.17600229399446264813.stgit@devnote2/

Signed-off-by: Masami Hiramatsu (Google) &lt;mhiramat@kernel.org&gt;
</content>
</entry>
</feed>
