Linux 4.8.3
[linux/fpc-iii.git] / include / trace / events / page_ref.h
blob81001f8b0db4aa902d1ce4857977f1662fb020c1
1 #undef TRACE_SYSTEM
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),
16 TP_ARGS(page, v),
18 TP_STRUCT__entry(
19 __field(unsigned long, pfn)
20 __field(unsigned long, flags)
21 __field(int, count)
22 __field(int, mapcount)
23 __field(void *, mapping)
24 __field(int, mt)
25 __field(int, val)
28 TP_fast_assign(
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);
35 __entry->val = v;
38 TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d",
39 __entry->pfn,
40 show_page_flags(__entry->flags & ((1UL << NR_PAGEFLAGS) - 1)),
41 __entry->count,
42 __entry->mapcount, __entry->mapping, __entry->mt,
43 __entry->val)
46 DEFINE_EVENT(page_ref_mod_template, page_ref_set,
48 TP_PROTO(struct page *page, int v),
50 TP_ARGS(page, v)
53 DEFINE_EVENT(page_ref_mod_template, page_ref_mod,
55 TP_PROTO(struct page *page, int v),
57 TP_ARGS(page, 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),
66 TP_STRUCT__entry(
67 __field(unsigned long, pfn)
68 __field(unsigned long, flags)
69 __field(int, count)
70 __field(int, mapcount)
71 __field(void *, mapping)
72 __field(int, mt)
73 __field(int, val)
74 __field(int, ret)
77 TP_fast_assign(
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);
84 __entry->val = v;
85 __entry->ret = ret;
88 TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d ret=%d",
89 __entry->pfn,
90 show_page_flags(__entry->flags & ((1UL << NR_PAGEFLAGS) - 1)),
91 __entry->count,
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),
128 TP_ARGS(page, v)
131 #endif /* _TRACE_PAGE_COUNT_H */
133 /* This part must be outside protection */
134 #include <trace/define_trace.h>