X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=lttng-syscalls.c;h=622da6e206a5c683a5c1b006387789c46ac0126e;hb=af991434d1e5fd073968feae6befdb240942def5;hp=5501997c48fdd73f730fc59e9ac7ecd84dc6fe50;hpb=74f7b56a78514d321aaf8b3fffae174999070f71;p=lttng-modules.git diff --git a/lttng-syscalls.c b/lttng-syscalls.c index 5501997c..622da6e2 100644 --- a/lttng-syscalls.c +++ b/lttng-syscalls.c @@ -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;