Re: [PATCH 2/3] tools/accounting: factor out shared format_timespec() implementation

From: xu.xin16

Date: Sat Jul 18 2026 - 09:27:45 EST


> From: Wang Yaxin <wang.yaxin@xxxxxxxxxx>
>
> The same __kernel_timespec formatting logic existed independently in
> both getdelays.c and delaytop.c with minor differences (strftime vs
> snprintf, __kernel_time64_t vs time_t).
>
> Create a shared format_timespec.c/h with a canonical implementation
> (strftime + time_t), remove the static copies from both files, and
> link both programs against the common object.
>
> Also simplify the Makefile with a pattern rule for %.o and a static
> pattern rule for the two programs that need format_timespec.o.
>
> Signed-off-by: Wang Yaxin <wang.yaxin@xxxxxxxxxx>

Acked-by: Xu Xin <xu.xin16@xxxxxxxxxx>