- lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned int));
- chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int));
- lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned long));
+ } else {
+ nr_seq_entries = trace->nr_entries;
+ if (trace->nr_entries == MAX_ENTRIES)
+ nr_seq_entries++;
+ }
+ chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int));
+}
+
+static
+void lttng_callstack_sequence_record(struct lttng_ctx_field *field,
+ struct lib_ring_buffer_ctx *ctx,
+ struct lttng_channel *chan)
+{
+ struct lttng_stack_trace *trace = stack_trace_context(field, ctx);
+ unsigned int nr_seq_entries;
+
+ lib_ring_buffer_align_ctx(ctx, lttng_alignof(unsigned long));
+ if (unlikely(!trace)) {