Yang Shi 37f0b47c51 mm: khugepaged: fix the arguments order in khugepaged_collapse_file trace point
The "addr" and "is_shmem" arguments have different order in TP_PROTO and
TP_ARGS.  This resulted in the incorrect trace result:

text-hugepage-644429 [276] 392092.878683: mm_khugepaged_collapse_file:
mm=0xffff20025d52c440, hpage_pfn=0x200678c00, index=512, addr=1, is_shmem=0,
filename=text-hugepage, nr=512, result=failed

The value of "addr" is wrong because it was treated as bool value, the
type of is_shmem.

Fix the order in TP_PROTO to keep "addr" is before "is_shmem" since the
original patch review suggested this order to achieve best packing.

And use "lx" for "addr" instead of "ld" in TP_printk because address is
typically shown in hex.

After the fix, the trace result looks correct:

text-hugepage-7291  [004]   128.627251: mm_khugepaged_collapse_file:
mm=0xffff0001328f9500, hpage_pfn=0x20016ea00, index=512, addr=0x400000,
is_shmem=0, filename=text-hugepage, nr=512, result=failed

Link: https://lkml.kernel.org/r/20241012011702.1084846-1-yang@os.amperecomputing.com
Fixes: 4c9473e87e75 ("mm/khugepaged: add tracepoint to collapse_file()")
Signed-off-by: Yang Shi <yang@os.amperecomputing.com>
Cc: Gautam Menghani <gautammenghani201@gmail.com>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Cc: <stable@vger.kernel.org>    [6.2+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-10-17 00:28:09 -07:00
..
2024-03-11 10:37:45 -07:00
2023-07-04 19:40:16 +01:00
2023-07-04 19:40:16 +01:00
2024-04-25 20:56:20 -07:00
2024-05-08 10:39:26 +01:00
2023-03-24 11:01:29 +01:00
2024-07-10 12:14:54 -07:00
2023-12-29 11:58:27 -08:00
2023-07-17 08:18:17 -06:00
2024-05-14 07:22:35 -06:00
2024-09-11 20:44:31 -07:00
2022-07-30 14:01:30 -04:00
2024-06-20 15:19:17 -06:00
2024-06-19 12:44:22 +01:00
2023-10-04 10:32:29 -07:00
2023-07-17 08:18:17 -06:00
2023-09-19 07:04:49 +02:00