[PATCH v3] usertools: telemetry pretty print in interactive mode

Bruce Richardson bruce.richardson at intel.com
Mon Oct 17 11:15:29 CEST 2022


On Mon, Oct 17, 2022 at 07:41:02AM +0000, Chengwen Feng wrote:
> Currently, the dpdk-telemetry.py show json in raw format under
> interactive mode, which is not good for human reading.
> 
> E.g. The command '/ethdev/xstats,0' will output:
> {"/ethdev/xstats": {"rx_good_packets": 0, "tx_good_packets": 0,
> "rx_good_bytes": 0, "tx_good_bytes": 0, "rx_missed_errors": 0,
> "rx_errors": 0, "tx_errors": 0, "rx_mbuf_allocation_errors": 0,
> "rx_q0_packets": 0,...}}
> 
> This patch supports json pretty print by adding extra indent=2
> parameter under interactive mode, so the same command will output:
> {
>   "/ethdev/xstats": {
>     "rx_good_packets": 0,
>     "tx_good_packets": 0,
>     "rx_good_bytes": 0,
>     "tx_good_bytes": 0,
>     "rx_missed_errors": 0,
>     "rx_errors": 0,
>     "rx_mbuf_allocation_errors": 0,
>     "rx_q0_packets": 0,
>     ...
>   }
> }
> 
> Note: the non-interactive mode is made machine-readable and remains the
> original way (it means don't use indent to pretty print).
> 
> Signed-off-by: Chengwen Feng <fengchengwen at huawei.com>
> Acked-by: David Marchand <david.marchand at redhat.com>
> Acked-by: Ciara Power <ciara.power at intel.com>
> 
Tested-by: Bruce Richardson <bruce.richardson at intel.com>



More information about the dev mailing list