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)
commit8936b6c0add7eb6706e0a1ca50e03c446dda4006
tree45421efbcc1fbb2ed041c8cba0c8b852c42f2158
parentb62f8205216d20d7ef16b536efd81389dc6fdd2f
Refactoring: hide internal fields of ring buffer context

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
38 files changed:
include/lttng/ringbuffer-context.h
include/lttng/ust-events.h
include/lttng/ust-tracepoint-event.h
liblttng-ust-ctl/ustctl.c
liblttng-ust-java-agent/jni/common/lttng_ust_context.c
liblttng-ust/lttng-context-cgroup-ns.c
liblttng-ust/lttng-context-cpu-id.c
liblttng-ust/lttng-context-ip.c
liblttng-ust/lttng-context-ipc-ns.c
liblttng-ust/lttng-context-mnt-ns.c
liblttng-ust/lttng-context-net-ns.c
liblttng-ust/lttng-context-perf-counters.c
liblttng-ust/lttng-context-pid-ns.c
liblttng-ust/lttng-context-procname.c
liblttng-ust/lttng-context-pthread-id.c
liblttng-ust/lttng-context-time-ns.c
liblttng-ust/lttng-context-user-ns.c
liblttng-ust/lttng-context-uts-ns.c
liblttng-ust/lttng-context-vegid.c
liblttng-ust/lttng-context-veuid.c
liblttng-ust/lttng-context-vgid.c
liblttng-ust/lttng-context-vpid.c
liblttng-ust/lttng-context-vsgid.c
liblttng-ust/lttng-context-vsuid.c
liblttng-ust/lttng-context-vtid.c
liblttng-ust/lttng-context-vuid.c
liblttng-ust/lttng-events.c
liblttng-ust/lttng-ring-buffer-client.h
liblttng-ust/lttng-ring-buffer-metadata-client.h
liblttng-ust/ust-core.c
liblttng-ust/ust-events-internal.h
libringbuffer/backend.h
libringbuffer/backend_internal.h
libringbuffer/frontend_api.h
libringbuffer/frontend_types.h
libringbuffer/ring_buffer_frontend.c
libringbuffer/ringbuffer-config.h
tests/compile/test-app-ctx/hello.c
This page took 0.030969 seconds and 4 git commands to generate.