fix: statedump: undefined symbols caused by incorrect patch backport
[lttng-modules.git] / lttng-context-callstack.c
index 3fccfcf270bf34e48053a5ab30b761d1dc5bffd6..ba35a3940845399cfa73a605ea3d59c75002fc3c 100644 (file)
 #include "wrapper/vmalloc.h"
 #include "lttng-tracer.h"
 
+#ifdef CONFIG_ARCH_STACKWALK
+#include "lttng-context-callstack-stackwalk-impl.h"
+#else
 #include "lttng-context-callstack-legacy-impl.h"
+#endif
 
 static
 void field_data_free(struct field_data *fdata)
@@ -63,7 +67,6 @@ void field_data_free(struct field_data *fdata)
 static
 struct field_data __percpu *field_data_create(enum lttng_cs_ctx_modes mode)
 {
-       int cpu, i;
        struct lttng_cs __percpu *cs_set;
        struct field_data *fdata;
 
@@ -73,20 +76,8 @@ struct field_data __percpu *field_data_create(enum lttng_cs_ctx_modes mode)
        cs_set = alloc_percpu(struct lttng_cs);
        if (!cs_set)
                goto error_alloc;
-
+       lttng_cs_set_init(cs_set);
        fdata->cs_percpu = cs_set;
-       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;
-               }
-       }
        fdata->mode = mode;
        return fdata;
 
@@ -107,7 +98,7 @@ static
 int __lttng_add_callstack_generic(struct lttng_ctx **ctx,
                enum lttng_cs_ctx_modes mode)
 {
-       const char *ctx_name = cs_types[mode].name;
+       const char *ctx_name = lttng_cs_ctx_mode_name(mode);
        struct lttng_ctx_field *field;
        struct field_data *fdata;
        int ret;
@@ -150,7 +141,7 @@ int __lttng_add_callstack_generic(struct lttng_ctx **ctx,
        field->record = lttng_callstack_record;
        field->priv = fdata;
        field->destroy = lttng_callstack_destroy;
-       wrapper_vmalloc_sync_all();
+       wrapper_vmalloc_sync_mappings();
        return 0;
 
 error_create:
This page took 0.024205 seconds and 4 git commands to generate.