2 #define TRACE_SYSTEM huge_memory
4 #if !defined(__HUGE_MEMORY_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define __HUGE_MEMORY_H
7 #include <linux/tracepoint.h>
10 EM( SCAN_FAIL, "failed") \
11 EM( SCAN_SUCCEED, "succeeded") \
12 EM( SCAN_PMD_NULL, "pmd_null") \
13 EM( SCAN_EXCEED_NONE_PTE, "exceed_none_pte") \
14 EM( SCAN_PTE_NON_PRESENT, "pte_non_present") \
15 EM( SCAN_PAGE_RO, "no_writable_page") \
16 EM( SCAN_LACK_REFERENCED_PAGE, "lack_referenced_page") \
17 EM( SCAN_PAGE_NULL, "page_null") \
18 EM( SCAN_SCAN_ABORT, "scan_aborted") \
19 EM( SCAN_PAGE_COUNT, "not_suitable_page_count") \
20 EM( SCAN_PAGE_LRU, "page_not_in_lru") \
21 EM( SCAN_PAGE_LOCK, "page_locked") \
22 EM( SCAN_PAGE_ANON, "page_not_anon") \
23 EM( SCAN_PAGE_COMPOUND, "page_compound") \
24 EM( SCAN_ANY_PROCESS, "no_process_for_page") \
25 EM( SCAN_VMA_NULL, "vma_null") \
26 EM( SCAN_VMA_CHECK, "vma_check_failed") \
27 EM( SCAN_ADDRESS_RANGE, "not_suitable_address_range") \
28 EM( SCAN_SWAP_CACHE_PAGE, "page_swap_cache") \
29 EM( SCAN_DEL_PAGE_LRU, "could_not_delete_page_from_lru")\
30 EM( SCAN_ALLOC_HUGE_PAGE_FAIL, "alloc_huge_page_failed") \
31 EM( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") \
32 EM( SCAN_EXCEED_SWAP_PTE, "exceed_swap_pte") \
33 EMe(SCAN_TRUNCATED, "truncated") \
37 #define EM(a, b) TRACE_DEFINE_ENUM(a);
38 #define EMe(a, b) TRACE_DEFINE_ENUM(a);
44 #define EM(a, b) {a, b},
45 #define EMe(a, b) {a, b}
47 TRACE_EVENT(mm_khugepaged_scan_pmd
,
49 TP_PROTO(struct mm_struct
*mm
, struct page
*page
, bool writable
,
50 int referenced
, int none_or_zero
, int status
, int unmapped
),
52 TP_ARGS(mm
, page
, writable
, referenced
, none_or_zero
, status
, unmapped
),
55 __field(struct mm_struct
*, mm
)
56 __field(unsigned long, pfn
)
57 __field(bool, writable
)
58 __field(int, referenced
)
59 __field(int, none_or_zero
)
61 __field(int, unmapped
)
66 __entry
->pfn
= page
? page_to_pfn(page
) : -1;
67 __entry
->writable
= writable
;
68 __entry
->referenced
= referenced
;
69 __entry
->none_or_zero
= none_or_zero
;
70 __entry
->status
= status
;
71 __entry
->unmapped
= unmapped
;
74 TP_printk("mm=%p, scan_pfn=0x%lx, writable=%d, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d",
79 __entry
->none_or_zero
,
80 __print_symbolic(__entry
->status
, SCAN_STATUS
),
84 TRACE_EVENT(mm_collapse_huge_page
,
86 TP_PROTO(struct mm_struct
*mm
, int isolated
, int status
),
88 TP_ARGS(mm
, isolated
, status
),
91 __field(struct mm_struct
*, mm
)
92 __field(int, isolated
)
98 __entry
->isolated
= isolated
;
99 __entry
->status
= status
;
102 TP_printk("mm=%p, isolated=%d, status=%s",
105 __print_symbolic(__entry
->status
, SCAN_STATUS
))
108 TRACE_EVENT(mm_collapse_huge_page_isolate
,
110 TP_PROTO(struct page
*page
, int none_or_zero
,
111 int referenced
, bool writable
, int status
),
113 TP_ARGS(page
, none_or_zero
, referenced
, writable
, status
),
116 __field(unsigned long, pfn
)
117 __field(int, none_or_zero
)
118 __field(int, referenced
)
119 __field(bool, writable
)
124 __entry
->pfn
= page
? page_to_pfn(page
) : -1;
125 __entry
->none_or_zero
= none_or_zero
;
126 __entry
->referenced
= referenced
;
127 __entry
->writable
= writable
;
128 __entry
->status
= status
;
131 TP_printk("scan_pfn=0x%lx, none_or_zero=%d, referenced=%d, writable=%d, status=%s",
133 __entry
->none_or_zero
,
136 __print_symbolic(__entry
->status
, SCAN_STATUS
))
139 TRACE_EVENT(mm_collapse_huge_page_swapin
,
141 TP_PROTO(struct mm_struct
*mm
, int swapped_in
, int referenced
, int ret
),
143 TP_ARGS(mm
, swapped_in
, referenced
, ret
),
146 __field(struct mm_struct
*, mm
)
147 __field(int, swapped_in
)
148 __field(int, referenced
)
154 __entry
->swapped_in
= swapped_in
;
155 __entry
->referenced
= referenced
;
159 TP_printk("mm=%p, swapped_in=%d, referenced=%d, ret=%d",
166 #endif /* __HUGE_MEMORY_H */
167 #include <trace/define_trace.h>