From: Stephen W. <ste...@ea...> - 2002-12-20 16:10:09
|
---- Original Message ---- > From Markus Gaugusch <ma...@ga...> > Date: Thursday, 19 Dec 2002, 20:13 > > I don't really know how to do this (finding the ec code won't be so hard, > but I don't think that 'normal' libc time functions will work in kernel). > Any volunteers? ;) You shouldn't need to use the time functions .. just print out the kernel's 'jiffy' count. It's only 100Hz but since we're looking for 0.6s that shouldn't matter. If you need debug timings more precisely then on x86: #define _int64 long long // The kernel may have something like this already .. I can't remember #define prectime() ({ _int64 u; asm("rdtsc": "=A" (u)); u; }) will give you a way of accessing the time stamp counter which on Pentium class chips will count CPU cycles .. which gives somewhat more precise profiling information. This is something I keep meaning to look at, but I seem to be missing a large number of 'tuits' (especially the round variety). -- Stephen White <ste...@ea...> |