Fix: prio context NULL pointer exception
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 9 Jan 2024 15:33:13 +0000 (10:33 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 9 Jan 2024 15:40:56 +0000 (10:40 -0500)
A missing call to wrapper_task_prio_init() causes the function pointer
for task_prio to stay NULL, which triggers a OOPS when trying to use the
prio context.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I417e84cb8a07db624e682c7ec2c033fbc2a7b8e7

include/lttng/events-internal.h
src/lttng-context-prio.c
src/lttng-events.c

index a727230ffffb8c21320b04b502e98ff4755987d1..181b7b4552305456c16eb8662e76bdbf4dff0a7c 100644 (file)
@@ -649,6 +649,7 @@ int lttng_add_pid_to_ctx(struct lttng_kernel_ctx **ctx);
 int lttng_add_cpu_id_to_ctx(struct lttng_kernel_ctx **ctx);
 int lttng_add_procname_to_ctx(struct lttng_kernel_ctx **ctx);
 int lttng_add_prio_to_ctx(struct lttng_kernel_ctx **ctx);
+int wrapper_task_prio_init(void);
 int lttng_add_nice_to_ctx(struct lttng_kernel_ctx **ctx);
 int lttng_add_vpid_to_ctx(struct lttng_kernel_ctx **ctx);
 int lttng_add_tid_to_ctx(struct lttng_kernel_ctx **ctx);
index a3034e4ef7e453094c953bb3b6131c30d5f2924e..aac10a6399ac8618a42e23c299edd8d41a0c7ee7 100644 (file)
@@ -29,6 +29,7 @@ int wrapper_task_prio_init(void)
        }
        return 0;
 }
+EXPORT_SYMBOL_GPL(wrapper_task_prio_init);
 
 /*
  * Canary function to check for 'task_prio()' at compile time.
index a0bd232228c8dd6a3120134bce7cd16d2c5db33e..08884410f20971781bc0305d1e63f92a86578620 100644 (file)
@@ -4148,6 +4148,9 @@ static int __init lttng_events_init(void)
        int ret;
 
        ret = wrapper_get_pfnblock_flags_mask_init();
+       if (ret)
+               return ret;
+       ret = wrapper_task_prio_init();
        if (ret)
                return ret;
        ret = lttng_probes_init();
This page took 0.029119 seconds and 4 git commands to generate.