All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] lspci: Add support of JSON output format
@ 2018-02-18 23:12 Viktor Prutyanov
  2018-02-18 23:12 ` [PATCH v3 1/3] lspci: Add printing info in JSON format Viktor Prutyanov
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Viktor Prutyanov @ 2018-02-18 23:12 UTC (permalink / raw)
  To: linux-pci, mj; +Cc: Viktor Prutyanov

This collection of patches adds support of printing PCI info in JSON
format.

1st patch adds skeleton for creating structured object which can be
printed in JSON or another structured format.
2nd patch adds output of general PCI info which prints with -m, -k,
-[v]+ options, but without capabilities.
3rd patch adds PCI-E capability.

For example, we can easily, using jq utility, check speed of a device:
lspci -Jvv | jq -r '.[][] | select(.Device == "GK107M [GeForce GT 750M]") | .capabilities.express | {s1:.LnkCap.Speed, s2:.LnkSta.Speed, w1
:.LnkCap.Width, w2:.LnkSta.Width }'

{
    "s1": "8GT/s",
    "s2": "5GT/s",
    "w1": "x16",
    "w2": "x4"
}

Viktor Prutyanov (3):
  lspci: Add printing info in JSON format
  lspci: Add PCI info output in JSON format
  lspci: Add JSON PCI Express capabilities

 Makefile    |   3 +-
 common.c    |   2 +-
 ls-caps.c   | 417 +++++++++++++++++++++++++++++++++++
 ls-info.c   | 328 ++++++++++++++++++++++++++++
 ls-kernel.c |  24 +++
 lspci.c     | 706 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 lspci.h     |  56 +++++
 lspci.man   |   3 +
 pciutils.h  |   2 +-
 9 files changed, 1537 insertions(+), 4 deletions(-)
 create mode 100644 ls-info.c

-- 
2.14.3

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

end of thread, other threads:[~2018-03-11 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-18 23:12 [PATCH v3 0/3] lspci: Add support of JSON output format Viktor Prutyanov
2018-02-18 23:12 ` [PATCH v3 1/3] lspci: Add printing info in JSON format Viktor Prutyanov
2018-02-18 23:12 ` [PATCH v3 2/3] lspci: Add PCI info output " Viktor Prutyanov
2018-02-18 23:12 ` [PATCH v3 3/3] lspci: Add JSON PCI Express capabilities Viktor Prutyanov
2018-03-11 15:03 ` [PATCH v3 0/3] lspci: Add support of JSON output format viktor.prutyanov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.