summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorSteven Rostedt2009-06-11 15:29:58 +0200
committerSteven Rostedt2009-06-17 03:19:23 +0200
commit22f470f8daea64bc03be1fe30c8c5df382295386 (patch)
tree3186ae50783f1795307055d48a583e23e2e21ad2 /kernel/trace
parenttracing: update sample event documentation (diff)
downloadkernel-qcow2-linux-22f470f8daea64bc03be1fe30c8c5df382295386.tar.gz
kernel-qcow2-linux-22f470f8daea64bc03be1fe30c8c5df382295386.tar.xz
kernel-qcow2-linux-22f470f8daea64bc03be1fe30c8c5df382295386.zip
ring-buffer: use BUF_PAGE_HDR_SIZE in calculating index
The index of the event is found by masking PAGE_MASK to it and subtracting the header size. Currently the header size is calculate by PAGE_SIZE - BUF_PAGE_SIZE, when we already have a macro BUF_PAGE_HDR_SIZE to define it. If we want to change BUF_PAGE_SIZE to something less than filling the rest of the page (this is done for debugging), then we break the algorithm to find the index. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/ring_buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index ed3559944fcf..6b17a11e42a2 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1013,7 +1013,7 @@ rb_event_index(struct ring_buffer_event *event)
{
unsigned long addr = (unsigned long)event;
- return (addr & ~PAGE_MASK) - (PAGE_SIZE - BUF_PAGE_SIZE);
+ return (addr & ~PAGE_MASK) - BUF_PAGE_HDR_SIZE;
}
static inline int