return LTTNG_IOCTL_NO_CHECK(fd, LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS);
}
+static enum lttng_kernel_tracker_type get_kernel_tracker_type(
+ enum lttng_tracker_type type)
+{
+ switch (type) {
+ case LTTNG_TRACKER_PID:
+ return LTTNG_KERNEL_TRACKER_PID;
+ case LTTNG_TRACKER_VPID:
+ return LTTNG_KERNEL_TRACKER_VPID;
+ case LTTNG_TRACKER_UID:
+ return LTTNG_KERNEL_TRACKER_UID;
+ case LTTNG_TRACKER_VUID:
+ return LTTNG_KERNEL_TRACKER_VUID;
+ case LTTNG_TRACKER_GID:
+ return LTTNG_KERNEL_TRACKER_GID;
+ case LTTNG_TRACKER_VGID:
+ return LTTNG_KERNEL_TRACKER_VGID;
+ default:
+ return LTTNG_KERNEL_TRACKER_UNKNOWN;
+ }
+}
+
+int kernctl_track_id(int fd, enum lttng_tracker_type tracker_type, int id)
+{
+ struct lttng_kernel_tracker_args args;
+
+ args.id = id;
+ args.type = get_kernel_tracker_type(tracker_type);
+ if (args.type == LTTNG_KERNEL_TRACKER_UNKNOWN) {
+ errno = EINVAL;
+ return -1;
+ }
+ return LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_SESSION_TRACK_ID, &args);
+}
+
+int kernctl_untrack_id(int fd, enum lttng_tracker_type tracker_type, int id)
+{
+ struct lttng_kernel_tracker_args args;
+
+ args.id = id;
+ args.type = get_kernel_tracker_type(tracker_type);
+ if (args.type == LTTNG_KERNEL_TRACKER_UNKNOWN) {
+ errno = EINVAL;
+ return -1;
+ }
+ return LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_SESSION_UNTRACK_ID, &args);
+}
+
+int kernctl_list_tracker_ids(int fd, enum lttng_tracker_type tracker_type)
+{
+ struct lttng_kernel_tracker_args args;
+
+ args.id = -1;
+ args.type = get_kernel_tracker_type(tracker_type);
+ if (args.type == LTTNG_KERNEL_TRACKER_UNKNOWN) {
+ errno = EINVAL;
+ return -1;
+ }
+ return LTTNG_IOCTL_NO_CHECK(
+ fd, LTTNG_KERNEL_SESSION_LIST_TRACKER_IDS, &args);
+}
+
int kernctl_session_regenerate_metadata(int fd)
{
return LTTNG_IOCTL_CHECK(fd, LTTNG_KERNEL_SESSION_METADATA_REGEN);
int kernctl_untrack_pid(int fd, int pid);
int kernctl_list_tracker_pids(int fd);
+int kernctl_track_id(int fd, enum lttng_tracker_type tracker_type, int id);
+int kernctl_untrack_id(int fd, enum lttng_tracker_type tracker_type, int id);
+int kernctl_list_tracker_ids(int fd, enum lttng_tracker_type tracker_type);
+
int kernctl_session_regenerate_metadata(int fd);
int kernctl_session_regenerate_statedump(int fd);
int kernctl_session_set_name(int fd, const char *name);
#define LTTNG_KERNEL_FILTER _IO(0xF6, 0x90)
#define LTTNG_KERNEL_ADD_CALLSITE _IO(0xF6, 0x91)
+/* Session FD ioctl (continued) */
+#define LTTNG_KERNEL_SESSION_LIST_TRACKER_IDS \
+ _IOR(0xF6, 0xA0, struct lttng_kernel_tracker_args)
+#define LTTNG_KERNEL_SESSION_TRACK_ID \
+ _IOR(0xF6, 0xA1, struct lttng_kernel_tracker_args)
+#define LTTNG_KERNEL_SESSION_UNTRACK_ID \
+ _IOR(0xF6, 0xA2, struct lttng_kernel_tracker_args)
+
#endif /* _LTT_KERNEL_IOCTL_H */
char iso8601[LTTNG_KERNEL_SESSION_CREATION_TIME_ISO8601_LEN];
} LTTNG_PACKED;
+enum lttng_kernel_tracker_type {
+ LTTNG_KERNEL_TRACKER_UNKNOWN = -1,
+
+ LTTNG_KERNEL_TRACKER_PID = 0,
+ LTTNG_KERNEL_TRACKER_VPID = 1,
+ LTTNG_KERNEL_TRACKER_UID = 2,
+ LTTNG_KERNEL_TRACKER_VUID = 3,
+ LTTNG_KERNEL_TRACKER_GID = 4,
+ LTTNG_KERNEL_TRACKER_VGID = 5,
+};
+
+struct lttng_kernel_tracker_args {
+ enum lttng_kernel_tracker_type type;
+ int32_t id;
+};
+
#endif /* _LTTNG_KERNEL_H */