public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Bunyod Suvonov <b.suvonov@sjtu.edu.cn>
Cc: akpm@linux-foundation.org, vbabka@kernel.org, linux-mm@kvack.org,
	mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
	linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org,
	surenb@google.com, mhocko@suse.com, jackmanb@google.com,
	hannes@cmpxchg.org, ziy@nvidia.com, david@kernel.org,
	vishal.moola@gmail.com, corbet@lwn.net,
	skhan@linuxfoundation.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v2] mm/page_alloc: trace PCP refills and PCP zone lock usage
Date: Tue, 28 Apr 2026 14:23:35 -0400	[thread overview]
Message-ID: <20260428142335.3bca0166@gandalf.local.home> (raw)
In-Reply-To: <20260427060142.131055-1-b.suvonov@sjtu.edu.cn>

On Mon, 27 Apr 2026 14:01:42 +0800
Bunyod Suvonov <b.suvonov@sjtu.edu.cn> wrote:

> +	TP_STRUCT__entry(
> +		__field(int, nid)
> +		__field(int, zid)
> +		__field(unsigned long, nr_pages)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->nid		= nid;
> +		__entry->zid		= zid;
> +		__entry->nr_pages	= nr_pages;
> +	),
> +
> +	TP_printk("nid=%d zid=%d nr_pages=%lu",
> +		__entry->nid, __entry->zid, __entry->nr_pages)
> +);
> +
> +DEFINE_EVENT(mm_page_pcpu_zone_locked, mm_page_pcpu_refill_zone_locked,
> +
> +	TP_PROTO(int nid, int zid, unsigned long nr_pages),
> +
> +	TP_ARGS(nid, zid, nr_pages)
> +);
> +
> +DEFINE_EVENT(mm_page_pcpu_zone_locked, mm_page_pcpu_drain_zone_locked,
> +
> +	TP_PROTO(int nid, int zid, unsigned long nr_pages),
> +
> +	TP_ARGS(nid, zid, nr_pages)
> +);
> +
> +DECLARE_EVENT_CLASS(mm_page_pcpu,
>  
>  	TP_PROTO(struct page *page, unsigned int order, int migratetype),
>  
>  	TP_ARGS(page, order, migratetype),
>  
>  	TP_STRUCT__entry(
> -		__field(	unsigned long,	pfn		)
> -		__field(	unsigned int,	order		)
> -		__field(	int,		migratetype	)
> +		__field(unsigned long, pfn)
> +		__field(unsigned int, order)
> +		__field(int, migratetype)

Why this change? It makes it much harder to understand.

The above is not a normal macro. Ignore any checkpatch warnings about it.
The proper way to do the TP_STRUCT__entry() is to make it just like a struct:

struct {
	unsigned long		pfn;
	unsigned int		order;
	int			migratetype;
};

Thus, the macro should be:

	TP_STRUCT__entry(
		__field(	unsigned long,	pfn		)
		__field(	unsigned int,	order		)
		__field(	int,		migratetype	)
	),

-- Steve



>  	),
>  

  parent reply	other threads:[~2026-04-28 18:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-25  9:13 [PATCH] mm/page_alloc: add tracepoint for PCP refills Bunyod Suvonov
2026-04-26 22:06 ` Vishal Moola
2026-04-27  6:01 ` [PATCH v2] mm/page_alloc: trace PCP refills and PCP zone lock usage Bunyod Suvonov
2026-04-27  6:21   ` SUVONOV BUNYOD
2026-04-28 18:23   ` Steven Rostedt [this message]
2026-04-29  3:31     ` SUVONOV BUNYOD
2026-04-29 14:52       ` Steven Rostedt

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=20260428142335.3bca0166@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=b.suvonov@sjtu.edu.cn \
    --cc=corbet@lwn.net \
    --cc=david@kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=jackmanb@google.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mhocko@suse.com \
    --cc=skhan@linuxfoundation.org \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=vishal.moola@gmail.com \
    --cc=ziy@nvidia.com \
    /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