+/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM ext4
#if !defined(LTTNG_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
#define LTTNG_TRACE_EXT4_H
-#include "../../../probes/lttng-tracepoint-event.h"
+#include <probes/lttng-tracepoint-event.h>
#include <linux/writeback.h>
#include <linux/version.h>
ctf_integer(int, io_done, mpd->io_done)
ctf_integer(int, pages_written, mpd->pages_written)
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
- ctf_integer(int, sync_mode, mpd->sync_mode)
+ ctf_integer(int, sync_mode, mpd->wbc->sync_mode)
#endif
)
)
)
)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
+LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks,
+ TP_PROTO(struct inode *inode),
+
+ TP_ARGS(inode),
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(unsigned int, data_blocks, EXT4_I(inode)->i_reserved_data_blocks)
+ )
+)
+#else
LTTNG_TRACEPOINT_EVENT(ext4_alloc_da_blocks,
TP_PROTO(struct inode *inode),
ctf_integer(unsigned int, meta_blocks, EXT4_I(inode)->i_reserved_meta_blocks)
)
)
+#endif
LTTNG_TRACEPOINT_EVENT(ext4_mballoc_alloc,
TP_PROTO(struct ext4_allocation_context *ac),
)
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
TP_ARGS(inode, used_blocks, quota_claim),
-#else
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(__u64, i_blocks, inode->i_blocks)
+ ctf_integer(int, used_blocks, used_blocks)
+ ctf_integer(int, reserved_data_blocks,
+ EXT4_I(inode)->i_reserved_data_blocks)
+ ctf_integer(int, quota_claim, quota_claim)
+ ctf_integer(TP_MODE_T, mode, inode->i_mode)
+ )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space,
+ TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
+
+ TP_ARGS(inode, used_blocks, quota_claim),
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(__u64, i_blocks, inode->i_blocks)
+ ctf_integer(int, used_blocks, used_blocks)
+ ctf_integer(int, reserved_data_blocks,
+ EXT4_I(inode)->i_reserved_data_blocks)
+ ctf_integer(int, reserved_meta_blocks,
+ EXT4_I(inode)->i_reserved_meta_blocks)
+ ctf_integer(int, allocated_meta_blocks,
+ EXT4_I(inode)->i_allocated_meta_blocks)
+ ctf_integer(int, quota_claim, quota_claim)
+ ctf_integer(TP_MODE_T, mode, inode->i_mode)
+ )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
+LTTNG_TRACEPOINT_EVENT(ext4_da_update_reserve_space,
TP_PROTO(struct inode *inode, int used_blocks),
TP_ARGS(inode, used_blocks),
-#endif
TP_FIELDS(
ctf_integer(dev_t, dev, inode->i_sb->s_dev)
EXT4_I(inode)->i_reserved_meta_blocks)
ctf_integer(int, allocated_meta_blocks,
EXT4_I(inode)->i_allocated_meta_blocks)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
- ctf_integer(int, quota_claim, quota_claim)
+ ctf_integer(TP_MODE_T, mode, inode->i_mode)
+ )
+)
#endif
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
+LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space,
+ TP_PROTO(struct inode *inode),
+
+ TP_ARGS(inode),
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(__u64, i_blocks, inode->i_blocks)
+ ctf_integer(int, reserved_data_blocks,
+ EXT4_I(inode)->i_reserved_data_blocks)
ctf_integer(TP_MODE_T, mode, inode->i_mode)
)
)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0))
+LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space,
+ TP_PROTO(struct inode *inode),
+
+ TP_ARGS(inode),
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(__u64, i_blocks, inode->i_blocks)
+ ctf_integer(int, reserved_data_blocks,
+ EXT4_I(inode)->i_reserved_data_blocks)
+ ctf_integer(int, reserved_meta_blocks,
+ EXT4_I(inode)->i_reserved_meta_blocks)
+ ctf_integer(TP_MODE_T, mode, inode->i_mode)
+ )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
LTTNG_TRACEPOINT_EVENT(ext4_da_reserve_space,
TP_PROTO(struct inode *inode, int md_needed),
ctf_integer(TP_MODE_T, mode, inode->i_mode)
)
)
+#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,13,0))
+LTTNG_TRACEPOINT_EVENT(ext4_da_release_space,
+ TP_PROTO(struct inode *inode, int freed_blocks),
+
+ TP_ARGS(inode, freed_blocks),
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(__u64, i_blocks, inode->i_blocks)
+ ctf_integer(int, freed_blocks, freed_blocks)
+ ctf_integer(int, reserved_data_blocks,
+ EXT4_I(inode)->i_reserved_data_blocks)
+ ctf_integer(TP_MODE_T, mode, inode->i_mode)
+ )
+)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34))
LTTNG_TRACEPOINT_EVENT(ext4_da_release_space,
TP_PROTO(struct inode *inode, int freed_blocks),
TP_FIELDS(
ctf_integer(dev_t, dev, inode->i_sb->s_dev)
ctf_integer(ino_t, ino, inode->i_ino)
- ctf_integer(unsigned int, flags, flags)
ctf_integer(ext4_fsblk_t, pblk, map->m_pblk)
ctf_integer(ext4_lblk_t, lblk, map->m_lblk)
ctf_integer(unsigned int, len, map->m_len)
)
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0))
+
+LTTNG_TRACEPOINT_EVENT(ext4_journal_start,
+ TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
+ int revoke_creds, unsigned long IP),
+
+ TP_ARGS(sb, blocks, rsv_blocks, revoke_creds, IP),
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, sb->s_dev)
+ ctf_integer(unsigned long, ip, IP)
+ ctf_integer(int, blocks, blocks)
+ ctf_integer(int, rsv_blocks, rsv_blocks)
+ ctf_integer(int, revoke_creds, revoke_creds)
+ )
+)
+
+LTTNG_TRACEPOINT_EVENT(ext4_journal_start_reserved,
+ TP_PROTO(struct super_block *sb, int blocks, unsigned long IP),
+
+ TP_ARGS(sb, blocks, IP),
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, sb->s_dev)
+ ctf_integer(unsigned long, ip, IP)
+ ctf_integer(int, blocks, blocks)
+ )
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
LTTNG_TRACEPOINT_EVENT(ext4_journal_start,
TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
)
)
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \
+ LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0))
+
+LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks,
+ TP_PROTO(struct inode *inode, struct ext4_extent *ex,
+ ext4_lblk_t from, ext4_fsblk_t to,
+ struct partial_cluster *pc),
+
+ TP_ARGS(inode, ex, from, to, pc),
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(ext4_lblk_t, from, from)
+ ctf_integer(ext4_lblk_t, to, to)
+ ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex))
+ ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block))
+ ctf_integer(unsigned short, ee_len, ext4_ext_get_actual_len(ex))
+ ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu)
+ ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk)
+ ctf_integer(int, pc_state, pc->state)
+ )
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
LTTNG_TRACEPOINT_EVENT(ext4_remove_blocks,
TP_PROTO(struct inode *inode, struct ext4_extent *ex,
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \
+ LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0))
+
+LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf,
+ TP_PROTO(struct inode *inode, ext4_lblk_t start,
+ struct ext4_extent *ex,
+ struct partial_cluster *pc),
+
+ TP_ARGS(inode, start, ex, pc),
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(ext4_lblk_t, start, start)
+ ctf_integer(ext4_lblk_t, ee_lblk, le32_to_cpu(ex->ee_block))
+ ctf_integer(ext4_fsblk_t, ee_pblk, ext4_ext_pblock(ex))
+ ctf_integer(short, ee_len, ext4_ext_get_actual_len(ex))
+ ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu)
+ ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk)
+ ctf_integer(int, pc_state, pc->state)
+ )
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
LTTNG_TRACEPOINT_EVENT(ext4_ext_rm_leaf,
TP_PROTO(struct inode *inode, ext4_lblk_t start,
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0) || \
+ LTTNG_RHEL_KERNEL_RANGE(4,18,0,147,0,0, 4,19,0,0,0,0))
+
+LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done,
+ TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end,
+ int depth, struct partial_cluster *pc, __le16 eh_entries),
+
+ TP_ARGS(inode, start, end, depth, pc, eh_entries),
+
+ TP_FIELDS(
+ ctf_integer(dev_t, dev, inode->i_sb->s_dev)
+ ctf_integer(ino_t, ino, inode->i_ino)
+ ctf_integer(ext4_lblk_t, start, start)
+ ctf_integer(ext4_lblk_t, end, end)
+ ctf_integer(int, depth, depth)
+ ctf_integer(unsigned short, eh_entries, le16_to_cpu(eh_entries))
+ ctf_integer(ext4_fsblk_t, pc_pclu, pc->pclu)
+ ctf_integer(ext4_lblk_t, pc_lblk, pc->lblk)
+ ctf_integer(int, pc_state, pc->state)
+ )
+)
+
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0))
LTTNG_TRACEPOINT_EVENT(ext4_ext_remove_space_done,
TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end,
#endif /* LTTNG_TRACE_EXT4_H */
/* This part must be outside protection */
-#include "../../../probes/define_trace.h"
+#include <probes/define_trace.h>