DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] tools: fix json output of pmdinfo
@ 2016-08-26 13:15 Olivier Matz
  2016-10-04  9:52 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Olivier Matz @ 2016-08-26 13:15 UTC (permalink / raw)
  To: dev, nhorman, thomas.monjalon; +Cc: stable

Using dpdk-pmdinfo with the '-r' flag does not produce a json output as
documented. Instead, the python representation of the json object is
shown, which is nearly the same, but cannot be properly parsed by a json
parser.

python repr (before):
  {u'pci_ids': [[5549, 1968, 65535, 65535]], u'name': u'vmxnet3'}
json (after):
  {"pci_ids": [[5549, 1968, 65535, 65535]], "name": "vmxnet3"}

Fixes: c67c9a5c646a ("tools: query binaries for HW and other support information")

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 tools/dpdk-pmdinfo.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/dpdk-pmdinfo.py b/tools/dpdk-pmdinfo.py
index dcc8db8..3db9819 100755
--- a/tools/dpdk-pmdinfo.py
+++ b/tools/dpdk-pmdinfo.py
@@ -319,7 +319,7 @@ class ReadElf(object):
         pmdinfo = json.loads(mystring)
 
         if raw_output:
-            print(pmdinfo)
+            print(json.dumps(pmdinfo))
             return
 
         print("PMD NAME: " + pmdinfo["name"])
-- 
2.8.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] tools: fix json output of pmdinfo
  2016-08-26 13:15 [dpdk-dev] [PATCH] tools: fix json output of pmdinfo Olivier Matz
@ 2016-10-04  9:52 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2016-10-04  9:52 UTC (permalink / raw)
  To: Olivier Matz; +Cc: dev, nhorman, stable

2016-08-26 15:15, Olivier Matz:
> Using dpdk-pmdinfo with the '-r' flag does not produce a json output as
> documented. Instead, the python representation of the json object is
> shown, which is nearly the same, but cannot be properly parsed by a json
> parser.
> 
> python repr (before):
>   {u'pci_ids': [[5549, 1968, 65535, 65535]], u'name': u'vmxnet3'}
> json (after):
>   {"pci_ids": [[5549, 1968, 65535, 65535]], "name": "vmxnet3"}
> 
> Fixes: c67c9a5c646a ("tools: query binaries for HW and other support information")
> 
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-04  9:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-26 13:15 [dpdk-dev] [PATCH] tools: fix json output of pmdinfo Olivier Matz
2016-10-04  9:52 ` Thomas Monjalon

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).