Refactoring: hide internal fields of ring buffer context
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 29 Mar 2021 20:32:58 +0000 (16:32 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 30 Mar 2021 13:31:16 +0000 (09:31 -0400)
The public ring buffer context is allocated on the probe stack, but
contains many internal fields which are of no use to the probe. They
belong to that structure for the sake of passing information between
reserve, write, commit, strcpy, and other ring buffer callbacks.

Move those fields to a newly introduced private data structure, which is
allocated into a TLS stack belonging to the ring buffer client. It is
indexed with the TLS ring buffer nesting counter to allow recursive use
of the ring buffer (e.g. signal handlers).

While doing this, also move the "offset alignment" operation to the ring
buffer write callback. The alignment is now an additional parameter
expected by the write callback. Note that the strcpy and pstrcpy_pad
callbacks never need to do any alignment, so simply remove those
no-op alignments.

The event reserve callback does not need to have an explicit event id
parameter. It can fetch it from the client private data.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I806c1b5de58446649fdfe433bfdc138b44e8f8af


No differences found
This page took 0.044549 seconds and 4 git commands to generate.