diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-26 21:48:03 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-05-26 21:48:03 (GMT) |
commit | 299297c63686948aab5af1534629a0a740af6688 (patch) | |
tree | 3b149f6bc23b85914112d9dca9d81cb19ea41a3c /drivers | |
parent | e2a1b9ee2335c35e0e34c88a024481b194b3c9cc (diff) | |
parent | 54f2c841fa0007e5fee3b7d01a911c774f0a6cda (diff) | |
download | linux-299297c63686948aab5af1534629a0a740af6688.tar.xz |
Merge branch 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
oprofile: fix cpu buffer size
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/oprofile/cpu_buffer.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c index f0e99d4..242257b 100644 --- a/drivers/oprofile/cpu_buffer.c +++ b/drivers/oprofile/cpu_buffer.c @@ -78,16 +78,20 @@ void free_cpu_buffers(void) op_ring_buffer_write = NULL; } +#define RB_EVENT_HDR_SIZE 4 + int alloc_cpu_buffers(void) { int i; unsigned long buffer_size = oprofile_cpu_buffer_size; + unsigned long byte_size = buffer_size * (sizeof(struct op_sample) + + RB_EVENT_HDR_SIZE); - op_ring_buffer_read = ring_buffer_alloc(buffer_size, OP_BUFFER_FLAGS); + op_ring_buffer_read = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS); if (!op_ring_buffer_read) goto fail; - op_ring_buffer_write = ring_buffer_alloc(buffer_size, OP_BUFFER_FLAGS); + op_ring_buffer_write = ring_buffer_alloc(byte_size, OP_BUFFER_FLAGS); if (!op_ring_buffer_write) goto fail; |