Re: [PATCH iproute2-next 2/3] utils: timestamp: add JSON support
From: Matthieu Baerts <matttbe@kernel.org>
Date: 2026-02-23 15:31:37
Also in:
mptcp
Hi Stephen, On 23/02/2026 14:20, Matthieu Baerts wrote:
Hi Stephen, On 21/02/2026 06:39, Stephen Hemminger wrote:quoted
On Fri, 20 Feb 2026 19:54:02 +0100 "Matthieu Baerts (NGI0)" [off-list ref] wrote:quoted
Only if the output stream is 'stdout', because all JSON helpers like print_string() only write on 'stdout'. Supporting JSON is easy with the helpers. The biggest modification is to extract the end value. No behavioural changes intended for the moment, this is a preparation for a future usage of print_timestamp() within a JSON context. Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>I would go farther, fp is always stdout. Drop the argument to the function.Good idea! To be coherent with the rest, I started to look at removing the same argument from the caller functions, and similar ones. I did a very quick draft with a few sed, etc. but I'm not sure whether I should take this direction: https://github.com/matttbe/iproute2/commit/585b0109 WDYT? Or should I only drop fp from print_timestamp()? Or simply not use it like it is done in many other helpers supporting JSON?
I just sent a v2 with the minimal modifications around print_timestamp: the argument is now simply ignored like it is the case in other helpers supporting JSON. If there is a need to continue the cleanup, probably better to do that in a different series I guess. Cheers, Matt -- Sponsored by the NGI0 Core fund.