All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Poirier <bpoirier@suse.com>
To: Quentin Monnet <quentin.monnet@netronome.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	netdev@vger.kernel.org, bpf@vger.kernel.org,
	David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH v2 bpf-next 1/2] bpftool: Use print_entry_error() in case of ENOENT when dumping
Date: Sat, 13 Apr 2019 07:49:24 +0900	[thread overview]
Message-ID: <20190412224924.GA21826@f1> (raw)
In-Reply-To: <44958814-3145-717f-366e-ecc52f2145b9@netronome.com>

On 2019/04/12 11:28, Quentin Monnet wrote:
[...]
> 
> >   {
> > -	int value_size = strlen(value);
> > -	bool single_line, break_names;
> > +	bool break_names;
> > -	break_names = info->key_size > 16 || value_size > 16;
> > -	single_line = info->key_size + value_size <= 24 && !break_names;
> > +	break_names = info->key_size > 16;
> > +	single_line = single_line && !break_names;
> 
> If I understand correctly, this will also change formatting when error
> message is short (shorter than 16 characters: the "value" line will now be
> unconditionally split, even for short error messages (other than "<no
> entry>")). Why removing the condition on value_size > 16? (This is just a
> remark, I am not against changing it.)
> 

With this patch, the error messages from bpftool ("<no entry>", "<cannot
read>"), which are chosen to be short, appear on the same line and the
messages from strerror appear on a separate line. Because those latter
messages are from a source external to bpftool and their length is
unknown ahead of time, I felt it led to a more predictable output to
consistently put them on their own line.

To be honest, I don't think the formatting in those print_entry_*
functions should change according to the length in any case. I think the
key and value for each entry should always be on the same line for ease
of grepping. A followup patch maybe...

  reply	other threads:[~2019-04-12 22:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11  8:27 [PATCH bpf-next] bpftool: Exit early when it's not possible to dump a REUSEPORT_SOCKARRAY map Benjamin Poirier
2019-04-11 11:20 ` Quentin Monnet
2019-04-11 20:31 ` Jakub Kicinski
2019-04-12  3:03 ` [PATCH v2 bpf-next 1/2] bpftool: Use print_entry_error() in case of ENOENT when dumping Benjamin Poirier
2019-04-12  3:03   ` [PATCH v2 bpf-next 2/2] bpftool: Improve handling of ENOSPC on reuseport_array map dumps Benjamin Poirier
2019-04-12 10:28     ` Quentin Monnet
2019-04-13  0:00     ` Jakub Kicinski
2019-04-12 10:28   ` [PATCH v2 bpf-next 1/2] bpftool: Use print_entry_error() in case of ENOENT when dumping Quentin Monnet
2019-04-12 22:49     ` Benjamin Poirier [this message]
2019-04-12 23:53       ` Jakub Kicinski
2019-04-14 23:29         ` Benjamin Poirier
2019-04-12 23:57   ` Jakub Kicinski
2019-04-15  7:15   ` [PATCH v3 " Benjamin Poirier
2019-04-15  7:15     ` [PATCH v3 bpf-next 2/2] bpftool: Improve handling of ENOSPC on reuseport_array map dumps Benjamin Poirier
2019-04-15  9:20       ` Quentin Monnet
2019-04-15 18:38       ` Jakub Kicinski
2019-04-15  9:18     ` [PATCH v3 bpf-next 1/2] bpftool: Use print_entry_error() in case of ENOENT when dumping Quentin Monnet
2019-04-15 18:38     ` Jakub Kicinski
2019-04-16  8:29     ` Daniel Borkmann

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=20190412224924.GA21826@f1 \
    --to=bpoirier@suse.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=dsahern@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=quentin.monnet@netronome.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.