History

perf/core: Provide a kernel-internal interface to recalibrate event period

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().

Like Xu committed 7 years ago

Commit 3ca270f1 parent 02d496c2 files · +26 −7Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/perf_event.h+5−0
@@ -1336,6 +1336,7 @@ extern void perf_event_disable_local(struct perf_event *event); · 1335 unmodified lines
13361336 extern void perf_event_disable_inatomic(struct perf_event *event);
13371337 extern void perf_event_task_tick(void);
13381338 extern int perf_event_account_interrupt(struct perf_event *event);
1339+extern int perf_event_period(struct perf_event *event, u64 value);
13391340 #else /* !CONFIG_PERF_EVENTS: */
13401341 static inline void *
13411342 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
14151416 static inline int __perf_event_disable(void *info) { return -1; }
14161417 static inline void perf_event_task_tick(void) { }
14171418 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+}
14181423 #endif
14191424
14201425 #if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t