Commit 54c53df
committed
tracing: Add common_comm to histograms
If one wants to trace the name of the task that wakes up a process and
pass that to the synthetic events, there's nothing currently that lets the
synthetic events do that. Add a "common_comm" to the histogram logic that
allows histograms save the current->comm as a variable that can be passed
through and added to a synthetic event:
# cd /sys/kernel/tracing
# echo 's:wake_lat char[] waker; char[] wakee; u64 delta;' >> dynamic_events
# echo 'hist:keys=pid:comm=common_comm:ts=common_timestamp.usecs if !(common_flags & 0x18)' > events/sched/sched_waking/trigger
# echo 'hist:keys=next_pid:wake_comm=$comm:delta=common_timestamp.usecs-$ts:onmatch(sched.sched_waking).trace(wake_lat,$wake_comm,next_comm,$delta)' > events/sched/sched_switch/trigger
The above will create a synthetic trace event that will save both the name
of the waker and the wakee but only if the wakeup did not happen in a hard
or soft interrupt context.
The "common_comm" is used to save the task->comm at the time of the
initial event and is passed via the "comm" variable to the second event,
and that is saved as the "waker" field in the "wake_lat" synthetic event.
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250407154912.3c6c6246@gandalf.local.home
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Reviewed-by: Tom Zanussi <zanussi@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>1 parent 7ab0fc6 commit 54c53df
1 file changed
Lines changed: 42 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
| |||
506 | 507 | | |
507 | 508 | | |
508 | 509 | | |
| 510 | + | |
509 | 511 | | |
510 | 512 | | |
511 | 513 | | |
| |||
885 | 887 | | |
886 | 888 | | |
887 | 889 | | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
888 | 899 | | |
889 | 900 | | |
890 | 901 | | |
| |||
1338 | 1349 | | |
1339 | 1350 | | |
1340 | 1351 | | |
| 1352 | + | |
| 1353 | + | |
1341 | 1354 | | |
1342 | 1355 | | |
1343 | 1356 | | |
| |||
2015 | 2028 | | |
2016 | 2029 | | |
2017 | 2030 | | |
| 2031 | + | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
2018 | 2038 | | |
2019 | 2039 | | |
2020 | 2040 | | |
| |||
2359 | 2379 | | |
2360 | 2380 | | |
2361 | 2381 | | |
2362 | | - | |
| 2382 | + | |
2363 | 2383 | | |
2364 | | - | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
2365 | 2387 | | |
2366 | 2388 | | |
2367 | 2389 | | |
| |||
2377 | 2399 | | |
2378 | 2400 | | |
2379 | 2401 | | |
| 2402 | + | |
| 2403 | + | |
2380 | 2404 | | |
2381 | 2405 | | |
2382 | 2406 | | |
| |||
4327 | 4351 | | |
4328 | 4352 | | |
4329 | 4353 | | |
| 4354 | + | |
| 4355 | + | |
4330 | 4356 | | |
4331 | 4357 | | |
4332 | 4358 | | |
| |||
5212 | 5238 | | |
5213 | 5239 | | |
5214 | 5240 | | |
5215 | | - | |
5216 | 5241 | | |
5217 | | - | |
5218 | | - | |
5219 | | - | |
5220 | | - | |
5221 | | - | |
5222 | | - | |
| 5242 | + | |
| 5243 | + | |
| 5244 | + | |
| 5245 | + | |
| 5246 | + | |
| 5247 | + | |
| 5248 | + | |
| 5249 | + | |
| 5250 | + | |
| 5251 | + | |
| 5252 | + | |
| 5253 | + | |
5223 | 5254 | | |
5224 | 5255 | | |
5225 | 5256 | | |
| |||
6097 | 6128 | | |
6098 | 6129 | | |
6099 | 6130 | | |
| 6131 | + | |
| 6132 | + | |
6100 | 6133 | | |
6101 | 6134 | | |
6102 | 6135 | | |
| |||
0 commit comments