[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231220123644.2a28d162@gandalf.local.home>
Date: Wed, 20 Dec 2023 12:36:44 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Bixuan Cui <cuibixuan@...o.com>
Cc: mhiramat@...nel.org, mathieu.desnoyers@...icios.com,
akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
linux-trace-kernel@...r.kernel.org, linux-mm@...ck.org,
opensource.kernel@...o.com
Subject: Re: [PATCH -next v4 2/2] mm: vmscan: add new event to trace shrink
lru
On Tue, 19 Dec 2023 17:21:23 -0800
Bixuan Cui <cuibixuan@...o.com> wrote:
> diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
> index b99cd28c9815..02868bdc5999 100644
> --- a/include/trace/events/vmscan.h
> +++ b/include/trace/events/vmscan.h
> @@ -395,7 +395,24 @@ TRACE_EVENT(mm_vmscan_write_folio,
> show_reclaim_flags(__entry->reclaim_flags))
> );
>
> -TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
> +TRACE_EVENT(mm_vmscan_lru_shrink_inactive_start,
> +
> + TP_PROTO(int nid),
> +
> + TP_ARGS(nid),
> +
> + TP_STRUCT__entry(
> + __field(int, nid)
> + ),
> +
> + TP_fast_assign(
> + __entry->nid = nid;
> + ),
> +
> + TP_printk("nid=%d", __entry->nid)
> +);
> +
> +TRACE_EVENT(mm_vmscan_lru_shrink_inactive_end,
>
> TP_PROTO(int nid,
> unsigned long nr_scanned, unsigned long nr_reclaimed,
> @@ -446,7 +463,24 @@ TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
> show_reclaim_flags(__entry->reclaim_flags))
> );
>
> -TRACE_EVENT(mm_vmscan_lru_shrink_active,
> +TRACE_EVENT(mm_vmscan_lru_shrink_active_start,
> +
> + TP_PROTO(int nid),
> +
> + TP_ARGS(nid),
> +
> + TP_STRUCT__entry(
> + __field(int, nid)
> + ),
> +
> + TP_fast_assign(
> + __entry->nid = nid;
> + ),
> +
> + TP_printk("nid=%d", __entry->nid)
> +);
> +
> +TRACE_EVENT(mm_vmscan_lru_shrink_active_end,
>
These two events are identical, please use DECLARE_EVENT_CLASS and
DEFINE_EVENT macros:
DECLARE_EVENT_CLASS(mm_vmscan_lru_shrink_start_template,
TP_PROTO(int nid),
TP_ARGS(nid),
TP_STRUCT__entry(
__field(int, nid)
),
TP_fast_assign(
__entry->nid = nid;
),
TP_printk("nid=%d", __entry->nid)
);
DEFINE_EVENT(mm_vmscan_lru_shrink_start_template, mm_vmscan_lru_shrink_inactive_start,
TP_PROTO(int nid),
TP_ARGS(nid)
);
DEFINE_EVENT(mm_vmscan_lru_shrink_start_template, mm_vmscan_lru_shrink_active_end,
TP_PROTO(int nid),
TP_ARGS(nid)
);
This saves a bit of memory footprint when doing so.
-- Steve
Powered by blists - more mailing lists