xref: /openbmc/linux/include/trace/events/thp.h (revision 65844828)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM thp
4 
5 #if !defined(_TRACE_THP_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_THP_H
7 
8 #include <linux/types.h>
9 #include <linux/tracepoint.h>
10 
11 TRACE_EVENT(hugepage_set_pmd,
12 
13 	    TP_PROTO(unsigned long addr, unsigned long pmd),
14 	    TP_ARGS(addr, pmd),
15 	    TP_STRUCT__entry(
16 		    __field(unsigned long, addr)
17 		    __field(unsigned long, pmd)
18 		    ),
19 
20 	    TP_fast_assign(
21 		    __entry->addr = addr;
22 		    __entry->pmd = pmd;
23 		    ),
24 
25 	    TP_printk("Set pmd with 0x%lx with 0x%lx", __entry->addr, __entry->pmd)
26 );
27 
28 
29 TRACE_EVENT(hugepage_update,
30 
31 	    TP_PROTO(unsigned long addr, unsigned long pte, unsigned long clr, unsigned long set),
32 	    TP_ARGS(addr, pte, clr, set),
33 	    TP_STRUCT__entry(
34 		    __field(unsigned long, addr)
35 		    __field(unsigned long, pte)
36 		    __field(unsigned long, clr)
37 		    __field(unsigned long, set)
38 		    ),
39 
40 	    TP_fast_assign(
41 		    __entry->addr = addr;
42 		    __entry->pte = pte;
43 		    __entry->clr = clr;
44 		    __entry->set = set;
45 
46 		    ),
47 
48 	    TP_printk("hugepage update at addr 0x%lx and pte = 0x%lx clr = 0x%lx, set = 0x%lx", __entry->addr, __entry->pte, __entry->clr, __entry->set)
49 );
50 
51 DECLARE_EVENT_CLASS(migration_pmd,
52 
53 		TP_PROTO(unsigned long addr, unsigned long pmd),
54 
55 		TP_ARGS(addr, pmd),
56 
57 		TP_STRUCT__entry(
58 			__field(unsigned long, addr)
59 			__field(unsigned long, pmd)
60 		),
61 
62 		TP_fast_assign(
63 			__entry->addr = addr;
64 			__entry->pmd = pmd;
65 		),
66 		TP_printk("addr=%lx, pmd=%lx", __entry->addr, __entry->pmd)
67 );
68 
69 DEFINE_EVENT(migration_pmd, set_migration_pmd,
70 	TP_PROTO(unsigned long addr, unsigned long pmd),
71 	TP_ARGS(addr, pmd)
72 );
73 
74 DEFINE_EVENT(migration_pmd, remove_migration_pmd,
75 	TP_PROTO(unsigned long addr, unsigned long pmd),
76 	TP_ARGS(addr, pmd)
77 );
78 #endif /* _TRACE_THP_H */
79 
80 /* This part must be outside protection */
81 #include <trace/define_trace.h>
82