+
+ /* Allocate events for each syscall, insert into table */
+ for (i = 0; i < table_len; i++) {
+ struct lttng_kernel_event ev;
+ desc = table[i].desc;
+
+ if (!desc) {
+ /* Unknown syscall */
+ continue;
+ }
+ /*
+ * Skip those already populated by previous failed
+ * register for this channel.
+ */
+ if (chan_table[i])
+ continue;
+ memset(&ev, 0, sizeof(ev));
+ strncpy(ev.name, desc->name, LTTNG_KERNEL_SYM_NAME_LEN);
+ ev.name[LTTNG_KERNEL_SYM_NAME_LEN - 1] = '\0';
+ ev.instrumentation = LTTNG_KERNEL_NOOP;
+ chan_table[i] = lttng_event_create(chan, &ev, filter,
+ desc);
+ WARN_ON_ONCE(!chan_table[i]);
+ if (IS_ERR(chan_table[i])) {
+ /*
+ * If something goes wrong in event registration
+ * after the first one, we have no choice but to
+ * leave the previous events in there, until
+ * deleted by session teardown.
+ */
+ return PTR_ERR(chan_table[i]);
+ }
+ }
+ return 0;
+}
+
+int lttng_syscalls_register(struct lttng_channel *chan, void *filter)
+{
+ struct lttng_kernel_event ev;