blob: 5cf385ae7c08b3ccbfffe3d2d6e13a78ce52040b [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Stefan Strogin99e8ea62015-04-15 16:14:50 -07002#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
Liam Markc4536432021-04-12 00:02:38 -040011DECLARE_EVENT_CLASS(cma_alloc_class,
Stefan Strogin99e8ea62015-04-15 16:14:50 -070012
Minchan Kim76782b52021-04-12 00:02:38 -040013 TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
Stefan Strogin99e8ea62015-04-15 16:14:50 -070014 unsigned int count, unsigned int align),
15
Minchan Kim76782b52021-04-12 00:02:38 -040016 TP_ARGS(name, pfn, page, count, align),
Stefan Strogin99e8ea62015-04-15 16:14:50 -070017
18 TP_STRUCT__entry(
Minchan Kim76782b52021-04-12 00:02:38 -040019 __string(name, name)
Stefan Strogin99e8ea62015-04-15 16:14:50 -070020 __field(unsigned long, pfn)
21 __field(const struct page *, page)
22 __field(unsigned int, count)
23 __field(unsigned int, align)
24 ),
25
26 TP_fast_assign(
Minchan Kim76782b52021-04-12 00:02:38 -040027 __assign_str(name, name);
Stefan Strogin99e8ea62015-04-15 16:14:50 -070028 __entry->pfn = pfn;
29 __entry->page = page;
30 __entry->count = count;
31 __entry->align = align;
32 ),
33
Minchan Kim76782b52021-04-12 00:02:38 -040034 TP_printk("name=%s pfn=%lx page=%p count=%u align=%u",
35 __get_str(name),
Stefan Strogin99e8ea62015-04-15 16:14:50 -070036 __entry->pfn,
37 __entry->page,
38 __entry->count,
39 __entry->align)
40);
41
42TRACE_EVENT(cma_release,
43
Minchan Kim76782b52021-04-12 00:02:38 -040044 TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
Stefan Strogin99e8ea62015-04-15 16:14:50 -070045 unsigned int count),
46
Minchan Kim76782b52021-04-12 00:02:38 -040047 TP_ARGS(name, pfn, page, count),
Stefan Strogin99e8ea62015-04-15 16:14:50 -070048
49 TP_STRUCT__entry(
Minchan Kim76782b52021-04-12 00:02:38 -040050 __string(name, name)
Stefan Strogin99e8ea62015-04-15 16:14:50 -070051 __field(unsigned long, pfn)
52 __field(const struct page *, page)
53 __field(unsigned int, count)
54 ),
55
56 TP_fast_assign(
Minchan Kim76782b52021-04-12 00:02:38 -040057 __assign_str(name, name);
Stefan Strogin99e8ea62015-04-15 16:14:50 -070058 __entry->pfn = pfn;
59 __entry->page = page;
60 __entry->count = count;
61 ),
62
Minchan Kim76782b52021-04-12 00:02:38 -040063 TP_printk("name=%s pfn=%lx page=%p count=%u",
64 __get_str(name),
Stefan Strogin99e8ea62015-04-15 16:14:50 -070065 __entry->pfn,
66 __entry->page,
67 __entry->count)
68);
69
Liam Markc4536432021-04-12 00:02:38 -040070TRACE_EVENT(cma_alloc_start,
71
Georgi Djakov1cfa9bc2021-04-12 00:02:38 -040072 TP_PROTO(const char *name, unsigned int count, unsigned int align),
Liam Markc4536432021-04-12 00:02:38 -040073
Georgi Djakov1cfa9bc2021-04-12 00:02:38 -040074 TP_ARGS(name, count, align),
Liam Markc4536432021-04-12 00:02:38 -040075
76 TP_STRUCT__entry(
Georgi Djakov1cfa9bc2021-04-12 00:02:38 -040077 __string(name, name)
Liam Markc4536432021-04-12 00:02:38 -040078 __field(unsigned int, count)
79 __field(unsigned int, align)
80 ),
81
82 TP_fast_assign(
Georgi Djakov1cfa9bc2021-04-12 00:02:38 -040083 __assign_str(name, name);
Liam Markc4536432021-04-12 00:02:38 -040084 __entry->count = count;
85 __entry->align = align;
86 ),
87
Georgi Djakov1cfa9bc2021-04-12 00:02:38 -040088 TP_printk("name=%s count=%u align=%u",
89 __get_str(name),
Liam Markc4536432021-04-12 00:02:38 -040090 __entry->count,
91 __entry->align)
92);
93
Minchan Kim76782b52021-04-12 00:02:38 -040094DEFINE_EVENT(cma_alloc_class, cma_alloc_finish,
Liam Markc4536432021-04-12 00:02:38 -040095
Minchan Kim76782b52021-04-12 00:02:38 -040096 TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
Liam Markc4536432021-04-12 00:02:38 -040097 unsigned int count, unsigned int align),
98
Minchan Kim76782b52021-04-12 00:02:38 -040099 TP_ARGS(name, pfn, page, count, align)
Liam Markc4536432021-04-12 00:02:38 -0400100);
101
102DEFINE_EVENT(cma_alloc_class, cma_alloc_busy_retry,
103
Minchan Kim76782b52021-04-12 00:02:38 -0400104 TP_PROTO(const char *name, unsigned long pfn, const struct page *page,
Liam Markc4536432021-04-12 00:02:38 -0400105 unsigned int count, unsigned int align),
106
Minchan Kim76782b52021-04-12 00:02:38 -0400107 TP_ARGS(name, pfn, page, count, align)
Liam Markc4536432021-04-12 00:02:38 -0400108);
109
Stefan Strogin99e8ea62015-04-15 16:14:50 -0700110#endif /* _TRACE_CMA_H */
111
112/* This part must be outside protection */
113#include <trace/define_trace.h>