Re: [PATCH v4 3/3] tracing: Histogram for missed timer offsets

From: Binoy Jayan
Date: Fri Sep 02 2016 - 08:41:46 EST


On 30 August 2016 at 16:20, Masami Hiramatsu
<masami.hiramatsu@xxxxxxxxxx> wrote:
> Hi Binoy,
>>
>> +static inline void trace_latency_hrtimer_mark_ts(struct hrtimer *timer,
>> + struct hrtimer_clock_base *new_base,
>> + ktime_t tim)
>> +{
>> +#if defined(CONFIG_PREEMPT_TRACER) || defined(CONFIG_IRQSOFF_TRACER)
>> + if (trace_latency_hrtimer_interrupt_enabled()) {
>
> You would better use unlikely() here.
>
>> + ktime_t now = new_base->get_time();
>> +
>> + if (ktime_to_ns(tim) < ktime_to_ns(now))
>
> Wouldn't we need to consider the case of wrap around?
>
>> + timer->praecox = now;
>> + else
>> + timer->praecox = ktime_set(0, 0);
>> + }
>> +#endif
>> +}

Hi Masami,

I always see these values to be relative and not absolute time. I
found 'praecox' to be always zero during test.
What do you think.

Binoy