2 #define TRACE_SYSTEM page_ref
4 #if !defined(_TRACE_PAGE_REF_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_PAGE_REF_H
7 #include <linux/types.h>
8 #include <linux/page_ref.h>
9 #include <linux/tracepoint.h>
10 #include <trace/events/mmflags.h>
12 DECLARE_EVENT_CLASS(page_ref_mod_template
,
14 TP_PROTO(struct page
*page
, int v
),
19 __field(unsigned long, pfn
)
20 __field(unsigned long, flags
)
22 __field(int, mapcount
)
23 __field(void *, mapping
)
29 __entry
->pfn
= page_to_pfn(page
);
30 __entry
->flags
= page
->flags
;
31 __entry
->count
= page_ref_count(page
);
32 __entry
->mapcount
= page_mapcount(page
);
33 __entry
->mapping
= page
->mapping
;
34 __entry
->mt
= get_pageblock_migratetype(page
);
38 TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d",
40 show_page_flags(__entry
->flags
& ((1UL << NR_PAGEFLAGS
) - 1)),
42 __entry
->mapcount
, __entry
->mapping
, __entry
->mt
,
46 DEFINE_EVENT(page_ref_mod_template
, page_ref_set
,
48 TP_PROTO(struct page
*page
, int v
),
53 DEFINE_EVENT(page_ref_mod_template
, page_ref_mod
,
55 TP_PROTO(struct page
*page
, int v
),
60 DECLARE_EVENT_CLASS(page_ref_mod_and_test_template
,
62 TP_PROTO(struct page
*page
, int v
, int ret
),
64 TP_ARGS(page
, v
, ret
),
67 __field(unsigned long, pfn
)
68 __field(unsigned long, flags
)
70 __field(int, mapcount
)
71 __field(void *, mapping
)
78 __entry
->pfn
= page_to_pfn(page
);
79 __entry
->flags
= page
->flags
;
80 __entry
->count
= page_ref_count(page
);
81 __entry
->mapcount
= page_mapcount(page
);
82 __entry
->mapping
= page
->mapping
;
83 __entry
->mt
= get_pageblock_migratetype(page
);
88 TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d ret=%d",
90 show_page_flags(__entry
->flags
& ((1UL << NR_PAGEFLAGS
) - 1)),
92 __entry
->mapcount
, __entry
->mapping
, __entry
->mt
,
93 __entry
->val
, __entry
->ret
)
96 DEFINE_EVENT(page_ref_mod_and_test_template
, page_ref_mod_and_test
,
98 TP_PROTO(struct page
*page
, int v
, int ret
),
100 TP_ARGS(page
, v
, ret
)
103 DEFINE_EVENT(page_ref_mod_and_test_template
, page_ref_mod_and_return
,
105 TP_PROTO(struct page
*page
, int v
, int ret
),
107 TP_ARGS(page
, v
, ret
)
110 DEFINE_EVENT(page_ref_mod_and_test_template
, page_ref_mod_unless
,
112 TP_PROTO(struct page
*page
, int v
, int ret
),
114 TP_ARGS(page
, v
, ret
)
117 DEFINE_EVENT(page_ref_mod_and_test_template
, page_ref_freeze
,
119 TP_PROTO(struct page
*page
, int v
, int ret
),
121 TP_ARGS(page
, v
, ret
)
124 DEFINE_EVENT(page_ref_mod_template
, page_ref_unfreeze
,
126 TP_PROTO(struct page
*page
, int v
),
131 #endif /* _TRACE_PAGE_COUNT_H */
133 /* This part must be outside protection */
134 #include <trace/define_trace.h>