X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Flttng-context-callstack-stackwalk-impl.h;h=a7c5a062fb10f521f8a3722f2f0c1a40bab88850;hb=c7d9db61d9c4861b6f344af8f1471a42e00739a8;hp=42f4273d8abae4f1f63069e443228f56b385b472;hpb=cfa6cc1d0f01c2cfcc1a679abf3a6572d411c309;p=lttng-modules.git diff --git a/src/lttng-context-callstack-stackwalk-impl.h b/src/lttng-context-callstack-stackwalk-impl.h index 42f4273d..a7c5a062 100644 --- a/src/lttng-context-callstack-stackwalk-impl.h +++ b/src/lttng-context-callstack-stackwalk-impl.h @@ -40,32 +40,6 @@ unsigned int (*save_func_kernel)(unsigned long *store, unsigned int size, static unsigned int (*save_func_user)(unsigned long *store, unsigned int size); -static -const char *lttng_cs_ctx_mode_name(enum lttng_cs_ctx_modes mode) -{ - switch (mode) { - case CALLSTACK_KERNEL: - return "callstack_kernel"; - case CALLSTACK_USER: - return "callstack_user"; - default: - return NULL; - } -} - -static -const char *lttng_cs_ctx_mode_length_name(enum lttng_cs_ctx_modes mode) -{ - switch (mode) { - case CALLSTACK_KERNEL: - return "_callstack_kernel_length"; - case CALLSTACK_USER: - return "_callstack_user_length"; - default: - return NULL; - } -} - static int init_type_callstack_kernel(void) { @@ -124,7 +98,7 @@ void lttng_cs_set_init(struct lttng_cs __percpu *cs_set) DEFINE_PER_CPU(int, callstack_user_nesting); static -struct lttng_stack_trace *stack_trace_context(struct lttng_ctx_field *field, +struct lttng_stack_trace *stack_trace_context(struct lttng_kernel_ctx_field *field, struct lib_ring_buffer_ctx *ctx) { int buffer_nesting, cs_user_nesting; @@ -135,7 +109,7 @@ struct lttng_stack_trace *stack_trace_context(struct lttng_ctx_field *field, * 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; @@ -147,8 +121,8 @@ struct lttng_stack_trace *stack_trace_context(struct lttng_ctx_field *field, * 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; @@ -156,7 +130,7 @@ struct lttng_stack_trace *stack_trace_context(struct lttng_ctx_field *field, } 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) { @@ -172,7 +146,7 @@ size_t lttng_callstack_length_get_size(size_t offset, struct lttng_ctx_field *fi * 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) { @@ -197,11 +171,11 @@ size_t lttng_callstack_sequence_get_size(size_t offset, struct lttng_ctx_field * MAX_ENTRIES, 0); break; case 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 */ trace->nr_entries = save_func_user(trace->entries, MAX_ENTRIES); - per_cpu(callstack_user_nesting, ctx->cpu)--; + per_cpu(callstack_user_nesting, ctx->priv.reserve_cpu)--; break; default: WARN_ON_ONCE(1); @@ -220,7 +194,7 @@ size_t lttng_callstack_sequence_get_size(size_t offset, struct lttng_ctx_field * } 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) { @@ -239,7 +213,7 @@ void lttng_callstack_length_record(struct lttng_ctx_field *field, } 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) {