Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 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 | |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 11 | DECLARE_EVENT_CLASS(cma_alloc_class, |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 12 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 13 | TP_PROTO(const char *name, unsigned long pfn, const struct page *page, |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 14 | unsigned int count, unsigned int align), |
| 15 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 16 | TP_ARGS(name, pfn, page, count, align), |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 17 | |
| 18 | TP_STRUCT__entry( |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 19 | __string(name, name) |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 20 | __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 Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 27 | __assign_str(name, name); |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 28 | __entry->pfn = pfn; |
| 29 | __entry->page = page; |
| 30 | __entry->count = count; |
| 31 | __entry->align = align; |
| 32 | ), |
| 33 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 34 | TP_printk("name=%s pfn=%lx page=%p count=%u align=%u", |
| 35 | __get_str(name), |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 36 | __entry->pfn, |
| 37 | __entry->page, |
| 38 | __entry->count, |
| 39 | __entry->align) |
| 40 | ); |
| 41 | |
| 42 | TRACE_EVENT(cma_release, |
| 43 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 44 | TP_PROTO(const char *name, unsigned long pfn, const struct page *page, |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 45 | unsigned int count), |
| 46 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 47 | TP_ARGS(name, pfn, page, count), |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 48 | |
| 49 | TP_STRUCT__entry( |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 50 | __string(name, name) |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 51 | __field(unsigned long, pfn) |
| 52 | __field(const struct page *, page) |
| 53 | __field(unsigned int, count) |
| 54 | ), |
| 55 | |
| 56 | TP_fast_assign( |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 57 | __assign_str(name, name); |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 58 | __entry->pfn = pfn; |
| 59 | __entry->page = page; |
| 60 | __entry->count = count; |
| 61 | ), |
| 62 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 63 | TP_printk("name=%s pfn=%lx page=%p count=%u", |
| 64 | __get_str(name), |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 65 | __entry->pfn, |
| 66 | __entry->page, |
| 67 | __entry->count) |
| 68 | ); |
| 69 | |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 70 | TRACE_EVENT(cma_alloc_start, |
| 71 | |
Georgi Djakov | 1cfa9bc | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 72 | TP_PROTO(const char *name, unsigned int count, unsigned int align), |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 73 | |
Georgi Djakov | 1cfa9bc | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 74 | TP_ARGS(name, count, align), |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 75 | |
| 76 | TP_STRUCT__entry( |
Georgi Djakov | 1cfa9bc | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 77 | __string(name, name) |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 78 | __field(unsigned int, count) |
| 79 | __field(unsigned int, align) |
| 80 | ), |
| 81 | |
| 82 | TP_fast_assign( |
Georgi Djakov | 1cfa9bc | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 83 | __assign_str(name, name); |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 84 | __entry->count = count; |
| 85 | __entry->align = align; |
| 86 | ), |
| 87 | |
Georgi Djakov | 1cfa9bc | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 88 | TP_printk("name=%s count=%u align=%u", |
| 89 | __get_str(name), |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 90 | __entry->count, |
| 91 | __entry->align) |
| 92 | ); |
| 93 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 94 | DEFINE_EVENT(cma_alloc_class, cma_alloc_finish, |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 95 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 96 | TP_PROTO(const char *name, unsigned long pfn, const struct page *page, |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 97 | unsigned int count, unsigned int align), |
| 98 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 99 | TP_ARGS(name, pfn, page, count, align) |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 100 | ); |
| 101 | |
| 102 | DEFINE_EVENT(cma_alloc_class, cma_alloc_busy_retry, |
| 103 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 104 | TP_PROTO(const char *name, unsigned long pfn, const struct page *page, |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 105 | unsigned int count, unsigned int align), |
| 106 | |
Minchan Kim | 76782b5 | 2021-04-12 00:02:38 -0400 | [diff] [blame^] | 107 | TP_ARGS(name, pfn, page, count, align) |
Liam Mark | c453643 | 2021-04-12 00:02:38 -0400 | [diff] [blame] | 108 | ); |
| 109 | |
Stefan Strogin | 99e8ea6 | 2015-04-15 16:14:50 -0700 | [diff] [blame] | 110 | #endif /* _TRACE_CMA_H */ |
| 111 | |
| 112 | /* This part must be outside protection */ |
| 113 | #include <trace/define_trace.h> |