Fix: syscall listing of session
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 16 Oct 2014 14:50:56 +0000 (16:50 +0200)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 16 Oct 2014 14:50:56 +0000 (16:50 +0200)
Fixes syscall listing of sessions when no syscall has been enabled.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-syscalls.c

index 5501997c48fdd73f730fc59e9ac7ecd84dc6fe50..622da6e206a5c683a5c1b006387789c46ac0126e 100644 (file)
@@ -1230,13 +1230,31 @@ long lttng_channel_syscall_mask(struct lttng_channel *channel,
        filter = channel->sc_filter;
 
        for (bit = 0; bit < ARRAY_SIZE(sc_table); bit++) {
-               bt_bitfield_write_be(tmp_mask, char, bit, 1,
-                       filter ? test_bit(bit, filter->sc) : 1);
+               bool state;
+
+               if (channel->sc_table) {
+                       if (filter)
+                               state = test_bit(bit, filter->sc);
+                       else
+                               state = 1;
+               } else {
+                       state = 0;
+               }
+               bt_bitfield_write_be(tmp_mask, char, bit, 1, state);
        }
        for (; bit < sc_tables_len; bit++) {
-               bt_bitfield_write_be(tmp_mask, char, bit, 1,
-                       filter ? test_bit(bit - ARRAY_SIZE(sc_table),
-                               filter->sc_compat) : 1);
+               bool state;
+
+               if (channel->compat_sc_table) {
+                       if (filter)
+                               state = test_bit(bit - ARRAY_SIZE(sc_table),
+                                               filter->sc_compat);
+                       else
+                               state = 1;
+               } else {
+                       state = 0;
+               }
+               bt_bitfield_write_be(tmp_mask, char, bit, 1, state);
        }
        if (copy_to_user(usyscall_mask->mask, tmp_mask, bitmask_len))
                ret = -EFAULT;
This page took 0.027145 seconds and 4 git commands to generate.