summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>2026-07-02 21:12:42 +0900
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2026-07-14 22:43:16 +0900
commit7d8d6ad659c02ed5d2387777194c22e8e81dbb2b (patch)
treebda2030282022dfaa864c6a16f5c17902b70a3b2 /tools/perf/scripts/python
parent49b0a3f6052975d5c25721ec75dce557cc933d90 (diff)
tracing/probes: Add a new testcase for BTF typecasts
With the introduction of container_of-style BTF typecasting and per-CPU variable access support in trace probes, we need a way to verify their functionality and prevent regressions. Add a new ftrace kselftest and update the trace event sample module to test and validate these features. Specifically, update the trace-events-sample module to set up a periodic timer whose callback accesses a per-CPU counter. Introduce a new sample trace event, foo_timer_fn, to trace this callback and log the current counter value. Then, add a new test case, btf_probe_event.tc, which defines a dynamic probe on the timer callback. The probe uses BTF typecasting to recover the parent structure from the timer argument and this_cpu_read() to fetch the per-CPU counter. The test verifies the integrity of the implementation by ensuring the values recorded by the dynamic probe match those from the static tracepoint. Link: https://lore.kernel.org/all/178271368625.1176915.13502654445483530822.stgit@devnote2/ Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions