*/
enum lttng_kernel_instrumentation {
- LTTNG_KERNEL_ALL = -1, /* Used within lttng-tools */
+ LTTNG_KERNEL_ALL = -1, /* Used within lttng-tools */
LTTNG_KERNEL_TRACEPOINT = 0,
LTTNG_KERNEL_KPROBE = 1,
LTTNG_KERNEL_FUNCTION = 2,
ret = kernctl_create_event(channel->fd, event->event);
if (ret < 0) {
- perror("create event ioctl");
+ PERROR("create event ioctl");
goto free_event;
}
+ /*
+ * LTTNG_KERNEL_SYSCALL event creation will return 0 on success. However
+ * this FD must not be added to the event list.
+ */
+ if (ret == 0 && event->event->instrumentation == LTTNG_KERNEL_SYSCALL) {
+ DBG2("Kernel event syscall creation success");
+ goto end;
+ }
+
event->fd = ret;
/* Prevent fd duplication after execlp() */
ret = fcntl(event->fd, F_SETFD, FD_CLOEXEC);
DBG("Event %s created (fd: %d)", ev->name, event->fd);
+end:
return 0;
free_event:
while (1) {
if (update_poll_flag == 1) {
+ /*
+ * Reset number of fd in the poll set. Always 2 since there is the thread
+ * quit pipe and the kernel pipe.
+ */
+ events.nb_fd = 2;
+
ret = update_kernel_poll(&events);
if (ret < 0) {
goto error;
int found = 0;
struct ltt_session *iter;
+ DBG2("Trying to find session by name %s", name);
+
session_lock_list();
cds_list_for_each_entry(iter, <t_session_list.head, list) {
if (strncmp(iter->name, name, NAME_MAX) == 0) {