All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/10] qmp, hmp: statistics subsystem and KVM suport.
@ 2022-05-30 15:07 Paolo Bonzini
  2022-05-30 15:07 ` [PATCH v5 01/10] qmp: Support for querying stats Paolo Bonzini
                   ` (9 more replies)
  0 siblings, 10 replies; 28+ messages in thread
From: Paolo Bonzini @ 2022-05-30 15:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru, dgilbert

This patchset adds QEMU support for querying fd-based KVM statistics.
This allows the user to analyze the behavior of the VM without access
to debugfs.

However, instead of adding an ad hoc command, the new QMP entry point
can be extended in the future to more statistics provider than KVM
(for example TCG, tap, or the block layer) and to more objects than
the VM and vCPUS (for example network interfaces or block devices).

Because the statistics exposed by KVM are not known at compile time,
the kernel interface also comes with an introspectable schema.  This
schema is exposed by the query-stats-schemas QMP command.

Patches 1 and 2 add the basic support, respectively the QMP command
and the KVM producer.

Patches 3 to 6 add a basic HMP implementation.  The first of the two
adds a basic filtering mechanism to the QMP command, which is then used
by HMP (which only shows vCPU statistics for the currently selected
guest CPU; this is consistent with other HMP commands and does not
flood the user with an overwhelming amount of output).

The remaining patches add more filtering, respectively by provider
and by the name of a statistic.

The v4->v5 delta mostly restructures the implementation to hve
sensible results if the same providers is specified many times in
the same query-stats invocation.

v4->v5:
- all: wrap long lines

- patch 1: fix indentation of "Note"

- patch 2: use QAPI_LIST_PREPEND and error_setg_errno

- patches 4/5: new

- patch 6: reorganize printing of units to use prefixes instead
  of long names ("ns", not "nanoseconds")

- patches 1/3/7/9: filtering reimplemented to improve behavior if the
  same provider occurs many times in the same query-stats invocation.
  Before, all filters were evaluated first, and the callback was then
  run if there was a match.  Now, each filter is evaluated separately.

- patch 9: do not drop names from prototypes


Mark Kanda (3):
  qmp: Support for querying stats
  kvm: Support for querying fd-based stats
  hmp: add basic "info stats" implementation

Paolo Bonzini (7):
  qmp: add filtering of statistics by target vCPU
  cutils: fix case for "kilo" and "kibi"
  cutils: add functions for IEC and SI prefixes
  qmp: add filtering of statistics by provider
  hmp: add filtering of statistics by provider
  qmp: add filtering of statistics by name
  hmp: add filtering of statistics by name

 accel/kvm/kvm-all.c      | 408 +++++++++++++++++++++++++++++++++++++++
 hmp-commands-info.hx     |  14 ++
 include/monitor/hmp.h    |   1 +
 include/monitor/stats.h  |  45 +++++
 include/qemu/cutils.h    |  18 ++
 monitor/hmp-cmds.c       | 232 ++++++++++++++++++++++
 monitor/qmp-cmds.c       | 155 +++++++++++++++
 qapi/meson.build         |   1 +
 qapi/qapi-schema.json    |   1 +
 qapi/stats.json          | 249 ++++++++++++++++++++++++
 tests/unit/test-cutils.c |  52 +++++
 util/cutils.c            |  36 +++-
 12 files changed, 1202 insertions(+), 10 deletions(-)
 create mode 100644 include/monitor/stats.h
 create mode 100644 qapi/stats.json

-- 
2.36.1



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

end of thread, other threads:[~2022-06-08 16:24 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 15:07 [PATCH v5 00/10] qmp, hmp: statistics subsystem and KVM suport Paolo Bonzini
2022-05-30 15:07 ` [PATCH v5 01/10] qmp: Support for querying stats Paolo Bonzini
2022-05-30 15:07 ` [PATCH v5 02/10] kvm: Support for querying fd-based stats Paolo Bonzini
2022-06-07 17:44   ` Dr. David Alan Gilbert
2022-06-08 14:13     ` Paolo Bonzini
2022-06-08 14:52       ` Dr. David Alan Gilbert
2022-06-08 15:58         ` Paolo Bonzini
2022-06-08 16:01           ` Dr. David Alan Gilbert
2022-06-08 16:10             ` Paolo Bonzini
2022-06-08 16:17               ` Dr. David Alan Gilbert
2022-05-30 15:07 ` [PATCH v5 03/10] qmp: add filtering of statistics by target vCPU Paolo Bonzini
2022-05-30 15:07 ` [PATCH v5 04/10] cutils: fix case for "kilo" and "kibi" Paolo Bonzini
2022-05-30 21:56   ` Philippe Mathieu-Daudé via
2022-05-30 15:07 ` [PATCH v5 05/10] cutils: add functions for IEC and SI prefixes Paolo Bonzini
2022-05-30 21:59   ` Philippe Mathieu-Daudé via
2022-05-31 10:28     ` Paolo Bonzini
2022-05-30 15:07 ` [PATCH v5 06/10] hmp: add basic "info stats" implementation Paolo Bonzini
2022-06-07 18:35   ` Dr. David Alan Gilbert
2022-06-08 14:27     ` Paolo Bonzini
2022-06-08 15:23       ` Dr. David Alan Gilbert
2022-05-30 15:07 ` [PATCH v5 07/10] qmp: add filtering of statistics by provider Paolo Bonzini
2022-06-08 11:52   ` Dr. David Alan Gilbert
2022-05-30 15:07 ` [PATCH v5 08/10] hmp: " Paolo Bonzini
2022-06-08 12:06   ` Dr. David Alan Gilbert
2022-05-30 15:07 ` [PATCH v5 09/10] qmp: add filtering of statistics by name Paolo Bonzini
2022-06-08 13:36   ` Dr. David Alan Gilbert
2022-05-30 15:07 ` [PATCH v5 10/10] hmp: " Paolo Bonzini
2022-06-08 13:40   ` Dr. David Alan Gilbert

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.