[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220708133147.20f3d887@gandalf.local.home>
Date: Fri, 8 Jul 2022 13:31:47 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Gang Li <ligang.bdlg@...edance.com>
Cc: mhocko@...e.com, akpm@...ux-foundation.org, surenb@...gle.com,
Ingo Molnar <mingo@...hat.com>, hca@...ux.ibm.com,
gor@...ux.ibm.com, agordeev@...ux.ibm.com,
borntraeger@...ux.ibm.com, svens@...ux.ibm.com,
viro@...iv.linux.org.uk, ebiederm@...ssion.com,
keescook@...omium.org, peterz@...radead.org, acme@...nel.org,
mark.rutland@....com, alexander.shishkin@...ux.intel.com,
jolsa@...nel.org, namhyung@...nel.org, david@...hat.com,
imbrenda@...ux.ibm.com, adobriyan@...il.com,
yang.yang29@....com.cn, brauner@...nel.org,
stephen.s.brennan@...cle.com, zhengqi.arch@...edance.com,
haolee.swjtu@...il.com, xu.xin16@....com.cn,
Liam.Howlett@...cle.com, ohoono.kwon@...sung.com,
peterx@...hat.com, arnd@...db.de, shy828301@...il.com,
alex.sierra@....com, xianting.tian@...ux.alibaba.com,
willy@...radead.org, ccross@...gle.com, vbabka@...e.cz,
sujiaxun@...ontech.com, sfr@...b.auug.org.au,
vasily.averin@...ux.dev, mgorman@...e.de, vvghjk1234@...il.com,
tglx@...utronix.de, luto@...nel.org, bigeasy@...utronix.de,
fenghua.yu@...el.com, linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v2 3/5] mm: add numa fields for tracepoint rss_stat
On Fri, 8 Jul 2022 16:21:27 +0800
Gang Li <ligang.bdlg@...edance.com> wrote:
> --- a/include/trace/events/kmem.h
> +++ b/include/trace/events/kmem.h
> @@ -363,7 +363,8 @@ static unsigned int __maybe_unused mm_ptr_to_hash(const void *ptr)
> EM(MM_FILEPAGES) \
> EM(MM_ANONPAGES) \
> EM(MM_SWAPENTS) \
> - EMe(MM_SHMEMPAGES)
> + EM(MM_SHMEMPAGES) \
> + EMe(MM_NO_TYPE)
>
> #undef EM
> #undef EMe
> @@ -383,29 +384,41 @@ TRACE_EVENT(rss_stat,
>
> TP_PROTO(struct mm_struct *mm,
> int member,
> - long count),
> + long member_count,
> + int node,
> + long node_count,
> + long diff_count),
>
> - TP_ARGS(mm, member, count),
> + TP_ARGS(mm, member, member_count, node, node_count, diff_count),
>
> TP_STRUCT__entry(
> __field(unsigned int, mm_id)
> __field(unsigned int, curr)
> __field(int, member)
> - __field(long, size)
> + __field(long, member_size)
> + __field(int, node)
Please swap the node and member_size fields. I just noticed that size
should have been before member in the original as well. Because it will
leave a 4 byte "hole" in the event due to alignment on 64 bit machines.
-- Steve
> + __field(long, node_size)
> + __field(long, diff_size)
> ),
>
> TP_fast_assign(
> __entry->mm_id = mm_ptr_to_hash(mm);
> __entry->curr = !!(current->mm == mm);
> __entry->member = member;
> - __entry->size = (count << PAGE_SHIFT);
> + __entry->member_size = (member_count << PAGE_SHIFT);
> + __entry->node = node;
> + __entry->node_size = (node_count << PAGE_SHIFT);
> + __entry->diff_size = (diff_count << PAGE_SHIFT);
> ),
>
> - TP_printk("mm_id=%u curr=%d type=%s size=%ldB",
> + TP_printk("mm_id=%u curr=%d type=%s type_size=%ldB node=%d node_size=%ldB diff_size=%ldB",
> __entry->mm_id,
> __entry->curr,
> __print_symbolic(__entry->member, TRACE_MM_PAGES),
> - __entry->size)
> + __entry->member_size,
> + __entry->node,
> + __entry->node_size,
> + __entry->diff_size)
> );
> #endif /* _TRACE_KMEM_H */
>
Powered by blists - more mailing lists