Skip to content

RFC iproute printing enhancements

Stephen Hemminger netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest16 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/16iproute: refactor printing flagsip/iproute.c+22 -240 replies
2/16iproute: make printing icmpv6 a functionip/iproute.c+21 -170 replies
3/16iproute: make printing IPv4 cache flags a functionip/iproute.c+37 -260 replies
4/16iproute: refactor cacheinfo printingip/iproute.c+32 -460 replies
5/16iproute: refactor metrics printip/iproute.c+61 -560 replies
6/16iproute: refactor printing flow infoip/iproute.c+20 -260 replies
7/16iproute2: refactor newdst, gateway and via printingip/iproute.c+40 -330 replies
8/16iproute: refactor multipath printip/iproute.c+63 -530 replies
9/16iproute: refactor printing of interfaceip/iproute.c+11 -50 replies
10/16iproute: whitespace fixesip/iproute.c+13 -100 replies
11/16iproute: don't do assignment in conditionip/iproute.c+16 -90 replies
12/16iproute: make flush a separate functionip/iproute.c+64 -570 replies
13/16iproute: implement JSON and color outputinclude/utils.h ip/iproute.c+259 -1130 replies
14/16json: make pretty printing optionalinclude/json_print.h include/utils.h ip/ip.c +2 more+10 -20 replies
15/16man: add documentation for json and pretty flagsip/ip.c man/man8/ip.8 man/man8/tc.8+18 -70 replies
16/16json: fix newline at end of arraylib/json_print.c lib/json_writer.c+5 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC iproute2-next 00/16] iproute printing enhancements

The first group of patches refactor the printout to breakup excessively long print_route function and the last few implement JSON and color output format for routes.

The one thing that maybe controversial is changing the default json output format to be compact. The value of JSON is for programattic output therefore pretty-printing should be an option.

One change I didn't make (but considered) is not calling fflush after every single entry. When dumping millions of routes, letting stdio buffer output would be a performance win.

Stephen Hemminger (16):
iproute: refactor printing flags
iproute: make printing icmpv6 a function
iproute: make printing IPv4 cache flags a function
iproute: refactor cacheinfo printing
iproute: refactor metrics print
iproute: refactor printing flow info
iproute2: refactor newdst, gateway and via printing
iproute: refactor multipath print
iproute: refactor printing of interface
iproute: whitespace fixes
iproute: don't do assignment in condition
iproute: make flush a separate function
iproute: implement JSON and color output
json: make pretty printing optional
man: add documentation for json and pretty flags
json: fix newline at end of array

 include/json_print.h |   2 +
 include/utils.h      |   4 +
 ip/ip.c              |   7 +-
 ip/iproute.c         | 943 ++++++++++++++++++++++++++++++---------------------
 lib/json_print.c     |   5 +-
 lib/json_writer.c    |   5 +
 man/man8/ip.8        |  18 +-
 man/man8/tc.8        |   3 +-
 tc/tc.c              |   3 +
 9 files changed, 598 insertions(+), 392 deletions(-)
Signature · 1 line
2.15.1