+ case LTTNG_KERNEL_SESSION_TRACK_PID:
+ return lttng_session_track_id(session, TRACKER_PID, (int) arg);
+ case LTTNG_KERNEL_SESSION_UNTRACK_PID:
+ return lttng_session_untrack_id(session, TRACKER_PID, (int) arg);
+ case LTTNG_KERNEL_SESSION_TRACK_ID:
+ {
+ struct lttng_kernel_tracker_args tracker;
+ enum tracker_type tracker_type;
+
+ if (copy_from_user(&tracker,
+ (struct lttng_kernel_tracker_args __user *) arg,
+ sizeof(struct lttng_kernel_tracker_args)))
+ return -EFAULT;
+ tracker_type = get_tracker_type(&tracker);
+ if (tracker_type == TRACKER_UNKNOWN)
+ return -EINVAL;
+ return lttng_session_track_id(session, tracker_type, tracker.id);
+ }
+ case LTTNG_KERNEL_SESSION_UNTRACK_ID:
+ {
+ struct lttng_kernel_tracker_args tracker;
+ enum tracker_type tracker_type;
+
+ if (copy_from_user(&tracker,
+ (struct lttng_kernel_tracker_args __user *) arg,
+ sizeof(struct lttng_kernel_tracker_args)))
+ return -EFAULT;
+ tracker_type = get_tracker_type(&tracker);
+ if (tracker_type == TRACKER_UNKNOWN)
+ return -EINVAL;
+ return lttng_session_untrack_id(session, tracker_type,
+ tracker.id);
+ }
+ case LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS:
+ return lttng_session_list_tracker_ids(session, TRACKER_PID);
+ case LTTNG_KERNEL_SESSION_LIST_TRACKER_IDS:
+ {
+ struct lttng_kernel_tracker_args tracker;
+ enum tracker_type tracker_type;
+
+ if (copy_from_user(&tracker,
+ (struct lttng_kernel_tracker_args __user *) arg,
+ sizeof(struct lttng_kernel_tracker_args)))
+ return -EFAULT;
+ tracker_type = get_tracker_type(&tracker);
+ if (tracker_type == TRACKER_UNKNOWN)
+ return -EINVAL;
+ return lttng_session_list_tracker_ids(session, tracker_type);
+ }
+ case LTTNG_KERNEL_SESSION_METADATA_REGEN:
+ return lttng_session_metadata_regenerate(session);
+ case LTTNG_KERNEL_SESSION_STATEDUMP:
+ return lttng_session_statedump(session);
+ case LTTNG_KERNEL_SESSION_SET_NAME:
+ {
+ struct lttng_kernel_session_name name;
+
+ if (copy_from_user(&name,
+ (struct lttng_kernel_session_name __user *) arg,
+ sizeof(struct lttng_kernel_session_name)))
+ return -EFAULT;
+ return lttng_abi_session_set_name(session, &name);
+ }
+ case LTTNG_KERNEL_SESSION_SET_CREATION_TIME:
+ {
+ struct lttng_kernel_session_creation_time time;
+
+ if (copy_from_user(&time,
+ (struct lttng_kernel_session_creation_time __user *) arg,
+ sizeof(struct lttng_kernel_session_creation_time)))
+ return -EFAULT;
+ return lttng_abi_session_set_creation_time(session, &time);
+ }