From: Sindhu Parvathi Gopinathan Date: Wed, 19 Jul 2023 06:53:15 +0000 (-0700) Subject: zebra: non pretty json output for show ip route X-Git-Tag: base_9.1~214^2~1 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=1c67c0951bf39648ca6593449ec234aa6e046304;p=mirror%2Ffrr.git zebra: non pretty json output for show ip route Currently, json output of show ip route command are no pretty format. This is an extremely expensive operation at high scale (with high number of routes with many paths). Zebra json non-pretty command support added: ``` show ip route json ``` Ticket:#3513256 Issue:3513256 Testing: UT done Signed-off-by: Sindhu Parvathi Gopinathan's --- diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 19366eb2c1..291c2eb7e0 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -962,8 +962,12 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf, } } + /* + * This is an extremely expensive operation at scale + * and non-pretty reduces memory footprint significantly. + */ if (use_json) - vty_json(vty, json); + vty_json_no_pretty(vty, json); } static void do_show_ip_route_all(struct vty *vty, struct zebra_vrf *zvrf,