X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Flttng-context-callstack-stackwalk-impl.h;h=e73d1156ae7c0731e7918c194982e2446688f278;hb=f5ffbd770ec2b9d1ac9b7059eb33a01432043bce;hp=d3a57d86c110e7a67b37958208320f31458e3d7c;hpb=8a57ec025ffbe56153748fd69b60118862707182;p=lttng-modules.git diff --git a/src/lttng-context-callstack-stackwalk-impl.h b/src/lttng-context-callstack-stackwalk-impl.h index d3a57d86..e73d1156 100644 --- a/src/lttng-context-callstack-stackwalk-impl.h +++ b/src/lttng-context-callstack-stackwalk-impl.h @@ -195,14 +195,13 @@ size_t lttng_callstack_sequence_get_size(void *priv, struct lttng_kernel_probe_c static void lttng_callstack_length_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, struct lttng_kernel_ring_buffer_ctx *ctx, - struct lttng_channel *chan) + struct lttng_kernel_channel_buffer *chan) { int cpu = ctx->priv.reserve_cpu; struct field_data *fdata = (struct field_data *) priv; struct lttng_stack_trace *trace = stack_trace_context(fdata, cpu); unsigned int nr_seq_entries; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned int)); if (unlikely(!trace)) { nr_seq_entries = 0; } else { @@ -210,32 +209,33 @@ void lttng_callstack_length_record(void *priv, struct lttng_kernel_probe_ctx *pr if (trace->nr_entries == MAX_ENTRIES) nr_seq_entries++; } - chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int)); + chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int), lttng_alignof(unsigned int)); } static void lttng_callstack_sequence_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, struct lttng_kernel_ring_buffer_ctx *ctx, - struct lttng_channel *chan) + struct lttng_kernel_channel_buffer *chan) { int cpu = ctx->priv.reserve_cpu; struct field_data *fdata = (struct field_data *) priv; struct lttng_stack_trace *trace = stack_trace_context(fdata, cpu); unsigned int nr_seq_entries; - lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned long)); if (unlikely(!trace)) { + /* We need to align even if there are 0 elements. */ + lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned long)); return; } nr_seq_entries = trace->nr_entries; if (trace->nr_entries == MAX_ENTRIES) nr_seq_entries++; chan->ops->event_write(ctx, trace->entries, - sizeof(unsigned long) * trace->nr_entries); + sizeof(unsigned long) * trace->nr_entries, lttng_alignof(unsigned long)); /* Add our own ULONG_MAX delimiter to show incomplete stack. */ if (trace->nr_entries == MAX_ENTRIES) { unsigned long delim = ULONG_MAX; - chan->ops->event_write(ctx, &delim, sizeof(unsigned long)); + chan->ops->event_write(ctx, &delim, sizeof(unsigned long), 1); } }