xref: /linux/include/trace/events/cma.h (revision 36ec807b627b4c0a0a382f0ae48eac7187d14b2b)
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 TRACE_EVENT(cma_release,
12 
13 	TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
14 		 unsigned long count),
15 
16 	TP_ARGS(name, pfn, page, count),
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 	),
24 
25 	TP_fast_assign(
26 		__assign_str(name);
27 		__entry->pfn = pfn;
28 		__entry->page = page;
29 		__entry->count = count;
30 	),
31 
32 	TP_printk("name=%s pfn=0x%lx page=%p count=%lu",
33 		  __get_str(name),
34 		  __entry->pfn,
35 		  __entry->page,
36 		  __entry->count)
37 );
38 
39 TRACE_EVENT(cma_alloc_start,
40 
41 	TP_PROTO(const char *name, unsigned long count, unsigned int align),
42 
43 	TP_ARGS(name, count, align),
44 
45 	TP_STRUCT__entry(
46 		__string(name, name)
47 		__field(unsigned long, count)
48 		__field(unsigned int, align)
49 	),
50 
51 	TP_fast_assign(
52 		__assign_str(name);
53 		__entry->count = count;
54 		__entry->align = align;
55 	),
56 
57 	TP_printk("name=%s count=%lu align=%u",
58 		  __get_str(name),
59 		  __entry->count,
60 		  __entry->align)
61 );
62 
63 TRACE_EVENT(cma_alloc_finish,
64 
65 	TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
66 		 unsigned long count, unsigned int align, int errorno),
67 
68 	TP_ARGS(name, pfn, page, count, align, errorno),
69 
70 	TP_STRUCT__entry(
71 		__string(name, name)
72 		__field(unsigned long, pfn)
73 		__field(const struct page *, page)
74 		__field(unsigned long, count)
75 		__field(unsigned int, align)
76 		__field(int, errorno)
77 	),
78 
79 	TP_fast_assign(
80 		__assign_str(name);
81 		__entry->pfn = pfn;
82 		__entry->page = page;
83 		__entry->count = count;
84 		__entry->align = align;
85 		__entry->errorno = errorno;
86 	),
87 
88 	TP_printk("name=%s pfn=0x%lx page=%p count=%lu align=%u errorno=%d",
89 		  __get_str(name),
90 		  __entry->pfn,
91 		  __entry->page,
92 		  __entry->count,
93 		  __entry->align,
94 		  __entry->errorno)
95 );
96 
97 TRACE_EVENT(cma_alloc_busy_retry,
98 
99 	TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
100 		 unsigned long count, unsigned int align),
101 
102 	TP_ARGS(name, pfn, page, count, align),
103 
104 	TP_STRUCT__entry(
105 		__string(name, name)
106 		__field(unsigned long, pfn)
107 		__field(const struct page *, page)
108 		__field(unsigned long, count)
109 		__field(unsigned int, align)
110 	),
111 
112 	TP_fast_assign(
113 		__assign_str(name);
114 		__entry->pfn = pfn;
115 		__entry->page = page;
116 		__entry->count = count;
117 		__entry->align = align;
118 	),
119 
120 	TP_printk("name=%s pfn=0x%lx page=%p count=%lu align=%u",
121 		  __get_str(name),
122 		  __entry->pfn,
123 		  __entry->page,
124 		  __entry->count,
125 		  __entry->align)
126 );
127 
128 #endif /* _TRACE_CMA_H */
129 
130 /* This part must be outside protection */
131 #include <trace/define_trace.h>
132