Commit 832ccf6f authored by Jesper Dangaard Brouer's avatar Jesper Dangaard Brouer Committed by David S. Miller

page_pool: extend tracepoint to also include the page PFN

The MM tracepoint for page free (called kmem:mm_page_free) doesn't provide
the page pointer directly, instead it provides the PFN (Page Frame Number).
This is annoying when writing a page_pool leak detector in BPF.

This patch change page_pool tracepoints to also provide the PFN.
The page pointer is still provided to allow other kinds of
troubleshooting from BPF.
Signed-off-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7c9e6942
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
#include <trace/events/mmflags.h>
#include <net/page_pool.h> #include <net/page_pool.h>
TRACE_EVENT(page_pool_release, TRACE_EVENT(page_pool_release,
...@@ -49,16 +50,18 @@ TRACE_EVENT(page_pool_state_release, ...@@ -49,16 +50,18 @@ TRACE_EVENT(page_pool_state_release,
__field(const struct page_pool *, pool) __field(const struct page_pool *, pool)
__field(const struct page *, page) __field(const struct page *, page)
__field(u32, release) __field(u32, release)
__field(unsigned long, pfn)
), ),
TP_fast_assign( TP_fast_assign(
__entry->pool = pool; __entry->pool = pool;
__entry->page = page; __entry->page = page;
__entry->release = release; __entry->release = release;
__entry->pfn = page_to_pfn(page);
), ),
TP_printk("page_pool=%p page=%p release=%u", TP_printk("page_pool=%p page=%p pfn=%lu release=%u",
__entry->pool, __entry->page, __entry->release) __entry->pool, __entry->page, __entry->pfn, __entry->release)
); );
TRACE_EVENT(page_pool_state_hold, TRACE_EVENT(page_pool_state_hold,
...@@ -72,16 +75,18 @@ TRACE_EVENT(page_pool_state_hold, ...@@ -72,16 +75,18 @@ TRACE_EVENT(page_pool_state_hold,
__field(const struct page_pool *, pool) __field(const struct page_pool *, pool)
__field(const struct page *, page) __field(const struct page *, page)
__field(u32, hold) __field(u32, hold)
__field(unsigned long, pfn)
), ),
TP_fast_assign( TP_fast_assign(
__entry->pool = pool; __entry->pool = pool;
__entry->page = page; __entry->page = page;
__entry->hold = hold; __entry->hold = hold;
__entry->pfn = page_to_pfn(page);
), ),
TP_printk("page_pool=%p page=%p hold=%u", TP_printk("page_pool=%p page=%p pfn=%lu hold=%u",
__entry->pool, __entry->page, __entry->hold) __entry->pool, __entry->page, __entry->pfn, __entry->hold)
); );
#endif /* _TRACE_PAGE_POOL_H */ #endif /* _TRACE_PAGE_POOL_H */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment