Re: [PATCH v2] f2fs: optimize trace_f2fs_write_checkpoint with enums
From: Chao Yu
Date: Thu Nov 27 2025 - 22:50:29 EST
On 11/28/25 11:23, YH Lin wrote:
> This patch optimizes the tracepoint by replacing these hardcoded strings
> with a new enumeration f2fs_cp_phase.
>
> 1.Defines enum f2fs_cp_phase with values for each checkpoint phase.
> 2.Updates trace_f2fs_write_checkpoint to accept a u16 phase argument
> instead of a string pointer.
> 3.Uses __print_symbolic in TP_printk to convert the enum values
> back to their corresponding strings for human-readable trace output.
>
> This change reduces the storage overhead for each trace event
> by replacing a variable-length string with a 2-byte integer,
> while maintaining the same readable output in ftrace.
>
> Signed-off-by: YH Lin <yhli@xxxxxxxxxx>
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>
Thanks,