diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-04-02 05:12:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-06 03:30:45 -0400 |
commit | c457810ab4a825161aec6ef71b581e1bc8febd1a (patch) | |
tree | eccb22f8c868c4d8807657658027261eb97ed37f /kernel/perf_counter.c | |
parent | 8a057d84912f36e53f970c4d177cb4bb6b2f9e08 (diff) |
perf_counter: per event wakeups
By request, provide a way to request a wakeup every 'n' events instead
of every page of output.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Orig-LKML-Reference: <20090402091319.323309784@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r-- | kernel/perf_counter.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 995063df910f..9bcab10e735d 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -1760,7 +1760,15 @@ static void perf_output_copy(struct perf_output_handle *handle, | |||
1760 | 1760 | ||
1761 | static void perf_output_end(struct perf_output_handle *handle) | 1761 | static void perf_output_end(struct perf_output_handle *handle) |
1762 | { | 1762 | { |
1763 | if (handle->wakeup) | 1763 | int wakeup_events = handle->counter->hw_event.wakeup_events; |
1764 | |||
1765 | if (wakeup_events) { | ||
1766 | int events = atomic_inc_return(&handle->data->events); | ||
1767 | if (events >= wakeup_events) { | ||
1768 | atomic_sub(wakeup_events, &handle->data->events); | ||
1769 | __perf_output_wakeup(handle); | ||
1770 | } | ||
1771 | } else if (handle->wakeup) | ||
1764 | __perf_output_wakeup(handle); | 1772 | __perf_output_wakeup(handle); |
1765 | rcu_read_unlock(); | 1773 | rcu_read_unlock(); |
1766 | } | 1774 | } |