Skip to content

Commit d8d8661

Browse files
lenticularis39rostedt
authored andcommitted
rtla/timerlat_hist: Set OSNOISE_WORKLOAD for kernel threads
When using rtla timerlat with userspace threads (-u or -U), rtla disables the OSNOISE_WORKLOAD option in /sys/kernel/tracing/osnoise/options. This option is not re-enabled in a subsequent run with kernel-space threads, leading to rtla collecting no results if the previous run exited abnormally: $ rtla timerlat hist -u ^\Quit (core dumped) $ rtla timerlat hist -k -d 1s Index over: count: min: avg: max: ALL: IRQ Thr Usr count: 0 0 0 min: - - - avg: - - - max: - - - The issue persists until OSNOISE_WORKLOAD is set manually by running: $ echo OSNOISE_WORKLOAD > /sys/kernel/tracing/osnoise/options Set OSNOISE_WORKLOAD when running rtla with kernel-space threads if available to fix the issue. Cc: [email protected] Cc: John Kacur <[email protected]> Cc: Luis Goncalves <[email protected]> Link: https://lore.kernel.org/[email protected] Fixes: ed774f7 ("rtla/timerlat_hist: Add timerlat user-space support") Signed-off-by: Tomas Glozar <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 80d3ba1 commit d8d8661

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tools/tracing/rtla/src/timerlat_hist.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,12 +1085,15 @@ timerlat_hist_apply_config(struct osnoise_tool *tool, struct timerlat_hist_param
10851085
}
10861086
}
10871087

1088-
if (params->user_hist) {
1089-
retval = osnoise_set_workload(tool->context, 0);
1090-
if (retval) {
1091-
err_msg("Failed to set OSNOISE_WORKLOAD option\n");
1092-
goto out_err;
1093-
}
1088+
/*
1089+
* Set workload according to type of thread if the kernel supports it.
1090+
* On kernels without support, user threads will have already failed
1091+
* on missing timerlat_fd, and kernel threads do not need it.
1092+
*/
1093+
retval = osnoise_set_workload(tool->context, params->kernel_workload);
1094+
if (retval < -1) {
1095+
err_msg("Failed to set OSNOISE_WORKLOAD option\n");
1096+
goto out_err;
10941097
}
10951098

10961099
return 0;

0 commit comments

Comments
 (0)