1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */ 299e8ea6cSStefan Strogin #undef TRACE_SYSTEM 399e8ea6cSStefan Strogin #define TRACE_SYSTEM cma 499e8ea6cSStefan Strogin 599e8ea6cSStefan Strogin #if !defined(_TRACE_CMA_H) || defined(TRACE_HEADER_MULTI_READ) 699e8ea6cSStefan Strogin #define _TRACE_CMA_H 799e8ea6cSStefan Strogin 899e8ea6cSStefan Strogin #include <linux/types.h> 999e8ea6cSStefan Strogin #include <linux/tracepoint.h> 1099e8ea6cSStefan Strogin 1199e8ea6cSStefan Strogin TRACE_EVENT(cma_release, 1299e8ea6cSStefan Strogin 133aab8ae7SMinchan Kim TP_PROTO(const char *name, unsigned long pfn, const struct page *page, 1478fa5150SMinchan Kim unsigned long count), 1599e8ea6cSStefan Strogin 163aab8ae7SMinchan Kim TP_ARGS(name, pfn, page, count), 1799e8ea6cSStefan Strogin 1899e8ea6cSStefan Strogin TP_STRUCT__entry( 193aab8ae7SMinchan Kim __string(name, name) 2099e8ea6cSStefan Strogin __field(unsigned long, pfn) 2199e8ea6cSStefan Strogin __field(const struct page *, page) 2278fa5150SMinchan Kim __field(unsigned long, count) 2399e8ea6cSStefan Strogin ), 2499e8ea6cSStefan Strogin 2599e8ea6cSStefan Strogin TP_fast_assign( 26*2c92ca84SSteven Rostedt (Google) __assign_str(name); 2799e8ea6cSStefan Strogin __entry->pfn = pfn; 2899e8ea6cSStefan Strogin __entry->page = page; 2999e8ea6cSStefan Strogin __entry->count = count; 3099e8ea6cSStefan Strogin ), 3199e8ea6cSStefan Strogin 3253d884a6SVincent Whitchurch TP_printk("name=%s pfn=0x%lx page=%p count=%lu", 333aab8ae7SMinchan Kim __get_str(name), 3499e8ea6cSStefan Strogin __entry->pfn, 3599e8ea6cSStefan Strogin __entry->page, 3699e8ea6cSStefan Strogin __entry->count) 3799e8ea6cSStefan Strogin ); 3899e8ea6cSStefan Strogin 397bc1aec5SLiam Mark TRACE_EVENT(cma_alloc_start, 407bc1aec5SLiam Mark 4178fa5150SMinchan Kim TP_PROTO(const char *name, unsigned long count, unsigned int align), 427bc1aec5SLiam Mark 437bc1aec5SLiam Mark TP_ARGS(name, count, align), 447bc1aec5SLiam Mark 457bc1aec5SLiam Mark TP_STRUCT__entry( 467bc1aec5SLiam Mark __string(name, name) 4778fa5150SMinchan Kim __field(unsigned long, count) 487bc1aec5SLiam Mark __field(unsigned int, align) 497bc1aec5SLiam Mark ), 507bc1aec5SLiam Mark 517bc1aec5SLiam Mark TP_fast_assign( 52*2c92ca84SSteven Rostedt (Google) __assign_str(name); 537bc1aec5SLiam Mark __entry->count = count; 547bc1aec5SLiam Mark __entry->align = align; 557bc1aec5SLiam Mark ), 567bc1aec5SLiam Mark 5778fa5150SMinchan Kim TP_printk("name=%s count=%lu align=%u", 587bc1aec5SLiam Mark __get_str(name), 597bc1aec5SLiam Mark __entry->count, 607bc1aec5SLiam Mark __entry->align) 617bc1aec5SLiam Mark ); 627bc1aec5SLiam Mark 63cb6c33d4SWenchao Hao TRACE_EVENT(cma_alloc_finish, 647bc1aec5SLiam Mark 653aab8ae7SMinchan Kim TP_PROTO(const char *name, unsigned long pfn, const struct page *page, 66cb6c33d4SWenchao Hao unsigned long count, unsigned int align, int errorno), 677bc1aec5SLiam Mark 68cb6c33d4SWenchao Hao TP_ARGS(name, pfn, page, count, align, errorno), 69cb6c33d4SWenchao Hao 70cb6c33d4SWenchao Hao TP_STRUCT__entry( 71cb6c33d4SWenchao Hao __string(name, name) 72cb6c33d4SWenchao Hao __field(unsigned long, pfn) 73cb6c33d4SWenchao Hao __field(const struct page *, page) 74cb6c33d4SWenchao Hao __field(unsigned long, count) 75cb6c33d4SWenchao Hao __field(unsigned int, align) 76cb6c33d4SWenchao Hao __field(int, errorno) 77cb6c33d4SWenchao Hao ), 78cb6c33d4SWenchao Hao 79cb6c33d4SWenchao Hao TP_fast_assign( 80*2c92ca84SSteven Rostedt (Google) __assign_str(name); 81cb6c33d4SWenchao Hao __entry->pfn = pfn; 82cb6c33d4SWenchao Hao __entry->page = page; 83cb6c33d4SWenchao Hao __entry->count = count; 84cb6c33d4SWenchao Hao __entry->align = align; 85cb6c33d4SWenchao Hao __entry->errorno = errorno; 86cb6c33d4SWenchao Hao ), 87cb6c33d4SWenchao Hao 88cb6c33d4SWenchao Hao TP_printk("name=%s pfn=0x%lx page=%p count=%lu align=%u errorno=%d", 89cb6c33d4SWenchao Hao __get_str(name), 90cb6c33d4SWenchao Hao __entry->pfn, 91cb6c33d4SWenchao Hao __entry->page, 92cb6c33d4SWenchao Hao __entry->count, 93cb6c33d4SWenchao Hao __entry->align, 94cb6c33d4SWenchao Hao __entry->errorno) 957bc1aec5SLiam Mark ); 967bc1aec5SLiam Mark 97c710fac6SWenchao Hao TRACE_EVENT(cma_alloc_busy_retry, 987bc1aec5SLiam Mark 993aab8ae7SMinchan Kim TP_PROTO(const char *name, unsigned long pfn, const struct page *page, 10078fa5150SMinchan Kim unsigned long count, unsigned int align), 1017bc1aec5SLiam Mark 102c710fac6SWenchao Hao TP_ARGS(name, pfn, page, count, align), 103c710fac6SWenchao Hao 104c710fac6SWenchao Hao TP_STRUCT__entry( 105c710fac6SWenchao Hao __string(name, name) 106c710fac6SWenchao Hao __field(unsigned long, pfn) 107c710fac6SWenchao Hao __field(const struct page *, page) 108c710fac6SWenchao Hao __field(unsigned long, count) 109c710fac6SWenchao Hao __field(unsigned int, align) 110c710fac6SWenchao Hao ), 111c710fac6SWenchao Hao 112c710fac6SWenchao Hao TP_fast_assign( 113*2c92ca84SSteven Rostedt (Google) __assign_str(name); 114c710fac6SWenchao Hao __entry->pfn = pfn; 115c710fac6SWenchao Hao __entry->page = page; 116c710fac6SWenchao Hao __entry->count = count; 117c710fac6SWenchao Hao __entry->align = align; 118c710fac6SWenchao Hao ), 119c710fac6SWenchao Hao 120c710fac6SWenchao Hao TP_printk("name=%s pfn=0x%lx page=%p count=%lu align=%u", 121c710fac6SWenchao Hao __get_str(name), 122c710fac6SWenchao Hao __entry->pfn, 123c710fac6SWenchao Hao __entry->page, 124c710fac6SWenchao Hao __entry->count, 125c710fac6SWenchao Hao __entry->align) 1267bc1aec5SLiam Mark ); 1277bc1aec5SLiam Mark 12899e8ea6cSStefan Strogin #endif /* _TRACE_CMA_H */ 12999e8ea6cSStefan Strogin 13099e8ea6cSStefan Strogin /* This part must be outside protection */ 13199e8ea6cSStefan Strogin #include <trace/define_trace.h> 132