netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox.net>
To: Jakub Kicinski <jakub.kicinski@netronome.com>, netdev@vger.kernel.org
Cc: oss-drivers@netronome.com, alexei.starovoitov@gmail.com,
	Quentin Monnet <quentin.monnet@netronome.com>
Subject: Re: [PATCH net-next 09/12] tools: bpftool: turn err() and info() macros into functions
Date: Mon, 23 Oct 2017 22:33:35 +0200	[thread overview]
Message-ID: <59EE521F.2000902@iogearbox.net> (raw)
In-Reply-To: <20171023162416.32753-10-jakub.kicinski@netronome.com>

On 10/23/2017 06:24 PM, Jakub Kicinski wrote:
> From: Quentin Monnet <quentin.monnet@netronome.com>
>
> Turn err() and info() macros into functions.
>
> In order to avoid naming conflicts with variables in the code, rename
> them as p_err() and p_info() respectively.
>
> The behavior of these functions is similar to the one of the macros for
> plain output. However, when JSON output is requested, these macros
> return a JSON-formatted "error" object instead of printing a message to
> stderr.
>
> To handle error messages correctly with JSON, a modification was brought
> to their behavior nonetheless: the functions now append a end-of-line
> character at the end of the message. This way, we can remove end-of-line
> characters at the end of the argument strings, and not have them in the
> JSON output.
>
> All error messages are formatted to hold in a single call to p_err(), in
> order to produce a single JSON field.
>
> Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>

Acked-by: Daniel Borkmann <daniel@iogearbox.net>

  reply	other threads:[~2017-10-23 20:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-23 16:24 [PATCH net-next 00/12] tools: bpftool: Add JSON output to bpftool Jakub Kicinski
2017-10-23 16:24 ` [PATCH net-next 01/12] tools: bpftool: copy JSON writer from iproute2 repository Jakub Kicinski
2017-10-23 20:29   ` Daniel Borkmann
2017-10-24  8:23   ` Stephen Hemminger
2017-10-23 16:24 ` [PATCH net-next 02/12] tools: bpftool: add option parsing to bpftool, --help and --version Jakub Kicinski
2017-10-23 20:30   ` Daniel Borkmann
2017-10-23 16:24 ` [PATCH net-next 03/12] tools: bpftool: introduce --json and --pretty options Jakub Kicinski
2017-10-23 20:30   ` Daniel Borkmann
2017-10-23 16:24 ` [PATCH net-next 04/12] tools: bpftool: add JSON output for `bpftool prog show *` command Jakub Kicinski
2017-10-23 20:30   ` Daniel Borkmann
2017-10-23 16:24 ` [PATCH net-next 05/12] tools: bpftool: add JSON output for `bpftool prog dump jited " Jakub Kicinski
2017-10-23 20:31   ` Daniel Borkmann
2017-10-23 16:24 ` [PATCH net-next 06/12] tools: bpftool: add JSON output for `bpftool prog dump xlated " Jakub Kicinski
2017-10-23 20:32   ` Daniel Borkmann
2017-10-23 16:24 ` [PATCH net-next 07/12] tools: bpftool: add JSON output for `bpftool map *` commands Jakub Kicinski
2017-10-23 20:32   ` Daniel Borkmann
2017-10-23 16:24 ` [PATCH net-next 08/12] tools: bpftool: add JSON output for `bpftool batch file FILE` command Jakub Kicinski
2017-10-23 20:32   ` Daniel Borkmann
2017-10-23 16:24 ` [PATCH net-next 09/12] tools: bpftool: turn err() and info() macros into functions Jakub Kicinski
2017-10-23 20:33   ` Daniel Borkmann [this message]
2017-11-03  0:59   ` Joe Perches
2017-11-03 21:26     ` Quentin Monnet
2017-10-23 16:24 ` [PATCH net-next 10/12] tools: bpftool: provide JSON output for all possible commands Jakub Kicinski
2017-10-23 20:33   ` Daniel Borkmann
2017-10-23 16:24 ` [PATCH net-next 11/12] tools: bpftool: add cosmetic changes for the manual pages Jakub Kicinski
2017-10-23 20:33   ` Daniel Borkmann
2017-10-23 16:24 ` [PATCH net-next 12/12] tools: bpftool: update documentation for --json and --pretty usage Jakub Kicinski
2017-10-23 20:34   ` Daniel Borkmann
2017-10-23 17:44 ` [PATCH net-next 00/12] tools: bpftool: Add JSON output to bpftool Alexei Starovoitov
2017-10-24  0:25 ` David Miller

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=59EE521F.2000902@iogearbox.net \
    --to=daniel@iogearbox.net \
    --cc=alexei.starovoitov@gmail.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).