public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Baerts <matttbe@kernel.org>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: David Ahern <dsahern@kernel.org>,
	netdev@vger.kernel.org, mptcp@lists.linux.dev
Subject: Re: [PATCH iproute2-next 2/3] utils: timestamp: add JSON support
Date: Mon, 23 Feb 2026 14:20:33 +0100	[thread overview]
Message-ID: <1bdb2c3d-a1b8-432c-8933-d7df3fc10ce5@kernel.org> (raw)
In-Reply-To: <20260220213900.76198834@phoenix.local>

Hi Stephen,

On 21/02/2026 06:39, Stephen Hemminger wrote:
> On Fri, 20 Feb 2026 19:54:02 +0100
> "Matthieu Baerts (NGI0)" <matttbe@kernel.org> wrote:
> 
>> 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?

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.


  reply	other threads:[~2026-02-23 13:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-20 18:54 [PATCH iproute2-next 0/3] ip mptcp monitor: add JSON support Matthieu Baerts (NGI0)
2026-02-20 18:54 ` [PATCH iproute2-next 1/3] mptcp: uniform stream closure Matthieu Baerts (NGI0)
2026-02-20 18:54 ` [PATCH iproute2-next 2/3] utils: timestamp: add JSON support Matthieu Baerts (NGI0)
2026-02-21  5:39   ` Stephen Hemminger
2026-02-23 13:20     ` Matthieu Baerts [this message]
2026-02-23 15:31       ` Matthieu Baerts
2026-02-20 18:54 ` [PATCH iproute2-next 3/3] mptcp: monitor: " Matthieu Baerts (NGI0)
2026-02-21  5:23   ` Stephen Hemminger
2026-02-21  5:35 ` [PATCH iproute2-next 0/3] ip mptcp " Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bdb2c3d-a1b8-432c-8933-d7df3fc10ce5@kernel.org \
    --to=matttbe@kernel.org \
    --cc=dsahern@kernel.org \
    --cc=mptcp@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox