Using the kernel's performance counters