Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #undef TRACE_SYSTEM |
| 3 | #define TRACE_SYSTEM page_pool |
| 4 | |
| 5 | #if !defined(_TRACE_PAGE_POOL_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 | #define _TRACE_PAGE_POOL_H |
| 7 | |
| 8 | #include <linux/types.h> |
| 9 | #include <linux/tracepoint.h> |
| 10 | |
Jesper Dangaard Brouer | 832ccf6f8 | 2019-11-16 12:22:48 +0100 | [diff] [blame] | 11 | #include <trace/events/mmflags.h> |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 12 | #include <net/page_pool.h> |
| 13 | |
Jesper Dangaard Brouer | 7c9e694 | 2019-11-16 12:22:43 +0100 | [diff] [blame] | 14 | TRACE_EVENT(page_pool_release, |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 15 | |
| 16 | TP_PROTO(const struct page_pool *pool, |
| 17 | s32 inflight, u32 hold, u32 release), |
| 18 | |
| 19 | TP_ARGS(pool, inflight, hold, release), |
| 20 | |
| 21 | TP_STRUCT__entry( |
| 22 | __field(const struct page_pool *, pool) |
| 23 | __field(s32, inflight) |
| 24 | __field(u32, hold) |
| 25 | __field(u32, release) |
Jesper Dangaard Brouer | 7c9e694 | 2019-11-16 12:22:43 +0100 | [diff] [blame] | 26 | __field(u64, cnt) |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 27 | ), |
| 28 | |
| 29 | TP_fast_assign( |
| 30 | __entry->pool = pool; |
| 31 | __entry->inflight = inflight; |
| 32 | __entry->hold = hold; |
| 33 | __entry->release = release; |
Jesper Dangaard Brouer | 7c9e694 | 2019-11-16 12:22:43 +0100 | [diff] [blame] | 34 | __entry->cnt = pool->destroy_cnt; |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 35 | ), |
| 36 | |
Jesper Dangaard Brouer | 7c9e694 | 2019-11-16 12:22:43 +0100 | [diff] [blame] | 37 | TP_printk("page_pool=%p inflight=%d hold=%u release=%u cnt=%llu", |
| 38 | __entry->pool, __entry->inflight, __entry->hold, |
| 39 | __entry->release, __entry->cnt) |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 40 | ); |
| 41 | |
| 42 | TRACE_EVENT(page_pool_state_release, |
| 43 | |
| 44 | TP_PROTO(const struct page_pool *pool, |
| 45 | const struct page *page, u32 release), |
| 46 | |
| 47 | TP_ARGS(pool, page, release), |
| 48 | |
| 49 | TP_STRUCT__entry( |
| 50 | __field(const struct page_pool *, pool) |
| 51 | __field(const struct page *, page) |
| 52 | __field(u32, release) |
Jesper Dangaard Brouer | 832ccf6f8 | 2019-11-16 12:22:48 +0100 | [diff] [blame] | 53 | __field(unsigned long, pfn) |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 54 | ), |
| 55 | |
| 56 | TP_fast_assign( |
| 57 | __entry->pool = pool; |
| 58 | __entry->page = page; |
| 59 | __entry->release = release; |
Jesper Dangaard Brouer | 832ccf6f8 | 2019-11-16 12:22:48 +0100 | [diff] [blame] | 60 | __entry->pfn = page_to_pfn(page); |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 61 | ), |
| 62 | |
Jesper Dangaard Brouer | 832ccf6f8 | 2019-11-16 12:22:48 +0100 | [diff] [blame] | 63 | TP_printk("page_pool=%p page=%p pfn=%lu release=%u", |
| 64 | __entry->pool, __entry->page, __entry->pfn, __entry->release) |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 65 | ); |
| 66 | |
| 67 | TRACE_EVENT(page_pool_state_hold, |
| 68 | |
| 69 | TP_PROTO(const struct page_pool *pool, |
| 70 | const struct page *page, u32 hold), |
| 71 | |
| 72 | TP_ARGS(pool, page, hold), |
| 73 | |
| 74 | TP_STRUCT__entry( |
| 75 | __field(const struct page_pool *, pool) |
| 76 | __field(const struct page *, page) |
| 77 | __field(u32, hold) |
Jesper Dangaard Brouer | 832ccf6f8 | 2019-11-16 12:22:48 +0100 | [diff] [blame] | 78 | __field(unsigned long, pfn) |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 79 | ), |
| 80 | |
| 81 | TP_fast_assign( |
| 82 | __entry->pool = pool; |
| 83 | __entry->page = page; |
| 84 | __entry->hold = hold; |
Jesper Dangaard Brouer | 832ccf6f8 | 2019-11-16 12:22:48 +0100 | [diff] [blame] | 85 | __entry->pfn = page_to_pfn(page); |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 86 | ), |
| 87 | |
Jesper Dangaard Brouer | 832ccf6f8 | 2019-11-16 12:22:48 +0100 | [diff] [blame] | 88 | TP_printk("page_pool=%p page=%p pfn=%lu hold=%u", |
| 89 | __entry->pool, __entry->page, __entry->pfn, __entry->hold) |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 90 | ); |
| 91 | |
Saeed Mahameed | bc83674 | 2019-11-20 00:15:17 +0000 | [diff] [blame] | 92 | TRACE_EVENT(page_pool_update_nid, |
| 93 | |
| 94 | TP_PROTO(const struct page_pool *pool, int new_nid), |
| 95 | |
| 96 | TP_ARGS(pool, new_nid), |
| 97 | |
| 98 | TP_STRUCT__entry( |
| 99 | __field(const struct page_pool *, pool) |
| 100 | __field(int, pool_nid) |
| 101 | __field(int, new_nid) |
| 102 | ), |
| 103 | |
| 104 | TP_fast_assign( |
| 105 | __entry->pool = pool; |
| 106 | __entry->pool_nid = pool->p.nid; |
| 107 | __entry->new_nid = new_nid; |
| 108 | ), |
| 109 | |
| 110 | TP_printk("page_pool=%p pool_nid=%d new_nid=%d", |
| 111 | __entry->pool, __entry->pool_nid, __entry->new_nid) |
| 112 | ); |
| 113 | |
Jesper Dangaard Brouer | 32c28f7 | 2019-06-18 15:06:03 +0200 | [diff] [blame] | 114 | #endif /* _TRACE_PAGE_POOL_H */ |
| 115 | |
| 116 | /* This part must be outside protection */ |
| 117 | #include <trace/define_trace.h> |