X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lttng-syscalls.c;fp=lttng-syscalls.c;h=622da6e206a5c683a5c1b006387789c46ac0126e;hb=2f25059db8c710589000120cfeea0983491b5547;hp=5501997c48fdd73f730fc59e9ac7ecd84dc6fe50;hpb=bf2ba318fff2423a87cdd47bcf8345ccaa49447b;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;