Jesper Dangaard Brouer <jbro...@redhat.com> writes:

> I want to use/read the PMU counters for 'instructions' and 'cycles',
> from within the kernel, to measure the overhead of different in-kernel
> functions (and calc the pipeline efficiency ala perf-stat insns per cycle).
>
> What is the prefered way/API to read these counters, without
> conflicting with the perf tool?
>

perf_event_create_counter()


> I basically just need a in-kernel API to turn in these counters, and
> then I can just read them via the rdpcm instruction.

For RDPMC you would need extra support actually, as there is no 
guarantee perf uses the fixed counter. In user space this 
information is in the perf mmap page.

Also please be aware that RDPMC is not synchronizing.

-Andi

-- 
a...@linux.intel.com -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-perf-users" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to