perf/core: Provide a kernel-internal interface to pause perf_event
authorLike Xu <like.xu@linux.intel.com>
Sun, 27 Oct 2019 10:52:39 +0000 (18:52 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 15 Nov 2019 10:44:07 +0000 (11:44 +0100)
commit52ba4b0b99770e892f43da1238f437155acb8b58
tree18ee181729eb2cea9841a2bffb72d3da055ccabd
parent3ca270fc9edb258d5bfa271bcf851614e9e6e7d4
perf/core: Provide a kernel-internal interface to pause perf_event

Exporting perf_event_pause() as an external accessor for kernel users (such
as KVM) who may do both disable perf_event and read count with just one
time to hold perf_event_ctx_lock. Also the value could be reset optionally.

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Like Xu <like.xu@linux.intel.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/linux/perf_event.h
kernel/events/core.c