xref: /openbmc/linux/include/trace/events/cma.h (revision 2f164822)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM cma
4 
5 #if !defined(_TRACE_CMA_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_CMA_H
7 
8 #include <linux/types.h>
9 #include <linux/tracepoint.h>
10 
11 DECLARE_EVENT_CLASS(cma_alloc_class,
12 
13 	TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
14 		 unsigned long count, unsigned int align),
15 
16 	TP_ARGS(name, pfn, page, count, align),
17 
18 	TP_STRUCT__entry(
19 		__string(name, name)
20 		__field(unsigned long, pfn)
21 		__field(const struct page *, page)
22 		__field(unsigned long, count)
23 		__field(unsigned int, align)
24 	),
25 
26 	TP_fast_assign(
27 		__assign_str(name, name);
28 		__entry->pfn = pfn;
29 		__entry->page = page;
30 		__entry->count = count;
31 		__entry->align = align;
32 	),
33 
34 	TP_printk("name=%s pfn=0x%lx page=%p count=%lu align=%u",
35 		  __get_str(name),
36 		  __entry->pfn,
37 		  __entry->page,
38 		  __entry->count,
39 		  __entry->align)
40 );
41 
42 TRACE_EVENT(cma_release,
43 
44 	TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
45 		 unsigned long count),
46 
47 	TP_ARGS(name, pfn, page, count),
48 
49 	TP_STRUCT__entry(
50 		__string(name, name)
51 		__field(unsigned long, pfn)
52 		__field(const struct page *, page)
53 		__field(unsigned long, count)
54 	),
55 
56 	TP_fast_assign(
57 		__assign_str(name, name);
58 		__entry->pfn = pfn;
59 		__entry->page = page;
60 		__entry->count = count;
61 	),
62 
63 	TP_printk("name=%s pfn=0x%lx page=%p count=%lu",
64 		  __get_str(name),
65 		  __entry->pfn,
66 		  __entry->page,
67 		  __entry->count)
68 );
69 
70 TRACE_EVENT(cma_alloc_start,
71 
72 	TP_PROTO(const char *name, unsigned long count, unsigned int align),
73 
74 	TP_ARGS(name, count, align),
75 
76 	TP_STRUCT__entry(
77 		__string(name, name)
78 		__field(unsigned long, count)
79 		__field(unsigned int, align)
80 	),
81 
82 	TP_fast_assign(
83 		__assign_str(name, name);
84 		__entry->count = count;
85 		__entry->align = align;
86 	),
87 
88 	TP_printk("name=%s count=%lu align=%u",
89 		  __get_str(name),
90 		  __entry->count,
91 		  __entry->align)
92 );
93 
94 TRACE_EVENT(cma_alloc_finish,
95 
96 	TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
97 		 unsigned long count, unsigned int align, int errorno),
98 
99 	TP_ARGS(name, pfn, page, count, align, errorno),
100 
101 	TP_STRUCT__entry(
102 		__string(name, name)
103 		__field(unsigned long, pfn)
104 		__field(const struct page *, page)
105 		__field(unsigned long, count)
106 		__field(unsigned int, align)
107 		__field(int, errorno)
108 	),
109 
110 	TP_fast_assign(
111 		__assign_str(name, name);
112 		__entry->pfn = pfn;
113 		__entry->page = page;
114 		__entry->count = count;
115 		__entry->align = align;
116 		__entry->errorno = errorno;
117 	),
118 
119 	TP_printk("name=%s pfn=0x%lx page=%p count=%lu align=%u errorno=%d",
120 		  __get_str(name),
121 		  __entry->pfn,
122 		  __entry->page,
123 		  __entry->count,
124 		  __entry->align,
125 		  __entry->errorno)
126 );
127 
128 DEFINE_EVENT(cma_alloc_class, cma_alloc_busy_retry,
129 
130 	TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
131 		 unsigned long count, unsigned int align),
132 
133 	TP_ARGS(name, pfn, page, count, align)
134 );
135 
136 #endif /* _TRACE_CMA_H */
137 
138 /* This part must be outside protection */
139 #include <trace/define_trace.h>
140