},
};
-static
-const char *lttng_cs_ctx_mode_name(enum lttng_cs_ctx_modes mode)
-{
- return cs_types[mode].name;
-}
-
-static
-const char *lttng_cs_ctx_mode_length_name(enum lttng_cs_ctx_modes mode)
-{
- return cs_types[mode].length_name;
-}
-
static
int init_type(enum lttng_cs_ctx_modes mode)
{
DEFINE_PER_CPU(int, callstack_user_nesting);
static
-struct stack_trace *stack_trace_context(struct lttng_ctx_field *field,
+struct stack_trace *stack_trace_context(struct lttng_kernel_ctx_field *field,
struct lib_ring_buffer_ctx *ctx)
{
int buffer_nesting, cs_user_nesting;
* Do not gather the userspace callstack context when the event was
* triggered by the userspace callstack context saving mechanism.
*/
- cs_user_nesting = per_cpu(callstack_user_nesting, ctx->cpu);
+ cs_user_nesting = per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu);
if (fdata->mode == CALLSTACK_USER && cs_user_nesting >= 1)
return NULL;
* max nesting is checked in lib_ring_buffer_get_cpu().
* Check it again as a safety net.
*/
- cs = per_cpu_ptr(fdata->cs_percpu, ctx->cpu);
- buffer_nesting = per_cpu(lib_ring_buffer_nesting, ctx->cpu) - 1;
+ cs = per_cpu_ptr(fdata->cs_percpu, ctx->priv.reserve_cpu);
+ buffer_nesting = per_cpu(lib_ring_buffer_nesting, ctx->priv.reserve_cpu) - 1;
if (buffer_nesting >= RING_BUFFER_MAX_NESTING)
return NULL;
}
static
-size_t lttng_callstack_length_get_size(size_t offset, struct lttng_ctx_field *field,
+size_t lttng_callstack_length_get_size(size_t offset, struct lttng_kernel_ctx_field *field,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
* resulting callstack is saved to be accessed in the record step.
*/
static
-size_t lttng_callstack_sequence_get_size(size_t offset, struct lttng_ctx_field *field,
+size_t lttng_callstack_sequence_get_size(size_t offset, struct lttng_kernel_ctx_field *field,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
trace->nr_entries = 0;
if (fdata->mode == CALLSTACK_USER)
- ++per_cpu(callstack_user_nesting, ctx->cpu);
+ ++per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu);
/* do the real work and reserve space */
cs_types[fdata->mode].save_func(trace);
if (fdata->mode == CALLSTACK_USER)
- per_cpu(callstack_user_nesting, ctx->cpu)--;
+ per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu)--;
/*
* Remove final ULONG_MAX delimiter. If we cannot find it, add
}
static
-void lttng_callstack_length_record(struct lttng_ctx_field *field,
+void lttng_callstack_length_record(struct lttng_kernel_ctx_field *field,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
chan->ops->event_write(ctx, &nr_seq_entries, sizeof(unsigned int));
}
static
-void lttng_callstack_sequence_record(struct lttng_ctx_field *field,
+void lttng_callstack_sequence_record(struct lttng_kernel_ctx_field *field,
struct lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{