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

From: Daniel Bristot de Oliveira
Date: Fri May 14 2021 - 04:59:50 EST


On 5/14/21 10:55 AM, Juri Lelli wrote:
> 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?

Arrrggg! :-) you are right...

>> + }
>> }
>
> ...
>
>> +#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()?

Yep, my bad! two last minute cleanups that broke things...

I will change these two things in the v3.

Thanks!
-- Daniel

> Thanks!
>
> Juri
>