Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147319
b: refs/heads/master
c: c457810
h: refs/heads/master
i:
  147317: f8ad746
  147315: bf7c339
  147311: 3e01645
v: v3
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Apr 6, 2009
1 parent dd477f5 commit f08e718
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a057d84912f36e53f970c4d177cb4bb6b2f9e08
refs/heads/master: c457810ab4a825161aec6ef71b581e1bc8febd1a
3 changes: 2 additions & 1 deletion trunk/include/linux/perf_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ struct perf_counter_hw_event {
__reserved_1 : 53;

__u32 extra_config_len;
__u32 __reserved_4;
__u32 wakeup_events; /* wakeup every n events */

__u64 __reserved_2;
__u64 __reserved_3;
Expand Down Expand Up @@ -321,6 +321,7 @@ struct perf_mmap_data {
int nr_pages;
atomic_t wakeup;
atomic_t head;
atomic_t events;
struct perf_counter_mmap_page *user_page;
void *data_pages[0];
};
Expand Down
10 changes: 9 additions & 1 deletion trunk/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,15 @@ static void perf_output_copy(struct perf_output_handle *handle,

static void perf_output_end(struct perf_output_handle *handle)
{
if (handle->wakeup)
int wakeup_events = handle->counter->hw_event.wakeup_events;

if (wakeup_events) {
int events = atomic_inc_return(&handle->data->events);
if (events >= wakeup_events) {
atomic_sub(wakeup_events, &handle->data->events);
__perf_output_wakeup(handle);
}
} else if (handle->wakeup)
__perf_output_wakeup(handle);
rcu_read_unlock();
}
Expand Down

0 comments on commit f08e718

Please sign in to comment.