Re: [RFC PATCH V2 9/9] tracing: Add timerlat tracer

From: Juri Lelli
Date: Fri May 14 2021 - 04:56:01 EST


Hi Daniel,

Just a couple of things I noticed while playing with this nice additon.

On 23/04/21 23:05, Daniel Bristot de Oliveira wrote:

...

> +/**
> + * tlat_var_reset - Reset the values of the given timerlat_variables
> + */
> +static inline void tlat_var_reset(void)
> +{
> + struct timerlat_variables *tlat_var;
> + int cpu;
> /*
> * So far, all the values are initialized as 0, so
> * zeroing the structure is perfect.
> */
> - memset(osn_var, 0, sizeof(struct osnoise_variables));
> + for_each_cpu(cpu, cpu_online_mask) {
> + memset(tlat_var, 0, sizeof(struct timerlat_variables));
> + tlat_var = per_cpu_ptr(&per_cpu_timerlat_var, cpu);

Think these two above want to be the other way around?

> + }
> }

...

> +#ifdef CONFIG_TIMERLAT_TRACER
> +static void timerlat_tracer_start(struct trace_array *tr)
> +{
> + int retval;
> +
> + if (osnoise_busy)
> + return;
> +
> + retval = __osnoise_tracer_start(tr);
> + if (retval)
> + goto out_err;
> +
> + osnoise_data.timerlat_tracer = 1;

It seems this needs to be set before calling __osnoise_tracer_start()?

Thanks!

Juri