Fix: ust-app: per-PID app unregister vs tracing stop races
[lttng-tools.git] / src / bin / lttng-sessiond / syscall.c
index b4f2e1eca92f2fb726aa774f8bc94f384bc2f000..bfe32ac731f1be0e72441b2e152561079764fc38 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <common/bitfield.h>
 #include <common/common.h>
 #include <common/kernel-ctl/kernel-ctl.h>
@@ -404,11 +405,15 @@ ssize_t syscall_list_channel(struct ltt_kernel_channel *kchan,
                        events = new_events;
                }
 
+               rcu_read_lock();
                ksyscall = lookup_syscall(syscalls_ht, syscall_table[i].name);
                if (ksyscall) {
                        update_event_syscall_bitness(events, i, ksyscall->index);
+                       rcu_read_unlock();
                        continue;
                }
+               ksyscall = NULL;
+               rcu_read_unlock();
 
                ret = add_syscall_to_ht(syscalls_ht, i, count);
                if (ret < 0) {
@@ -428,7 +433,10 @@ ssize_t syscall_list_channel(struct ltt_kernel_channel *kchan,
        return count;
 
 error:
+       rcu_read_lock();
        destroy_syscall_ht(syscalls_ht);
+       rcu_read_unlock();
+
        free(events);
        return ret;
 }
This page took 0.031543 seconds and 5 git commands to generate.