diff options
| author | Quentin Monnet <[email protected]> | 2017-10-23 09:24:13 -0700 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2017-10-24 01:25:09 +0100 |
| commit | 9a5ab8bf1d6d16ef47fdf55dba1683ec00d751ad (patch) | |
| tree | bd5c00e184e771ecc21fc593454ff63203797a29 /include/uapi | |
| parent | 3aaca6bf7a09150e4c87f2932dc8ebe82a586252 (diff) | |
tools: bpftool: turn err() and info() macros into functions
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 <[email protected]>
Acked-by: Jakub Kicinski <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'include/uapi')
0 files changed, 0 insertions, 0 deletions