LTTNG_KERNEL_KPROBE = 1,
LTTNG_KERNEL_FUNCTION = 2,
LTTNG_KERNEL_KRETPROBE = 3,
+ LTTNG_KERNEL_NOOP = 4, /* not hooked */
+ LTTNG_KERNEL_SYSCALLS = 5,
};
enum lttng_kernel_context_type {
LTTNG_EVENT_PROBE,
LTTNG_EVENT_FUNCTION,
LTTNG_EVENT_FUNCTION_ENTRY,
+ LTTNG_EVENT_NOOP,
+ LTTNG_EVENT_SYSCALLS,
};
/*
copy_lttng_domain(&lsm.domain, &handle->domain);
- if (ev) {
+ if (ev || ev->name[0] != '\0') {
lsm.cmd_type = LTTNG_ENABLE_EVENT;
memcpy(&lsm.u.enable.event, ev, sizeof(lsm.u.enable.event));
} else {
memcpy(&events[i].attr.ftrace, &event->event->u.ftrace,
sizeof(struct lttng_kernel_function));
break;
+ case LTTNG_KERNEL_NOOP:
+ events[i].type = LTTNG_EVENT_NOOP;
+ break;
+ case LTTNG_KERNEL_SYSCALLS:
+ events[i].type = LTTNG_EVENT_SYSCALLS;
+ break;
}
i++;
}
case LTTNG_EVENT_TRACEPOINT:
attr->instrumentation = LTTNG_KERNEL_TRACEPOINT;
break;
+ case LTTNG_EVENT_SYSCALLS:
+ attr->instrumentation = LTTNG_KERNEL_SYSCALLS;
+ break;
default:
ERR("Unknown kernel instrumentation type (%d)", ev->type);
goto error;
OPT_PROBE,
OPT_FUNCTION,
OPT_FUNCTION_ENTRY,
+ OPT_SYSCALLS,
};
static struct lttng_handle *handle;
{"probe", 0, POPT_ARG_NONE, 0, OPT_PROBE, 0, 0},
{"function", 0, POPT_ARG_NONE, 0, OPT_FUNCTION, 0, 0},
{"function:entry", 0, POPT_ARG_NONE, 0, OPT_FUNCTION_ENTRY, 0, 0},
+ {"syscalls", 0, POPT_ARG_NONE, 0, OPT_SYSCALLS, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
};
fprintf(ofp, " Dynamic function entry/return probe.\n");
fprintf(ofp, " --function:entry symbol\n");
fprintf(ofp, " Function tracer event\n");
+ fprintf(ofp, " --syscalls System calls\n");
fprintf(ofp, " --marker User-space marker (deprecated)\n");
fprintf(ofp, "\n");
}
case LTTNG_EVENT_FUNCTION_ENTRY:
DBG("Calibrating kernel function entry");
break;
+ case LTTNG_EVENT_SYSCALLS:
+ DBG("Calibrating kernel syscalls");
+ break;
default:
ret = CMD_NOT_IMPLEMENTED;
goto end;
case OPT_FUNCTION_ENTRY:
ret = CMD_NOT_IMPLEMENTED;
break;
+ case OPT_SYSCALLS:
+ ret = CMD_NOT_IMPLEMENTED;
+ break;
default:
usage(stderr);
ret = CMD_UNDEFINED;
OPT_PROBE,
OPT_FUNCTION,
OPT_FUNCTION_ENTRY,
+ OPT_SYSCALLS,
};
static struct lttng_handle *handle;
{"probe", 0, POPT_ARG_STRING, 0, OPT_PROBE, 0, 0},
{"function", 0, POPT_ARG_STRING, 0, OPT_FUNCTION, 0, 0},
{"function:entry", 0, POPT_ARG_STRING, 0, OPT_FUNCTION_ENTRY, 0, 0},
+ {"syscalls", 0, POPT_ARG_NONE, 0, OPT_SYSCALLS, 0, 0},
{0, 0, 0, 0, 0, 0, 0}
};
fprintf(ofp, " decimal (NNN...) or hexadecimal (0xNNN...)\n");
fprintf(ofp, " --function:entry symbol\n");
fprintf(ofp, " Function tracer event\n");
+ fprintf(ofp, " --syscalls System calls\n");
fprintf(ofp, " --marker User-space marker (deprecated)\n");
fprintf(ofp, "\n");
}
}
if (opt_enable_all) {
- if (opt_kernel) {
- ret = lttng_enable_event(handle, NULL, channel_name);
- if (ret == 0) {
- MSG("All kernel events are enabled in channel %s", channel_name);
+ switch (opt_event_type) {
+ case LTTNG_EVENT_TRACEPOINT:
+ if (opt_kernel) {
+ ret = lttng_enable_event(handle, NULL, channel_name);
+ if (ret == 0) {
+ MSG("All kernel events are enabled in channel %s", channel_name);
+ }
+ goto error;
+ }
+ /* TODO: User-space tracer */
+ break;
+ case LTTNG_EVENT_SYSCALLS:
+ if (opt_kernel) {
+ ev.name[0] = '\0';
+ ev.type = opt_event_type;
+
+ ret = lttng_enable_event(handle, &ev, channel_name);
+ if (ret == 0) {
+ MSG("All kernel system calls are enabled in channel %s", channel_name);
+ }
+ goto error;
}
+ break;
+ default:
+ MSG("Enable all not supported for this instrumentation type.");
goto error;
}
-
- /* TODO: User-space tracer */
}
/* Strip event list */
LTTNG_SYMBOL_NAME_LEN);
ev.attr.ftrace.symbol_name[LTTNG_SYMBOL_NAME_LEN - 1] = '\0';
break;
+ case LTTNG_EVENT_SYSCALLS:
+ MSG("per-syscall selection not supported yet. Use \"-a\" for all syscalls.");
+ ret = CMD_NOT_IMPLEMENTED;
+ goto error;
default:
ret = CMD_NOT_IMPLEMENTED;
goto error;
opt_event_type = LTTNG_EVENT_FUNCTION_ENTRY;
opt_function_entry_symbol = poptGetOptArg(pc);
break;
+ case OPT_SYSCALLS:
+ opt_event_type = LTTNG_EVENT_SYSCALLS;
+ break;
default:
usage(stderr);
ret = CMD_UNDEFINED;
events[i].name, events[i].enabled);
MSG("%ssymbol: \"%s\"", indent8, events[i].attr.ftrace.symbol_name);
break;
+ case LTTNG_EVENT_SYSCALLS:
+ MSG("%s (type: syscalls) [enabled: %d]", indent6,
+ events[i].enabled);
+ break;
+ case LTTNG_EVENT_NOOP:
+ MSG("%s (type: noop) [enabled: %d]", indent6,
+ events[i].enabled);
+ break;
}
}