ring_buffer_frontend.c: include lttng-tracer-core.h
Mathieu Desnoyers
AppliedQuoted 12 lines · * Wade Farnsworth ([email protected]) wrote:
In
lib/ringbuffer/ring_buffer_frontend.c,RING_BUFFER_ALIGNis undefined, leading to no alignment offset being recorded after the call toconfig->cb.record_header_size()inlib_ring_buffer_try_reserve_slow().However,
lttng-ring-buffer-client.hdoes defineRING_BUFFER_ALIGN, so the alignment offset will be produced when the packet header is written inlttng_write_event_header().This discrepancy may be observed on architectures that don't set
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS, such as ARM, with a babeltrace error such as:
Quoted 7 lines
babeltrace:
../../include/babeltrace/ctf/types.h:206:ctf_pos_get_event:
Assertion `pos->offset <=pos->content_size' failed.
Abortedindicating that the actual content size differs from the calculated one due to the difference in alignment. Including the appropriate header file in
ring_buffer_frontend.csolves the problem.
Good catch!
Merged into master and stable-2.0 branches.
Thanks!
Mathieu
Quoted 26 lines
Signed-off-by Wade Farnsworth <[email protected]>--- lib/ringbuffer/ring_buffer_frontend.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)lib/ringbuffer/ring_buffer_frontend.c +1
-0@@ -55,6 +55,7 @@#include <linux/module.h> #include <linux/percpu.h> +#include "../../lttng-tracer-core.h" #include "../../wrapper/ringbuffer/config.h" #include "../../wrapper/ringbuffer/backend.h" #include "../../wrapper/ringbuffer/frontend.h" Signature · 7 lines
1.7.0.4 _______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 4 lines
Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com