> 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..
Then what might be the best way to measure the time taken by a function? Regards, Om. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/