lkml.org 
[lkml]   [2011]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] perf events: fix WARN_ON_ONCE for 64-bit raw data, SW events
Date
This check does not work out for 64-bit counter:

sizeof(u32) + sizeof(u64) = 4 + 8 = 12

which does not pass the WARN_ON_ONCE test. I'm guessing (hoping
really) that the intent is that the size of the raw data is a
multiple of 4 bytes, not 8.

Signed-off-by: David Ahern <daahern@cisco.com>
---
kernel/perf_event.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index a0a6987..3280671 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4351,7 +4351,7 @@ void perf_prepare_sample(struct perf_event_header *header,
else
size += sizeof(u32);

- WARN_ON_ONCE(size & (sizeof(u64)-1));
+ WARN_ON_ONCE(size & (sizeof(u32)-1));
header->size += size;
}
}
--
1.7.3.4


\
 
 \ /
  Last update: 2011-02-18 06:57    [W:5.412 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site