From: Kassey Li <quic_yingangl@quicinc.com>
To: <akpm@linux-foundation.org>, <vbabka@kernel.org>
Cc: <minchan@kernel.org>, <vbabka@suse.cz>, <iamjoonsoo.kim@lge.com>,
<linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
<quic_yingangl@quicinc.com>
Subject: [PATCH] trace/events/page_ref: add page info to page_ref trace event
Date: Thu, 31 Oct 2024 10:42:22 +0800 [thread overview]
Message-ID: <20241031024222.505844-1-quic_yingangl@quicinc.com> (raw)
This followed
commit 53d884a6675b ("mm, tracing: unify PFN format strings")
to add page info.
In many kernel code we are talking with page other than pfn,
here we added page algin with pfn.
Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
---
include/trace/events/page_ref.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/trace/events/page_ref.h b/include/trace/events/page_ref.h
index fe33a255b7d0..76df13b2a5b3 100644
--- a/include/trace/events/page_ref.h
+++ b/include/trace/events/page_ref.h
@@ -18,6 +18,7 @@ DECLARE_EVENT_CLASS(page_ref_mod_template,
TP_STRUCT__entry(
__field(unsigned long, pfn)
+ __field(const struct page *, page)
__field(unsigned long, flags)
__field(int, count)
__field(int, mapcount)
@@ -28,6 +29,7 @@ DECLARE_EVENT_CLASS(page_ref_mod_template,
TP_fast_assign(
__entry->pfn = page_to_pfn(page);
+ __entry->page = page;
__entry->flags = page->flags;
__entry->count = page_ref_count(page);
__entry->mapcount = atomic_read(&page->_mapcount);
@@ -36,8 +38,9 @@ DECLARE_EVENT_CLASS(page_ref_mod_template,
__entry->val = v;
),
- TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d",
+ TP_printk("pfn=0x%lx page=%p flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d",
__entry->pfn,
+ __entry->page,
show_page_flags(__entry->flags & PAGEFLAGS_MASK),
__entry->count,
__entry->mapcount, __entry->mapping, __entry->mt,
@@ -66,6 +69,7 @@ DECLARE_EVENT_CLASS(page_ref_mod_and_test_template,
TP_STRUCT__entry(
__field(unsigned long, pfn)
+ __field(const struct page *, page)
__field(unsigned long, flags)
__field(int, count)
__field(int, mapcount)
@@ -77,6 +81,7 @@ DECLARE_EVENT_CLASS(page_ref_mod_and_test_template,
TP_fast_assign(
__entry->pfn = page_to_pfn(page);
+ __entry->page = page;
__entry->flags = page->flags;
__entry->count = page_ref_count(page);
__entry->mapcount = atomic_read(&page->_mapcount);
@@ -86,8 +91,9 @@ DECLARE_EVENT_CLASS(page_ref_mod_and_test_template,
__entry->ret = ret;
),
- TP_printk("pfn=0x%lx flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d ret=%d",
+ TP_printk("pfn=0x%lx page=%p flags=%s count=%d mapcount=%d mapping=%p mt=%d val=%d ret=%d",
__entry->pfn,
+ __entry->page,
show_page_flags(__entry->flags & PAGEFLAGS_MASK),
__entry->count,
__entry->mapcount, __entry->mapping, __entry->mt,
--
2.25.1
next reply other threads:[~2024-10-31 2:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-31 2:42 Kassey Li [this message]
2024-10-31 3:56 ` Matthew Wilcox
2024-10-31 7:24 ` Vlastimil Babka (SUSE)
2024-11-04 7:35 ` Kassey Li quic
2024-11-04 13:39 ` Matthew Wilcox
2024-11-05 0:33 ` Kassey Li quic
2024-11-05 0:35 ` Kassey Li quic
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241031024222.505844-1-quic_yingangl@quicinc.com \
--to=quic_yingangl@quicinc.com \
--cc=akpm@linux-foundation.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=vbabka@kernel.org \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox