Re: libperf: lack of interface
From: Peter Zijlstra
Date: Wed Sep 01 2021 - 05:59:17 EST
On Wed, Sep 01, 2021 at 09:45:10AM +0000, nakamura.shun@xxxxxxxxxxx wrote:
> I'm trying to change rdpmc test in perf_event_tests to use libperf, but libperf doesn't have enough interfaces.
> Does anyone plan to implement any of these libperf features?
> - Interfaces that can run ioctl (PERF_EVENT_IOC_RESET) from userland
> - Interfaces that can run fcntl (SIGIO) from userland
>  https://github.com/deater/perf_event_tests/tree/master/tests/rdpmc
While IOC_RESET has it's uses, it really shouldn't be used in
combination with RDPMC, it destroys the whole 'dont do
The typical RDPMC usage is:
/* setup counter on self */
start = RDPMC
/* your code */
end = RDPMC
delta = end - start;
Nowhere do we need a reset...