[ltt-dev] [PATCH 2/3] ltt: rework trace clock code for SH

Giuseppe CAVALLARO peppe.cavallaro at st.com
Wed Apr 7 01:57:49 EDT 2010


Hi Mathieu,
Mathieu Desnoyers wrote:
>>  static inline u32 trace_clock_read32(void)
>>  {
>> -	return get_cycles();
>> +	if (likely(clock))
>> +		return (u32) clock->read(clock);
> 
> Can you walk us through the code that is executed when clock->read() is
> called ?  Is it possible that the clock source read() takes a xtime seq
> read lock in some SH configurations ?

On SH, the trace_clock_read_synthetic_tsc invokes the
sh_tmu_clocksource_read (clock->read), in drivers/clocksource/sh_tmu.c.
This reads the timer counter register (TCNT).

What do you think?

Regards
Giuseppe

> If it is the case, then we will run into deadlocks with tracing code
> called from within the xtime seq write lock. Therefore, fixing this
> without calling the clocksource read() would be adequate.
> 
> Thanks,
> 
> Mathieu




More information about the lttng-dev mailing list