Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Low] tracing/osnoise: undeclared identifier osn in start_kthread() breaks 
build
--

commit 4a3b715cf1d6cbcedaf9c94747a13d69da987d02
Author: Crystal Wood <[email protected]>

tracing/osnoise: start_kthread: Always check OSN_WORKLOAD

This commit moves the OSN_WORKLOAD check in start_kthread() ahead of the
timerlat_enabled() check so that timerlat CPU hotplug does not start a kthread
when OSN_WORKLOAD is cleared, and removes a compiler barrier before returning.

> diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
> index aa764ae13047e..33477239351cf 100644
> --- a/kernel/trace/trace_osnoise.c
> +++ b/kernel/trace/trace_osnoise.c
> @@ -2047,16 +2047,17 @@ static int start_kthread(unsigned int cpu)
>       if (cpu_osn_var(cpu)->kthread)
>               return 0;
>  
> +     /* Can still happen with timerlat via cpu hotplug */
> +     if (!test_bit(OSN_WORKLOAD, &osnoise_options)) {
> +             if (!timerlat_enabled())
> +                     osn->sampling = true;

[Severity: Low]
Does this break the build when CONFIG_OSNOISE_TRACER is enabled because osn
is undeclared in start_kthread() at this point in the series?

In parent commit 1860e8883e92 ("tracing/osnoise: Variable cleanup"),
start_kthread() accessed this field via cpu_osn_var(cpu)->sampling = true
without a local osn variable:

    if (!test_bit(OSN_WORKLOAD, &osnoise_options)) {
        cpu_osn_var(cpu)->sampling = true;
        barrier();
        return 0;
    }

The local declaration struct osnoise_variables *osn = cpu_osn_var(cpu); is
only introduced later in the series in commit fc0df59115a1 ("tracing/osnoise:
Per-cpu mutexes and fd detachment"), leaving this commit and the following two
commits unable to compile. Should this still use cpu_osn_var(cpu)->sampling =
true here to preserve bisection?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=2

Reply via email to