* Measuring time
@ 2007-03-24 18:25 bora.sahin
2007-03-25 0:54 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: bora.sahin @ 2007-03-24 18:25 UTC (permalink / raw)
To: linux-mips
Hi,
I want to meause the time between irq_enter and my consumer driver read
routine. How can I do that or which toool should I use?
Thanks...
--
Bora SAHIN
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Measuring time
2007-03-24 18:25 Measuring time bora.sahin
@ 2007-03-25 0:54 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2007-03-25 0:54 UTC (permalink / raw)
To: bora.sahin; +Cc: linux-mips
On Sat, Mar 24, 2007 at 08:25:10PM +0200, bora.sahin@ttnet.net.tr wrote:
> I want to meause the time between irq_enter and my consumer driver read
> routine. How can I do that or which toool should I use?
That's a very specific question so standard tools don't seem to be
applicable. I suggest you simple use the CPU's count register to meassure
the time. It can be used like:
#include <linux/kernel.h>
#include <asm/mipsregs.h>
void foo(void)
{
unsigned int start, end;
start = read_c0_counter();
printk("Goodbye, cruel world ...\n");
end = read_c0_counter();
printk("Time for printk: %d\n", end - start);
}
Note that some very old MIPS processors don't have such a counter. Also
in some cores the counter will increment once per cycle on others it will
increment every 2nd cycle and on yet others such as the RM5230 this is
configurable. So you may want to check your processor manual.
The cp0 counter is the timer of choice for this meassurement because it's
very high resolution and can can be accessed with low overhead making
it ideal for the very short time you want to meassure.
Cheers,
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-25 0:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-24 18:25 Measuring time bora.sahin
2007-03-25 0:54 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox