diff options
| author | Vegard Nossum <vegard.nossum@gmail.com> | 2009-02-28 02:29:44 -0500 |
|---|---|---|
| committer | Vegard Nossum <vegard.nossum@gmail.com> | 2009-06-15 09:49:37 -0400 |
| commit | 1744a21d57d9c60136461adb6afa85e51b3e94d9 (patch) | |
| tree | 62fdc4342e21835dc7fd8572b2ed1628324a0c12 | |
| parent | a98b65a3ad71e702e760bc63f57684301628e837 (diff) | |
trace: annotate bitfields in struct ring_buffer_event
This gets rid of a heap of false-positive warnings from the tracer
code due to the use of bitfields.
[rebased for mainline inclusion]
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
| -rw-r--r-- | include/linux/ring_buffer.h | 4 | ||||
| -rw-r--r-- | kernel/trace/ring_buffer.c | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 8670f1575fe1..29f8599e6bea 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _LINUX_RING_BUFFER_H | 1 | #ifndef _LINUX_RING_BUFFER_H |
| 2 | #define _LINUX_RING_BUFFER_H | 2 | #define _LINUX_RING_BUFFER_H |
| 3 | 3 | ||
| 4 | #include <linux/kmemcheck.h> | ||
| 4 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
| 5 | #include <linux/seq_file.h> | 6 | #include <linux/seq_file.h> |
| 6 | 7 | ||
| @@ -11,7 +12,10 @@ struct ring_buffer_iter; | |||
| 11 | * Don't refer to this struct directly, use functions below. | 12 | * Don't refer to this struct directly, use functions below. |
| 12 | */ | 13 | */ |
| 13 | struct ring_buffer_event { | 14 | struct ring_buffer_event { |
| 15 | kmemcheck_bitfield_begin(bitfield); | ||
| 14 | u32 type_len:5, time_delta:27; | 16 | u32 type_len:5, time_delta:27; |
| 17 | kmemcheck_bitfield_end(bitfield); | ||
| 18 | |||
| 15 | u32 array[]; | 19 | u32 array[]; |
| 16 | }; | 20 | }; |
| 17 | 21 | ||
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c index 2e642b2b7253..dc4dc70171ce 100644 --- a/kernel/trace/ring_buffer.c +++ b/kernel/trace/ring_buffer.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/debugfs.h> | 10 | #include <linux/debugfs.h> |
| 11 | #include <linux/uaccess.h> | 11 | #include <linux/uaccess.h> |
| 12 | #include <linux/hardirq.h> | 12 | #include <linux/hardirq.h> |
| 13 | #include <linux/kmemcheck.h> | ||
| 13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
| 14 | #include <linux/percpu.h> | 15 | #include <linux/percpu.h> |
| 15 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
| @@ -1270,6 +1271,7 @@ rb_move_tail(struct ring_buffer_per_cpu *cpu_buffer, | |||
| 1270 | if (tail < BUF_PAGE_SIZE) { | 1271 | if (tail < BUF_PAGE_SIZE) { |
| 1271 | /* Mark the rest of the page with padding */ | 1272 | /* Mark the rest of the page with padding */ |
| 1272 | event = __rb_page_index(tail_page, tail); | 1273 | event = __rb_page_index(tail_page, tail); |
| 1274 | kmemcheck_annotate_bitfield(event, bitfield); | ||
| 1273 | rb_event_set_padding(event); | 1275 | rb_event_set_padding(event); |
| 1274 | } | 1276 | } |
| 1275 | 1277 | ||
| @@ -1327,6 +1329,7 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer, | |||
| 1327 | return NULL; | 1329 | return NULL; |
| 1328 | 1330 | ||
| 1329 | event = __rb_page_index(tail_page, tail); | 1331 | event = __rb_page_index(tail_page, tail); |
| 1332 | kmemcheck_annotate_bitfield(event, bitfield); | ||
| 1330 | rb_update_event(event, type, length); | 1333 | rb_update_event(event, type, length); |
| 1331 | 1334 | ||
| 1332 | /* The passed in type is zero for DATA */ | 1335 | /* The passed in type is zero for DATA */ |
