Re: libperf: lack of interface

From: Arnaldo Carvalho de Melo
Date: Wed Sep 01 2021 - 09:36:45 EST


Em Wed, Sep 01, 2021 at 09:45:10AM +0000, nakamura.shun@xxxxxxxxxxx escreveu:
> 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

So, while in this specific case you should probably follow PeterZ's
advice, feel free to submit patches moving stuff that is in
tools/perf/util/ to tools/lib/perf/ (libperf) when you have a reasonable
use case, such as Vince's test suite.

We can then discuss if any adjustment is needed, but doing it this
piecemeal way, with justification, should be a good way to enrich
libperf with things that are in quiescent state in tools/perf/util/ and
that have external users.

Thanks,

- Arnaldo