Re: LTTng for SH architecture

Tim Bird <[email protected]>
Newsgroups gmane.linux.kernel.tracing
Message-ID <[email protected]>
Mathieu Desnoyers wrote:
> I recommend that you look at the "lttng instrumentation" patches for
> each architectures. You'll find principally that include/asm-$ARCH/ltt.h
> hold the timestamping mechanism for each architecture (does SH4 have a
> 64 or 32 bits timestamp counter ? (get_cycles()))

Just FYI, I don't know much about SH4, but KFT (which I used to maintain)
has a hard-coded readclock() routine (similar to get_cycles()).

Here's the routine from the KFT patches:

#ifdef CONFIG_CPU_SH4
/*
 * In advance, start Timer Unit4(TMU4)
 * ex.
 *  *TMU4_TCR = 0x0000;
 *  *TMU4_TCOR = 0;
 *  *TMU4_TCNT = 0;
 *  *TMU_TSTR2 = (*TMU_TSTR2|0x02);
 */
#define TMU4_TCNT       ((volatile unsigned long *)0xFE100018)

static inline unsigned long __noinstrument kft_readclock(void)
{
        return (-(*TMU4_TCNT))>>CLOCK_SHIFT;
}
#endif /* CONFIG_CPU_SH4 */

Have fun.
 -- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Corporation of America
=============================
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.