linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* READ_ONCE() usage in perf_mmap_read_self()
@ 2022-06-17 20:13 Vince Weaver
  2022-06-18 13:49 ` Mark Rutland
  0 siblings, 1 reply; 2+ messages in thread
From: Vince Weaver @ 2022-06-17 20:13 UTC (permalink / raw)
  To: linux-kernel, linux-perf-users
  Cc: Mark Rutland, Peter Zijlstra, Arnaldo Carvalho de Melo,
	Namhyung Kim, Will Deacon, Alexander Shishkin, Ingo Molnar

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-18 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-17 20:13 READ_ONCE() usage in perf_mmap_read_self() Vince Weaver
2022-06-18 13:49 ` Mark Rutland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).