include/trace/events/page_ref.h
Source file repositories/reference/linux-study-clean/include/trace/events/page_ref.h
File Facts
- System
- Linux kernel
- Corpus path
include/trace/events/page_ref.h- Extension
.h- Size
- 3058 bytes
- Lines
- 136
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/page_ref.hlinux/tracepoint.htrace/events/mmflags.htrace/define_trace.h
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
#undef TRACE_SYSTEM
#define TRACE_SYSTEM page_ref
#if !defined(_TRACE_PAGE_REF_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_PAGE_REF_H
#include <linux/types.h>
#include <linux/page_ref.h>
#include <linux/tracepoint.h>
#include <trace/events/mmflags.h>
DECLARE_EVENT_CLASS(page_ref_mod_template,
TP_PROTO(struct page *page, int v),
TP_ARGS(page, v),
TP_STRUCT__entry(
__field(unsigned long, pfn)
__field(unsigned long, flags)
__field(int, count)
__field(int, mapcount)
__field(void *, mapping)
__field(int, mt)
__field(int, val)
),
TP_fast_assign(
__entry->pfn = page_to_pfn(page);
__entry->flags = page->flags.f;
__entry->count = page_ref_count(page);
__entry->mapcount = atomic_read(&page->_mapcount);
__entry->mapping = page->mapping;
__entry->mt = get_pageblock_migratetype(page);
__entry->val = v;
),
TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d",
__entry->pfn,
show_page_flags(__entry->flags & PAGEFLAGS_MASK),
__entry->count,
__entry->mapcount, __entry->mapping, __entry->mt,
__entry->val)
);
DEFINE_EVENT(page_ref_mod_template, page_ref_set,
TP_PROTO(struct page *page, int v),
TP_ARGS(page, v)
);
DEFINE_EVENT(page_ref_mod_template, page_ref_mod,
TP_PROTO(struct page *page, int v),
TP_ARGS(page, v)
);
DECLARE_EVENT_CLASS(page_ref_mod_and_test_template,
TP_PROTO(struct page *page, int v, int ret),
TP_ARGS(page, v, ret),
TP_STRUCT__entry(
__field(unsigned long, pfn)
__field(unsigned long, flags)
__field(int, count)
__field(int, mapcount)
__field(void *, mapping)
__field(int, mt)
__field(int, val)
__field(int, ret)
),
TP_fast_assign(
__entry->pfn = page_to_pfn(page);
__entry->flags = page->flags.f;
__entry->count = page_ref_count(page);
__entry->mapcount = atomic_read(&page->_mapcount);
__entry->mapping = page->mapping;
__entry->mt = get_pageblock_migratetype(page);
__entry->val = v;
__entry->ret = ret;
),
TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d ret=%d",
__entry->pfn,
show_page_flags(__entry->flags & PAGEFLAGS_MASK),
Annotation
- Immediate include surface: `linux/types.h`, `linux/page_ref.h`, `linux/tracepoint.h`, `trace/events/mmflags.h`, `trace/define_trace.h`.
- 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.