On Thu, 2006-06-29 at 19:15 +0200, Fernando Apesteguía wrote: > Thanks to both of you. > > If I use jiffies global variable, very often I get two identical > values before and after the function call. I need more accurate > stamps. Now, with rdtscll I get these values but in cycles. This > measurement is for the same machine, so if I could have the cpu MHz I > could do the division. Am I right? > > Now the question is how to get cpu MHz. The cpuinfo_x86 structure has > not this field. I try to keep track for the value showed > by /proc/cpuinfo. But at arc/i383/kernel/cpu/proc.c I see the > following sentence: > > if ( cpu_has(c, X86_FEATURE_TSC) ) { > seq_printf(m, "cpu MHz\t\t: %u.%03u\n", > cpu_khz / 1000, (cpu_khz % 1000)); > > But cpu_khz is not declared in this file.... even as extern. > > Any ideas to get cpu MHz (or KHz) in order to convert cycles to time > units? it'll be in a header BUT cpu_khz is NOT a constant.. power management will change the actual frequency all the time.. and.. as I said, some processors entirely stop the tsc in the idle loop.. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/