diff options
Diffstat (limited to 'kernel/perf_counter.c')
-rw-r--r-- | kernel/perf_counter.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index d76e3112d386..7669afe82cc7 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -1422,6 +1422,7 @@ struct perf_output_handle { | |||
1422 | struct perf_counter *counter; | 1422 | struct perf_counter *counter; |
1423 | struct perf_mmap_data *data; | 1423 | struct perf_mmap_data *data; |
1424 | unsigned int offset; | 1424 | unsigned int offset; |
1425 | unsigned int head; | ||
1425 | int wakeup; | 1426 | int wakeup; |
1426 | }; | 1427 | }; |
1427 | 1428 | ||
@@ -1447,6 +1448,7 @@ static int perf_output_begin(struct perf_output_handle *handle, | |||
1447 | handle->counter = counter; | 1448 | handle->counter = counter; |
1448 | handle->data = data; | 1449 | handle->data = data; |
1449 | handle->offset = offset; | 1450 | handle->offset = offset; |
1451 | handle->head = head; | ||
1450 | handle->wakeup = (offset >> PAGE_SHIFT) != (head >> PAGE_SHIFT); | 1452 | handle->wakeup = (offset >> PAGE_SHIFT) != (head >> PAGE_SHIFT); |
1451 | 1453 | ||
1452 | return 0; | 1454 | return 0; |
@@ -1485,6 +1487,8 @@ static void perf_output_copy(struct perf_output_handle *handle, | |||
1485 | } while (len); | 1487 | } while (len); |
1486 | 1488 | ||
1487 | handle->offset = offset; | 1489 | handle->offset = offset; |
1490 | |||
1491 | WARN_ON_ONCE(handle->offset > handle->head); | ||
1488 | } | 1492 | } |
1489 | 1493 | ||
1490 | #define perf_output_put(handle, x) \ | 1494 | #define perf_output_put(handle, x) \ |