aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-09-17 13:01:10 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-17 16:08:26 -0400
commit2667de81f3256c944b06abdf2c56c2f192fcb724 (patch)
treed642156cfe0c52d2fb7ec1de4a2060018c8e3f8d /include
parent850bc73ffcc99cddfb52bc23217c60810c508853 (diff)
perf_counter: Allow for a wakeup watermark
Currently we wake the mmap() consumer once every PAGE_SIZE of data and/or once event wakeup_events when specified. For high speed sampling this results in too many wakeups wrt. the buffer size, hence change this. We move the default wakeup limit to 1/4-th the buffer size, and provide for means to manually specify this limit. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r--include/linux/perf_counter.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h
index 972f90d7a32f..6c1ef72ea501 100644
--- a/include/linux/perf_counter.h
+++ b/include/linux/perf_counter.h
@@ -199,10 +199,14 @@ struct perf_counter_attr {
199 inherit_stat : 1, /* per task counts */ 199 inherit_stat : 1, /* per task counts */
200 enable_on_exec : 1, /* next exec enables */ 200 enable_on_exec : 1, /* next exec enables */
201 task : 1, /* trace fork/exit */ 201 task : 1, /* trace fork/exit */
202 watermark : 1, /* wakeup_watermark */
202 203
203 __reserved_1 : 50; 204 __reserved_1 : 49;
204 205
205 __u32 wakeup_events; /* wakeup every n events */ 206 union {
207 __u32 wakeup_events; /* wakeup every n events */
208 __u32 wakeup_watermark; /* bytes before wakeup */
209 };
206 __u32 __reserved_2; 210 __u32 __reserved_2;
207 211
208 __u64 __reserved_3; 212 __u64 __reserved_3;
@@ -521,6 +525,8 @@ struct perf_mmap_data {
521 atomic_t wakeup; /* needs a wakeup */ 525 atomic_t wakeup; /* needs a wakeup */
522 atomic_t lost; /* nr records lost */ 526 atomic_t lost; /* nr records lost */
523 527
528 long watermark; /* wakeup watermark */
529
524 struct perf_counter_mmap_page *user_page; 530 struct perf_counter_mmap_page *user_page;
525 void *data_pages[0]; 531 void *data_pages[0];
526}; 532};