X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-context-callstack-stackwalk-impl.h;h=c227efb208386051e74f73341c9062827aed14e4;hb=45ce950feda732e773bdeebeb6d6450989a8d48d;hp=42f4273d8abae4f1f63069e443228f56b385b472;hpb=6afd444b862a34b0cce8309bfabaef7ec9f9054d;p=lttng-modules.git diff --git a/lttng-context-callstack-stackwalk-impl.h b/lttng-context-callstack-stackwalk-impl.h index 42f4273d..c227efb2 100644 --- a/lttng-context-callstack-stackwalk-impl.h +++ b/lttng-context-callstack-stackwalk-impl.h @@ -34,12 +34,6 @@ struct field_data { enum lttng_cs_ctx_modes mode; }; -static -unsigned int (*save_func_kernel)(unsigned long *store, unsigned int size, - unsigned int skipnr); -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) { @@ -66,55 +60,6 @@ const char *lttng_cs_ctx_mode_length_name(enum lttng_cs_ctx_modes mode) } } -static -int init_type_callstack_kernel(void) -{ - unsigned long func; - const char *func_name = "stack_trace_save"; - - if (save_func_kernel) - return 0; - func = kallsyms_lookup_funcptr(func_name); - if (!func) { - printk(KERN_WARNING "LTTng: symbol lookup failed: %s\n", - func_name); - return -EINVAL; - } - save_func_kernel = (void *) func; - return 0; -} - -static -int init_type_callstack_user(void) -{ - unsigned long func; - const char *func_name = "stack_trace_save_user"; - - if (save_func_user) - return 0; - func = kallsyms_lookup_funcptr(func_name); - if (!func) { - printk(KERN_WARNING "LTTng: symbol lookup failed: %s\n", - func_name); - return -EINVAL; - } - save_func_user = (void *) func; - return 0; -} - -static -int init_type(enum lttng_cs_ctx_modes mode) -{ - switch (mode) { - case CALLSTACK_KERNEL: - return init_type_callstack_kernel(); - case CALLSTACK_USER: - return init_type_callstack_user(); - default: - return -EINVAL; - } -} - static void lttng_cs_set_init(struct lttng_cs __percpu *cs_set) { @@ -193,13 +138,13 @@ size_t lttng_callstack_sequence_get_size(size_t offset, struct lttng_ctx_field * switch (fdata->mode) { case CALLSTACK_KERNEL: /* do the real work and reserve space */ - trace->nr_entries = save_func_kernel(trace->entries, + trace->nr_entries = stack_trace_save(trace->entries, MAX_ENTRIES, 0); break; case CALLSTACK_USER: ++per_cpu(callstack_user_nesting, ctx->cpu); /* do the real work and reserve space */ - trace->nr_entries = save_func_user(trace->entries, + trace->nr_entries = stack_trace_save_user(trace->entries, MAX_ENTRIES); per_cpu(callstack_user_nesting, ctx->cpu)--; break;