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)
{
}
}
-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)
{
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;