fs/ext2/trace.h
Source file repositories/reference/linux-study-clean/fs/ext2/trace.h
File Facts
- System
- Linux kernel
- Corpus path
fs/ext2/trace.h- Extension
.h- Size
- 2722 bytes
- Lines
- 95
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/tracepoint.htrace/define_trace.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#undef TRACE_SYSTEM
#define TRACE_SYSTEM ext2
#if !defined(_EXT2_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _EXT2_TRACE_H
#include <linux/tracepoint.h>
DECLARE_EVENT_CLASS(ext2_dio_class,
TP_PROTO(struct kiocb *iocb, struct iov_iter *iter, ssize_t ret),
TP_ARGS(iocb, iter, ret),
TP_STRUCT__entry(
__field(dev_t, dev)
__field(u64, ino)
__field(loff_t, isize)
__field(loff_t, pos)
__field(size_t, count)
__field(int, ki_flags)
__field(bool, aio)
__field(ssize_t, ret)
),
TP_fast_assign(
__entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
__entry->ino = file_inode(iocb->ki_filp)->i_ino;
__entry->isize = file_inode(iocb->ki_filp)->i_size;
__entry->pos = iocb->ki_pos;
__entry->count = iov_iter_count(iter);
__entry->ki_flags = iocb->ki_flags;
__entry->aio = !is_sync_kiocb(iocb);
__entry->ret = ret;
),
TP_printk("dev %d:%d ino 0x%llx isize 0x%llx pos 0x%llx len %zu flags %s aio %d ret %zd",
MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->ino,
__entry->isize,
__entry->pos,
__entry->count,
__print_flags(__entry->ki_flags, "|", TRACE_IOCB_STRINGS),
__entry->aio,
__entry->ret)
);
#define DEFINE_DIO_RW_EVENT(name) \
DEFINE_EVENT(ext2_dio_class, name, \
TP_PROTO(struct kiocb *iocb, struct iov_iter *iter, ssize_t ret), \
TP_ARGS(iocb, iter, ret))
DEFINE_DIO_RW_EVENT(ext2_dio_write_begin);
DEFINE_DIO_RW_EVENT(ext2_dio_write_end);
DEFINE_DIO_RW_EVENT(ext2_dio_write_buff_end);
DEFINE_DIO_RW_EVENT(ext2_dio_read_begin);
DEFINE_DIO_RW_EVENT(ext2_dio_read_end);
TRACE_EVENT(ext2_dio_write_endio,
TP_PROTO(struct kiocb *iocb, ssize_t size, int ret),
TP_ARGS(iocb, size, ret),
TP_STRUCT__entry(
__field(dev_t, dev)
__field(u64, ino)
__field(loff_t, isize)
__field(loff_t, pos)
__field(ssize_t, size)
__field(int, ki_flags)
__field(bool, aio)
__field(int, ret)
),
TP_fast_assign(
__entry->dev = file_inode(iocb->ki_filp)->i_sb->s_dev;
__entry->ino = file_inode(iocb->ki_filp)->i_ino;
__entry->isize = file_inode(iocb->ki_filp)->i_size;
__entry->pos = iocb->ki_pos;
__entry->size = size;
__entry->ki_flags = iocb->ki_flags;
__entry->aio = !is_sync_kiocb(iocb);
__entry->ret = ret;
),
TP_printk("dev %d:%d ino 0x%llx isize 0x%llx pos 0x%llx len %zd flags %s aio %d ret %d",
MAJOR(__entry->dev), MINOR(__entry->dev),
__entry->ino,
__entry->isize,
__entry->pos,
__entry->size,
__print_flags(__entry->ki_flags, "|", TRACE_IOCB_STRINGS),
__entry->aio,
__entry->ret)
);
#endif /* _EXT2_TRACE_H */
Annotation
- Immediate include surface: `linux/tracepoint.h`, `trace/define_trace.h`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.