1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM page_pool
5 #if !defined(_TRACE_PAGE_POOL_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_PAGE_POOL_H
8 #include <linux/types.h>
9 #include <linux/tracepoint.h>
11 #include <trace/events/mmflags.h>
12 #include <net/page_pool/types.h>
14 TRACE_EVENT(page_pool_release
,
16 TP_PROTO(const struct page_pool
*pool
,
17 s32 inflight
, u32 hold
, u32 release
),
19 TP_ARGS(pool
, inflight
, hold
, release
),
22 __field(const struct page_pool
*, pool
)
23 __field(s32
, inflight
)
31 __entry
->inflight
= inflight
;
33 __entry
->release
= release
;
34 __entry
->cnt
= pool
->destroy_cnt
;
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
)
42 TRACE_EVENT(page_pool_state_release
,
44 TP_PROTO(const struct page_pool
*pool
,
45 netmem_ref netmem
, u32 release
),
47 TP_ARGS(pool
, netmem
, release
),
50 __field(const struct page_pool
*, pool
)
51 __field(unsigned long, netmem
)
53 __field(unsigned long, pfn
)
58 __entry
->netmem
= (__force
unsigned long)netmem
;
59 __entry
->release
= release
;
60 __entry
->pfn
= netmem_pfn_trace(netmem
);
63 TP_printk("page_pool=%p netmem=%p is_net_iov=%lu pfn=0x%lx release=%u",
64 __entry
->pool
, (void *)__entry
->netmem
,
65 __entry
->netmem
& NET_IOV
, __entry
->pfn
, __entry
->release
)
68 TRACE_EVENT(page_pool_state_hold
,
70 TP_PROTO(const struct page_pool
*pool
,
71 netmem_ref netmem
, u32 hold
),
73 TP_ARGS(pool
, netmem
, hold
),
76 __field(const struct page_pool
*, pool
)
77 __field(unsigned long, netmem
)
79 __field(unsigned long, pfn
)
84 __entry
->netmem
= (__force
unsigned long)netmem
;
86 __entry
->pfn
= netmem_pfn_trace(netmem
);
89 TP_printk("page_pool=%p netmem=%p is_net_iov=%lu, pfn=0x%lx hold=%u",
90 __entry
->pool
, (void *)__entry
->netmem
,
91 __entry
->netmem
& NET_IOV
, __entry
->pfn
, __entry
->hold
)
94 TRACE_EVENT(page_pool_update_nid
,
96 TP_PROTO(const struct page_pool
*pool
, int new_nid
),
98 TP_ARGS(pool
, new_nid
),
101 __field(const struct page_pool
*, pool
)
102 __field(int, pool_nid
)
103 __field(int, new_nid
)
107 __entry
->pool
= pool
;
108 __entry
->pool_nid
= pool
->p
.nid
;
109 __entry
->new_nid
= new_nid
;
112 TP_printk("page_pool=%p pool_nid=%d new_nid=%d",
113 __entry
->pool
, __entry
->pool_nid
, __entry
->new_nid
)
116 #endif /* _TRACE_PAGE_POOL_H */
118 /* This part must be outside protection */
119 #include <trace/define_trace.h>