X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-context-callstack-legacy-impl.h;h=6b4f06278be412fa284a19203bee53b3d74b91c7;hb=1e543e7c292839b931f808ad341c85f24a859d00;hp=a68e8a18954aff11787527d9c72d87ffe22210df;hpb=b6ee48d2a69c34bf5dd44319cba19bedbbd35fca;p=lttng-modules.git diff --git a/lttng-context-callstack-legacy-impl.h b/lttng-context-callstack-legacy-impl.h index a68e8a18..6b4f0627 100644 --- a/lttng-context-callstack-legacy-impl.h +++ b/lttng-context-callstack-legacy-impl.h @@ -53,6 +53,12 @@ static struct lttng_cs_type cs_types[] = { }, }; +static +const char *lttng_cs_ctx_mode_name(enum lttng_cs_ctx_modes mode) +{ + return cs_types[mode].name; +} + static int init_type(enum lttng_cs_ctx_modes mode) { @@ -70,6 +76,25 @@ int init_type(enum lttng_cs_ctx_modes mode) return 0; } +static +void lttng_cs_set_init(struct lttng_cs __percpu *cs_set) +{ + int cpu, i; + + for_each_possible_cpu(cpu) { + struct lttng_cs *cs; + + cs = per_cpu_ptr(cs_set, cpu); + for (i = 0; i < RING_BUFFER_MAX_NESTING; i++) { + struct lttng_cs_dispatch *dispatch; + + dispatch = &cs->dispatch[i]; + dispatch->stack_trace.entries = dispatch->entries; + dispatch->stack_trace.max_entries = MAX_ENTRIES; + } + } +} + /* Keep track of nesting inside userspace callstack context code */ DEFINE_PER_CPU(int, callstack_user_nesting);