int lttng_syscalls_register_event(struct lttng_channel *chan, void *filter);
int lttng_syscalls_unregister_event(struct lttng_channel *chan);
int lttng_syscalls_destroy_event(struct lttng_channel *chan);
-int lttng_syscall_filter_enable_event(struct lttng_channel *chan,
+int lttng_syscall_filter_enable_event(
+ struct lttng_channel *chan,
struct lttng_event *event);
-int lttng_syscall_filter_disable_event(struct lttng_channel *chan,
+int lttng_syscall_filter_disable_event(
+ struct lttng_channel *chan,
struct lttng_event *event);
+
long lttng_channel_syscall_mask(struct lttng_channel *channel,
struct lttng_kernel_syscall_mask __user *usyscall_mask);
}
static
-const char *get_syscall_name(struct lttng_event *event)
+const char *get_syscall_name(const char *desc_name,
+ enum lttng_syscall_abi abi,
+ enum lttng_syscall_entryexit entryexit)
{
size_t prefix_len = 0;
- WARN_ON_ONCE(event->instrumentation != LTTNG_KERNEL_SYSCALL);
- switch (event->u.syscall.entryexit) {
+ switch (entryexit) {
case LTTNG_SYSCALL_ENTRY:
- switch (event->u.syscall.abi) {
+ switch (abi) {
case LTTNG_SYSCALL_ABI_NATIVE:
prefix_len = strlen(SYSCALL_ENTRY_STR);
break;
}
break;
case LTTNG_SYSCALL_EXIT:
- switch (event->u.syscall.abi) {
+ switch (abi) {
case LTTNG_SYSCALL_ABI_NATIVE:
prefix_len = strlen(SYSCALL_EXIT_STR);
break;
break;
}
WARN_ON_ONCE(prefix_len == 0);
- return event->desc->name + prefix_len;
+ return desc_name + prefix_len;
}
-int lttng_syscall_filter_enable_event(struct lttng_channel *chan,
- struct lttng_event *event)
+static
+int lttng_syscall_filter_enable(
+ struct lttng_syscall_filter *filter,
+ const char *desc_name, enum lttng_syscall_abi abi,
+ enum lttng_syscall_entryexit entryexit)
{
- struct lttng_syscall_filter *filter = chan->sc_filter;
const char *syscall_name;
unsigned long *bitmap;
int syscall_nr;
- WARN_ON_ONCE(!chan->sc_table);
-
- syscall_name = get_syscall_name(event);
+ syscall_name = get_syscall_name(desc_name, abi, entryexit);
- switch (event->u.syscall.abi) {
+ switch (abi) {
case LTTNG_SYSCALL_ABI_NATIVE:
syscall_nr = get_syscall_nr(syscall_name);
break;
if (syscall_nr < 0)
return -ENOENT;
- switch (event->u.syscall.entryexit) {
+ switch (entryexit) {
case LTTNG_SYSCALL_ENTRY:
- switch (event->u.syscall.abi) {
+ switch (abi) {
case LTTNG_SYSCALL_ABI_NATIVE:
bitmap = filter->sc_entry;
break;
}
break;
case LTTNG_SYSCALL_EXIT:
- switch (event->u.syscall.abi) {
+ switch (abi) {
case LTTNG_SYSCALL_ABI_NATIVE:
bitmap = filter->sc_exit;
break;
return 0;
}
-int lttng_syscall_filter_disable_event(struct lttng_channel *chan,
+int lttng_syscall_filter_enable_event(
+ struct lttng_channel *channel,
struct lttng_event *event)
{
- struct lttng_syscall_filter *filter = chan->sc_filter;
+ WARN_ON_ONCE(event->instrumentation != LTTNG_KERNEL_SYSCALL);
+
+ return lttng_syscall_filter_enable(channel->sc_filter,
+ event->desc->name, event->u.syscall.abi,
+ event->u.syscall.entryexit);
+}
+
+static
+int lttng_syscall_filter_disable(
+ struct lttng_syscall_filter *filter,
+ const char *desc_name, enum lttng_syscall_abi abi,
+ enum lttng_syscall_entryexit entryexit)
+{
const char *syscall_name;
unsigned long *bitmap;
int syscall_nr;
- WARN_ON_ONCE(!chan->sc_table);
+ syscall_name = get_syscall_name(desc_name, abi, entryexit);
- syscall_name = get_syscall_name(event);
-
- switch (event->u.syscall.abi) {
+ switch (abi) {
case LTTNG_SYSCALL_ABI_NATIVE:
syscall_nr = get_syscall_nr(syscall_name);
break;
if (syscall_nr < 0)
return -ENOENT;
- switch (event->u.syscall.entryexit) {
+ switch (entryexit) {
case LTTNG_SYSCALL_ENTRY:
- switch (event->u.syscall.abi) {
+ switch (abi) {
case LTTNG_SYSCALL_ABI_NATIVE:
bitmap = filter->sc_entry;
break;
}
break;
case LTTNG_SYSCALL_EXIT:
- switch (event->u.syscall.abi) {
+ switch (abi) {
case LTTNG_SYSCALL_ABI_NATIVE:
bitmap = filter->sc_exit;
break;
return 0;
}
+int lttng_syscall_filter_disable_event(
+ struct lttng_channel *channel,
+ struct lttng_event *event)
+{
+ return lttng_syscall_filter_disable(channel->sc_filter,
+ event->desc->name, event->u.syscall.abi,
+ event->u.syscall.entryexit);
+}
+
static
const struct trace_syscall_entry *syscall_list_get_entry(loff_t *pos)
{