+void syscall_entry_event_probe(void *__data, struct pt_regs *regs, long id)
+{
+ struct lttng_channel *chan = __data;
+ struct lttng_event *event, *unknown_event;
+ const struct trace_syscall_entry *table, *entry;
+ size_t table_len;
+
+ if (unlikely(in_compat_syscall())) {
+ struct lttng_syscall_filter *filter = chan->sc_filter;
+
+ if (id < 0 || id >= NR_compat_syscalls
+ || (!READ_ONCE(chan->syscall_all) && !test_bit(id, filter->sc_compat_entry))) {
+ /* System call filtered out. */
+ return;
+ }
+ table = compat_sc_table;
+ table_len = ARRAY_SIZE(compat_sc_table);
+ unknown_event = chan->sc_compat_unknown;
+ } else {
+ struct lttng_syscall_filter *filter = chan->sc_filter;
+
+ if (id < 0 || id >= NR_syscalls
+ || (!READ_ONCE(chan->syscall_all) && !test_bit(id, filter->sc_entry))) {
+ /* System call filtered out. */
+ return;
+ }
+ table = sc_table;
+ table_len = ARRAY_SIZE(sc_table);
+ unknown_event = chan->sc_unknown;
+ }
+ if (unlikely(id < 0 || id >= table_len)) {
+ syscall_entry_event_unknown(unknown_event, regs, id);
+ return;
+ }
+ if (unlikely(in_compat_syscall()))
+ event = chan->compat_sc_table[id];
+ else
+ event = chan->sc_table[id];
+ if (unlikely(!event)) {
+ syscall_entry_event_unknown(unknown_event, regs, id);
+ return;
+ }
+ entry = &table[id];
+ WARN_ON_ONCE(!entry);
+ syscall_entry_call_func(entry->event_func, entry->nrargs, event, regs);
+}
+