“caa439cb445c9a874af5dff7990039088ee51a78”上不存在“git@gitcode.net:taosdata/tdengine.git”
提交 22f470f8 编写于 作者: S Steven Rostedt 提交者: Steven Rostedt

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: NSteven Rostedt <rostedt@goodmis.org>
上级 44ad18e0
...@@ -1013,7 +1013,7 @@ rb_event_index(struct ring_buffer_event *event) ...@@ -1013,7 +1013,7 @@ rb_event_index(struct ring_buffer_event *event)
{ {
unsigned long addr = (unsigned long)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 static inline int
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册