lkml.org 
[lkml]   [2021]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: libperf: lack of interface
On Wed, Sep 01, 2021 at 09:45:10AM +0000, nakamura.shun@fujitsu.com wrote:
> Hello.
>
> I'm trying to change rdpmc test in perf_event_tests[1] 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
>
> [1] 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
syscalls'/performance thing.

The typical RDPMC usage is:

/* setup counter on self */

...

start = RDPMC
/* your code */
end = RDPMC
delta = end - start;

...

Nowhere do we need a reset...

\
 
 \ /
  Last update: 2021-09-01 11:59    [W:0.078 / U:1.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site