include/trace/events/writeback.h
Source file repositories/reference/linux-study-clean/include/trace/events/writeback.h
File Facts
- System
- Linux kernel
- Corpus path
include/trace/events/writeback.h- Extension
.h- Size
- 23240 bytes
- Lines
- 887
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/tracepoint.hlinux/backing-dev.hlinux/writeback.htrace/define_trace.h
Detected Declarations
struct wb_writeback_workfunction EMfunction __trace_wb_assign_cgroupfunction __trace_wbc_assign_cgroupfunction __trace_wb_assign_cgroupfunction __trace_wbc_assign_cgroup
Annotated Snippet
#undef TRACE_SYSTEM
#define TRACE_SYSTEM writeback
#if !defined(_TRACE_WRITEBACK_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_WRITEBACK_H
#include <linux/tracepoint.h>
#include <linux/backing-dev.h>
#include <linux/writeback.h>
#define show_inode_state(state) \
__print_flags(state, "|", \
{I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
{I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
{I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
{I_NEW, "I_NEW"}, \
{I_WILL_FREE, "I_WILL_FREE"}, \
{I_FREEING, "I_FREEING"}, \
{I_CLEAR, "I_CLEAR"}, \
{I_SYNC, "I_SYNC"}, \
{I_DIRTY_TIME, "I_DIRTY_TIME"}, \
{I_REFERENCED, "I_REFERENCED"}, \
{I_LINKABLE, "I_LINKABLE"}, \
{I_WB_SWITCH, "I_WB_SWITCH"}, \
{I_OVL_INUSE, "I_OVL_INUSE"}, \
{I_CREATING, "I_CREATING"}, \
{I_DONTCACHE, "I_DONTCACHE"}, \
{I_SYNC_QUEUED, "I_SYNC_QUEUED"}, \
{I_PINNING_NETFS_WB, "I_PINNING_NETFS_WB"}, \
{I_LRU_ISOLATING, "I_LRU_ISOLATING"} \
)
/* enums need to be exported to user space */
#undef EM
#undef EMe
#define EM(a,b) TRACE_DEFINE_ENUM(a);
#define EMe(a,b) TRACE_DEFINE_ENUM(a);
#define WB_WORK_REASON \
EM( WB_REASON_BACKGROUND, "background") \
EM( WB_REASON_VMSCAN, "vmscan") \
EM( WB_REASON_SYNC, "sync") \
EM( WB_REASON_PERIODIC, "periodic") \
EM( WB_REASON_FS_FREE_SPACE, "fs_free_space") \
EM( WB_REASON_FORKER_THREAD, "forker_thread") \
EM( WB_REASON_FOREIGN_FLUSH, "foreign_flush") \
EMe(WB_REASON_DONTCACHE, "dontcache")
WB_WORK_REASON
/*
* Now redefine the EM() and EMe() macros to map the enums to the strings
* that will be printed in the output.
*/
#undef EM
#undef EMe
#define EM(a,b) { a, b },
#define EMe(a,b) { a, b }
struct wb_writeback_work;
DECLARE_EVENT_CLASS(writeback_folio_template,
TP_PROTO(struct folio *folio, struct address_space *mapping),
TP_ARGS(folio, mapping),
TP_STRUCT__entry (
__array(char, name, 32)
__field(u64, ino)
__field(pgoff_t, index)
),
TP_fast_assign(
strscpy_pad(__entry->name,
bdi_dev_name(mapping ? inode_to_bdi(mapping->host) :
NULL), 32);
__entry->ino = (mapping && mapping->host) ? mapping->host->i_ino : 0;
__entry->index = folio->index;
),
TP_printk("bdi %s: ino=%llu index=%lu",
__entry->name,
__entry->ino,
__entry->index
)
);
DEFINE_EVENT(writeback_folio_template, writeback_dirty_folio,
Annotation
- Immediate include surface: `linux/tracepoint.h`, `linux/backing-dev.h`, `linux/writeback.h`, `trace/define_trace.h`.
- Detected declarations: `struct wb_writeback_work`, `function EM`, `function __trace_wb_assign_cgroup`, `function __trace_wbc_assign_cgroup`, `function __trace_wb_assign_cgroup`, `function __trace_wbc_assign_cgroup`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.