callstack context: use GPL-exported symbols
[lttng-modules.git] / lttng-context-callstack-stackwalk-impl.h
index 42f4273d8abae4f1f63069e443228f56b385b472..c227efb208386051e74f73341c9062827aed14e4 100644 (file)
@@ -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;
This page took 0.024921 seconds and 4 git commands to generate.