WIP FPC-III support
[linux/fpc-iii.git] / include / trace / events / page_ref.h
blob5d2ea93956cec6955feba9317915368e61d6800e
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM page_ref
5 #if !defined(_TRACE_PAGE_REF_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_PAGE_REF_H
8 #include <linux/types.h>
9 #include <linux/page_ref.h>
10 #include <linux/tracepoint.h>
11 #include <trace/events/mmflags.h>
13 DECLARE_EVENT_CLASS(page_ref_mod_template,
15 TP_PROTO(struct page *page, int v),
17 TP_ARGS(page, v),
19 TP_STRUCT__entry(
20 __field(unsigned long, pfn)
21 __field(unsigned long, flags)
22 __field(int, count)
23 __field(int, mapcount)
24 __field(void *, mapping)
25 __field(int, mt)
26 __field(int, val)
29 TP_fast_assign(
30 __entry->pfn = page_to_pfn(page);
31 __entry->flags = page->flags;
32 __entry->count = page_ref_count(page);
33 __entry->mapcount = page_mapcount(page);
34 __entry->mapping = page->mapping;
35 __entry->mt = get_pageblock_migratetype(page);
36 __entry->val = v;
39 TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d",
40 __entry->pfn,
41 show_page_flags(__entry->flags & ((1UL << NR_PAGEFLAGS) - 1)),
42 __entry->count,
43 __entry->mapcount, __entry->mapping, __entry->mt,
44 __entry->val)
47 DEFINE_EVENT(page_ref_mod_template, page_ref_set,
49 TP_PROTO(struct page *page, int v),
51 TP_ARGS(page, v)
54 DEFINE_EVENT(page_ref_mod_template, page_ref_mod,
56 TP_PROTO(struct page *page, int v),
58 TP_ARGS(page, v)
61 DECLARE_EVENT_CLASS(page_ref_mod_and_test_template,
63 TP_PROTO(struct page *page, int v, int ret),
65 TP_ARGS(page, v, ret),
67 TP_STRUCT__entry(
68 __field(unsigned long, pfn)
69 __field(unsigned long, flags)
70 __field(int, count)
71 __field(int, mapcount)
72 __field(void *, mapping)
73 __field(int, mt)
74 __field(int, val)
75 __field(int, ret)
78 TP_fast_assign(
79 __entry->pfn = page_to_pfn(page);
80 __entry->flags = page->flags;
81 __entry->count = page_ref_count(page);
82 __entry->mapcount = page_mapcount(page);
83 __entry->mapping = page->mapping;
84 __entry->mt = get_pageblock_migratetype(page);
85 __entry->val = v;
86 __entry->ret = ret;
89 TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d ret=%d",
90 __entry->pfn,
91 show_page_flags(__entry->flags & ((1UL << NR_PAGEFLAGS) - 1)),
92 __entry->count,
93 __entry->mapcount, __entry->mapping, __entry->mt,
94 __entry->val, __entry->ret)
97 DEFINE_EVENT(page_ref_mod_and_test_template, page_ref_mod_and_test,
99 TP_PROTO(struct page *page, int v, int ret),
101 TP_ARGS(page, v, ret)
104 DEFINE_EVENT(page_ref_mod_and_test_template, page_ref_mod_and_return,
106 TP_PROTO(struct page *page, int v, int ret),
108 TP_ARGS(page, v, ret)
111 DEFINE_EVENT(page_ref_mod_and_test_template, page_ref_mod_unless,
113 TP_PROTO(struct page *page, int v, int ret),
115 TP_ARGS(page, v, ret)
118 DEFINE_EVENT(page_ref_mod_and_test_template, page_ref_freeze,
120 TP_PROTO(struct page *page, int v, int ret),
122 TP_ARGS(page, v, ret)
125 DEFINE_EVENT(page_ref_mod_template, page_ref_unfreeze,
127 TP_PROTO(struct page *page, int v),
129 TP_ARGS(page, v)
132 #endif /* _TRACE_PAGE_COUNT_H */
134 /* This part must be outside protection */
135 #include <trace/define_trace.h>