Currently, perf_event_period() is used by user tools via ioctl. Based on naming convention, exporting perf_event_period() for kernel users (such as KVM) who may recalibrate the event period for their assigned counter according to their requirements. The perf_event_period() is an external accessor, just like the perf_event_{en,dis}able() and should thus use perf_event_ctx_lock().
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -1336,6 +1336,7 @@ extern void perf_event_disable_local(struct perf_event *event); · 1335 unmodified lines | ||
| 1336 | 1336 | extern void perf_event_disable_inatomic(struct perf_event *event); |
| 1337 | 1337 | extern void perf_event_task_tick(void); |
| 1338 | 1338 | extern int perf_event_account_interrupt(struct perf_event *event); |
| 1339 | +extern int perf_event_period(struct perf_event *event, u64 value); | |
| 1339 | 1340 | #else /* !CONFIG_PERF_EVENTS: */ |
| 1340 | 1341 | static inline void * |
| 1341 | 1342 | perf_aux_output_begin(struct perf_output_handle *handle, |
| @@ -1415,6 +1416,10 @@ static inline void perf_event_disable(struct perf_event *event) { } · 73 unmodified lines | ||
| 1415 | 1416 | static inline int __perf_event_disable(void *info) { return -1; } |
| 1416 | 1417 | static inline void perf_event_task_tick(void) { } |
| 1417 | 1418 | static inline int perf_event_release_kernel(struct perf_event *event) { return 0; } |
| 1419 | +static inline int perf_event_period(struct perf_event *event, u64 value) | |
| 1420 | +{ | |
| 1421 | + return -EINVAL; | |
| 1422 | +} | |
| 1418 | 1423 | #endif |
| 1419 | 1424 | |
| 1420 | 1425 | #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL) |