diff options
-rw-r--r-- | include/linux/perf_event.h | 2 | ||||
-rw-r--r-- | kernel/events/internal.h | 4 | ||||
-rw-r--r-- | kernel/events/ring_buffer.c | 6 |
3 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index d41394a1af36..8a73f75beb16 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -1321,6 +1321,8 @@ extern int perf_output_begin(struct perf_output_handle *handle, | |||
1321 | extern void perf_output_end(struct perf_output_handle *handle); | 1321 | extern void perf_output_end(struct perf_output_handle *handle); |
1322 | extern unsigned int perf_output_copy(struct perf_output_handle *handle, | 1322 | extern unsigned int perf_output_copy(struct perf_output_handle *handle, |
1323 | const void *buf, unsigned int len); | 1323 | const void *buf, unsigned int len); |
1324 | extern unsigned int perf_output_skip(struct perf_output_handle *handle, | ||
1325 | unsigned int len); | ||
1324 | extern int perf_swevent_get_recursion_context(void); | 1326 | extern int perf_swevent_get_recursion_context(void); |
1325 | extern void perf_swevent_put_recursion_context(int rctx); | 1327 | extern void perf_swevent_put_recursion_context(int rctx); |
1326 | extern void perf_event_enable(struct perf_event *event); | 1328 | extern void perf_event_enable(struct perf_event *event); |
diff --git a/kernel/events/internal.h b/kernel/events/internal.h index 7fd5408493d2..ce7bdfc1d045 100644 --- a/kernel/events/internal.h +++ b/kernel/events/internal.h | |||
@@ -114,6 +114,10 @@ static inline int memcpy_common(void *dst, const void *src, size_t n) | |||
114 | 114 | ||
115 | DEFINE_OUTPUT_COPY(__output_copy, memcpy_common) | 115 | DEFINE_OUTPUT_COPY(__output_copy, memcpy_common) |
116 | 116 | ||
117 | #define MEMCPY_SKIP(dst, src, n) (n) | ||
118 | |||
119 | DEFINE_OUTPUT_COPY(__output_skip, MEMCPY_SKIP) | ||
120 | |||
117 | #ifndef arch_perf_out_copy_user | 121 | #ifndef arch_perf_out_copy_user |
118 | #define arch_perf_out_copy_user __copy_from_user_inatomic | 122 | #define arch_perf_out_copy_user __copy_from_user_inatomic |
119 | #endif | 123 | #endif |
diff --git a/kernel/events/ring_buffer.c b/kernel/events/ring_buffer.c index b4c2ad3dee7a..23cb34ff3973 100644 --- a/kernel/events/ring_buffer.c +++ b/kernel/events/ring_buffer.c | |||
@@ -188,6 +188,12 @@ unsigned int perf_output_copy(struct perf_output_handle *handle, | |||
188 | return __output_copy(handle, buf, len); | 188 | return __output_copy(handle, buf, len); |
189 | } | 189 | } |
190 | 190 | ||
191 | unsigned int perf_output_skip(struct perf_output_handle *handle, | ||
192 | unsigned int len) | ||
193 | { | ||
194 | return __output_skip(handle, NULL, len); | ||
195 | } | ||
196 | |||
191 | void perf_output_end(struct perf_output_handle *handle) | 197 | void perf_output_end(struct perf_output_handle *handle) |
192 | { | 198 | { |
193 | perf_output_put_handle(handle); | 199 | perf_output_put_handle(handle); |