)
#endif
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,10,0))
+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_tree_ref,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_delayed_ref_node *ref),
+
+ TP_ARGS(fs_info, ref),
+
+ TP_FIELDS(
+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
+ ctf_integer(u64, bytenr, ref->bytenr)
+ ctf_integer(u64, num_bytes, ref->num_bytes)
+ ctf_integer(int, action, ref->action)
+ ctf_integer(u64, parent, ref->parent)
+ ctf_integer(u64, ref_root, ref->ref_root)
+ ctf_integer(int, level, ref->tree_ref.level)
+ ctf_integer(int, type, ref->type)
+ ctf_integer(u64, seq, ref->seq)
+ )
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
+
+ add_delayed_tree_ref,
+
+ btrfs_add_delayed_tree_ref,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_delayed_ref_node *ref),
+
+ TP_ARGS(fs_info, ref)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_tree_ref,
+
+ run_delayed_tree_ref,
+
+ btrfs_run_delayed_tree_ref,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_delayed_ref_node *ref),
+
+ TP_ARGS(fs_info, ref)
+)
+#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \
LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
)
#endif
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,10,0))
+LTTNG_TRACEPOINT_EVENT_CLASS(btrfs_delayed_data_ref,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_delayed_ref_node *ref),
+
+ TP_ARGS(fs_info, ref),
+
+ TP_FIELDS(
+ ctf_array(u8, fsid, lttng_fs_info_fsid, BTRFS_UUID_SIZE)
+ ctf_integer(u64, bytenr, ref->bytenr)
+ ctf_integer(u64, num_bytes, ref->num_bytes)
+ ctf_integer(int, action, ref->action)
+ ctf_integer(u64, parent, ref->parent)
+ ctf_integer(u64, ref_root, ref->ref_root)
+ ctf_integer(u64, owner, ref->data_ref.objectid)
+ ctf_integer(u64, offset, ref->data_ref.offset)
+ ctf_integer(int, type, ref->type)
+ ctf_integer(u64, seq, ref->seq)
+ )
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
+
+ add_delayed_data_ref,
+
+ btrfs_add_delayed_data_ref,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_delayed_ref_node *ref),
+
+ TP_ARGS(fs_info, ref)
+)
+
+LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(btrfs_delayed_data_ref,
+
+ run_delayed_data_ref,
+
+ btrfs_run_delayed_data_ref,
+
+ TP_PROTO(const struct btrfs_fs_info *fs_info,
+ const struct btrfs_delayed_ref_node *ref),
+
+ TP_ARGS(fs_info, ref)
+)
+
+#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0) || \
LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
)
)
-#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,7,0))
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,7,0) || \
+ LTTNG_RHEL_KERNEL_RANGE(5,14,0,427,16,1, 5,15,0,0,0,0))
LTTNG_TRACEPOINT_EVENT(mm_vmscan_lru_isolate,
TP_PROTO(int classzone_idx,
#include <lttng/tracepoint-event.h>
#include <linux/udp.h>
+#include <lttng/kernel-version.h>
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,10,0))
+LTTNG_TRACEPOINT_ENUM(lttng_sk_family,
+ TP_ENUM_VALUES(
+ ctf_enum_value("AF_INET", AF_INET)
+ ctf_enum_value("AF_INET6", AF_INET6)
+ )
+)
+
+LTTNG_TRACEPOINT_EVENT(udp_fail_queue_rcv_skb,
+
+ TP_PROTO(int rc, struct sock *sk, struct sk_buff *skb),
+
+ TP_ARGS(rc, sk, skb),
+
+ TP_FIELDS(
+ ctf_integer(int, rc, rc)
+ ctf_integer(__u16, sport, ntohs(udp_hdr(skb)->source))
+ ctf_integer(__u16, dport, ntohs(udp_hdr(skb)->dest))
+ ctf_enum(lttng_sk_family, __u16, family, sk->sk_family)
+ /*
+ * The 'saddr' and 'daddr' fields from the upstream tracepoint
+ * are currently not extracted. It is recommended to use a
+ * tracepoint from the 'net' probe instead which includes all
+ * fields from the IP header.
+ */
+ )
+)
+#else
LTTNG_TRACEPOINT_EVENT(udp_fail_queue_rcv_skb,
TP_PROTO(int rc, struct sock *sk),
ctf_integer(__u16, lport, inet_sk(sk)->inet_num)
)
)
+#endif
#endif /* LTTNG_TRACE_UDP_H */
lttng_tp_mempool_free(tp_locvar->fds_ex);
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM)
+/*
+ * Instead of extracting the user-space pointers of the 3 fd_set,
+ * extract the bitmask of the FDs in the sets (in, out, ex) in the form
+ * of an array of uint8_t (1024 FDs is the limit in the kernel).
+ */
#define OVERRIDE_32_select
#define OVERRIDE_64_select
SC_LTTNG_TRACEPOINT_EVENT_CODE(select,
#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM) */
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM64) || defined(CONFIG_ARM)
+/*
+ * Instead of extracting the user-space pointers of the 3 fd_set,
+ * extract the bitmask of the FDs in the sets (in, out, ex) in the form
+ * of an array of uint8_t (1024 FDs is the limit in the kernel).
+ */
#define OVERRIDE_32_pselect6
#define OVERRIDE_64_pselect6
SC_LTTNG_TRACEPOINT_EVENT_CODE(pselect6,
)
#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM64) || defined(CONFIG_ARM) */
+#if defined(CONFIG_X86_32) || defined(CONFIG_ARM)
+/*
+ * Instead of extracting the user-space pointers of the 3 fd_set,
+ * extract the bitmask of the FDs in the sets (in, out, ex) in the form
+ * of an array of uint8_t (1024 FDs is the limit in the kernel).
+ */
+#define OVERRIDE_32_pselect6_time32
+SC_LTTNG_TRACEPOINT_EVENT_CODE(pselect6_time32,
+ TP_PROTO(sc_exit(long ret,) int n, fd_set __user * inp, fd_set __user * outp,
+ fd_set __user * exp, struct old_timespec32 __user * tvp, void __user * sig),
+ TP_ARGS(sc_exit(ret,) n, inp, outp, exp, tvp, sig),
+ TP_locvar(
+ LTTNG_SYSCALL_SELECT_locvar
+ ),
+ TP_code_pre(
+ LTTNG_SYSCALL_SELECT_code_pre
+ ),
+ TP_FIELDS(
+ sc_exit(ctf_integer(long, ret, ret))
+ sc_in(ctf_integer(int, n, n))
+ sc_inout(ctf_integer(uint8_t, overflow, tp_locvar->overflow))
+ sc_inout(ctf_integer(struct old_timespec32 *, tvp, tvp))
+ sc_in(ctf_integer_hex(void *, sig, sig))
+
+ sc_inout(
+#if (__BYTE_ORDER == __LITTLE_ENDIAN)
+ LTTNG_SYSCALL_SELECT_fds_field_LE(readfds, inp)
+ LTTNG_SYSCALL_SELECT_fds_field_LE(writefds, outp)
+ LTTNG_SYSCALL_SELECT_fds_field_LE(exceptfds, exp)
+#else
+ LTTNG_SYSCALL_SELECT_fds_field_BE(readfds, inp)
+ LTTNG_SYSCALL_SELECT_fds_field_BE(writefds, outp)
+ LTTNG_SYSCALL_SELECT_fds_field_BE(exceptfds, exp)
+#endif
+ )
+ ),
+ TP_code_post(
+ LTTNG_SYSCALL_SELECT_code_post
+ )
+)
+#endif /* defined(CONFIG_X86_32) || defined(CONFIG_ARM) */
+
#ifdef LTTNG_CREATE_FIELD_METADATA
#ifndef ONCE_LTTNG_TRACE_POLL_H
#define ONCE_LTTNG_TRACE_POLL_H
lttng_tp_mempool_free(tp_locvar->fds);
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM)
+/*
+ * Instead of printing the pointer address of the poll set, extract all the FDs
+ * and flags from the poll set. For now, only output the standardized
+ * set of events to limit the verbosity of the output, and also extract
+ * the raw value. In the future, moving to CTF2 will allow hiding unset
+ * fields and then allow extracting all the fields.
+ */
#define OVERRIDE_32_poll
#define OVERRIDE_64_poll
SC_LTTNG_TRACEPOINT_EVENT_CODE(poll,
#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM) */
#if defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM64) || defined(CONFIG_ARM)
+/*
+ * Instead of printing the pointer address of the poll set, extract all the FDs
+ * and flags from the poll set. For now, only output the standardized
+ * set of events to limit the verbosity of the output, and also extract
+ * the raw value. In the future, moving to CTF2 will allow hiding unset
+ * fields and then allow extracting all the fields.
+ */
#define OVERRIDE_32_ppoll
#define OVERRIDE_64_ppoll
SC_LTTNG_TRACEPOINT_EVENT_CODE(ppoll,
)
#endif /* defined(CONFIG_X86_32) || defined(CONFIG_X86_64) || defined(CONFIG_ARM64) || defined(CONFIG_ARM) */
+#if defined(CONFIG_X86_32) || defined(CONFIG_ARM)
+/*
+ * Instead of printing the pointer address of the poll set, extract all the FDs
+ * and flags from the poll set. For now, only output the standardized
+ * set of events to limit the verbosity of the output, and also extract
+ * the raw value. In the future, moving to CTF2 will allow hiding unset
+ * fields and then allow extracting all the fields.
+ */
+#define OVERRIDE_32_ppoll_time32
+SC_LTTNG_TRACEPOINT_EVENT_CODE(ppoll_time32,
+ TP_PROTO(sc_exit(long ret,) struct pollfd __user * ufds,
+ unsigned int nfds, struct old_timespec32 * tsp, const sigset_t * sigmask, size_t sigsetsize),
+ TP_ARGS(sc_exit(ret,) ufds, nfds, tsp, sigmask, sigsetsize),
+ TP_locvar(
+ LTTNG_SYSCALL_POLL_locvar
+ ),
+ TP_code_pre(
+ LTTNG_SYSCALL_POLL_code_pre
+ ),
+ TP_FIELDS(
+ sc_exit(ctf_integer(long, ret, ret))
+ sc_in(ctf_integer(struct old_timespec32 *, tsp, tsp))
+ sc_in(ctf_integer(const sigset_t *, sigmask, sigmask))
+ sc_in(ctf_integer(size_t, sigsetsize, sigsetsize))
+ sc_inout(ctf_integer(unsigned int, nfds, nfds))
+ sc_inout(ctf_integer(unsigned int, fds_length, tp_locvar->fds_length))
+ sc_inout(ctf_integer(uint8_t, overflow, tp_locvar->overflow))
+ LTTNG_SYSCALL_POLL_fds_field
+ ),
+ TP_code_post(
+ LTTNG_SYSCALL_POLL_code_post
+ )
+)
+#endif /* defined(CONFIG_X86_32) || defined(CONFIG_ARM) */
+
#include <linux/eventpoll.h>
SC_LTTNG_TRACEPOINT_ENUM(lttng_epoll_op,
}
#endif
+#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,10,0))
+static inline
+bool lttng_close_on_exec(unsigned int fd, const struct files_struct *files)
+{
+ return close_on_exec(fd, files);
+}
+#else
+static inline
+bool lttng_close_on_exec(unsigned int fd, const struct files_struct *files)
+{
+ return close_on_exec(fd, files_fdtable(files));
+}
+#endif
+
#endif /* _LTTNG_WRAPPER_FDTABLE_H */
#include <wrapper/fdtable.h>
#include <wrapper/tracepoint.h>
#include <wrapper/blkdev.h>
-#include <wrapper/fdtable.h>
#include <wrapper/sched.h>
/* Define the tracepoints, but do not build the probes */
* the lock is taken, but we are not aware whether this is
* guaranteed or not, so play safe.
*/
- if (fd < fdt->max_fds && close_on_exec(fd, fdt))
+ if (fd < fdt->max_fds && lttng_close_on_exec(fd, ctx->files))
flags |= O_CLOEXEC;
if (IS_ERR(s)) {
struct dentry *dentry = file->f_path.dentry;