Messages in this thread | | | From | Vince Weaver <> | Date | Fri, 17 Jun 2022 16:11:34 -0400 (EDT) |
| |
Hello
Is the perf_mmap__read_self() interface as found in tools/lib/perf/mmap.c the "official" interface for accessing the perf mmap info from userspace?
Are the READ_ONCE() calls required? If they are left out, will accessing the mmap interface potentially fail? Has this ever been seen in practice?
Part of why I am asking is both tools/lib/perf/mmap.c and tools/linux/compiler.h (which defines READ_ONCE) have SPDX headers indicating they are GPL-2.0 licensed, which means it seems like it would not be possible to easily use the perf mmap interface from BSD-licensed code. Would it be possible to get those two files re-licensed?
The (BSD-licensed) PAPI is currently using a mmap reading interface based on early documentation for the feature, but it isn't 100% the same as the version from libperf (and isn't using READ_ONCE). Life would be easier if we could use the perf version of the code because then we would have one less variable to deal with when trying to track down issues.
Vince Weaver vincent.weaver@maine.edu
| |