All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] qmp, hmp: statistics subsystem and KVM suport.
@ 2022-04-26 14:16 Paolo Bonzini
  2022-04-26 14:16 ` [PATCH 1/8] qmp: Support for querying stats Paolo Bonzini
                   ` (7 more replies)
  0 siblings, 8 replies; 37+ messages in thread
From: Paolo Bonzini @ 2022-04-26 14:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, 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 and 4 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.

Compared to the previous version that Mark sent, the changes are
as follows:

* changed the QAPI schema so that vm, vcpus etc. are not keys of
  QAPI objects anymore.  This simplifies the interface exposed
  to stats callbacks as well.

* changed the QAPI schema to use optional fields a bit more (e.g.
  avoiding unit == 'none', or omitting base if exponent is 0).

* reorganized the patches to introduce filtering separately.  This
  also resulted in some changes to the statistics callbacks that
  the producers have to define.

* removed "info stats-schemas" HMP command.  The information in
  query-stats-schemas is already printed by "info stats".

Paolo

Supersedes: <20220215150433.2310711-1-mark.kanda@oracle.com>

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

Paolo Bonzini (5):
  qmp: add filtering of statistics by target vCPU
  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     | 413 ++++++++++++++++++++++++++++++++++++++++
 hmp-commands-info.hx    |  14 ++
 include/monitor/hmp.h   |   1 +
 include/monitor/stats.h |  42 ++++
 monitor/hmp-cmds.c      | 232 ++++++++++++++++++++++
 monitor/qmp-cmds.c      | 132 +++++++++++++
 qapi/meson.build        |   1 +
 qapi/qapi-schema.json   |   1 +
 qapi/stats.json         | 218 +++++++++++++++++++++
 9 files changed, 1054 insertions(+)
 create mode 100644 include/monitor/stats.h
 create mode 100644 qapi/stats.json

-- 
2.35.1



^ permalink raw reply	[flat|nested] 37+ messages in thread
* [PATCH v4 0/8] qmp, hmp: statistics subsystem and KVM suport.
@ 2022-05-23 15:05 Paolo Bonzini
  2022-05-23 15:07 ` [PATCH 1/8] qmp: Support for querying stats Paolo Bonzini
  0 siblings, 1 reply; 37+ messages in thread
From: Paolo Bonzini @ 2022-05-23 15:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: armbru

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 and 4 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.

Paolo

v3->v4:
- correctly handle errors from the callbacks (patch 1)
- renamed str_in_list to apply_str_list_filter (patch 3)
- handle empty filter early by avoiding the query altogether (patch 3, 7)

(patches 2/4/6/8 are identical to v3; patch 5 only has context changes)

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

Paolo Bonzini (5):
  qmp: add filtering of statistics by target vCPU
  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     | 414 ++++++++++++++++++++++++++++++++++++++++
 hmp-commands-info.hx    |  14 ++
 include/monitor/hmp.h   |   1 +
 include/monitor/stats.h |  45 +++++
 monitor/hmp-cmds.c      | 229 ++++++++++++++++++++++
 monitor/qmp-cmds.c      | 149 +++++++++++++++
 qapi/meson.build        |   1 +
 qapi/qapi-schema.json   |   1 +
 qapi/stats.json         | 246 ++++++++++++++++++++++++
 9 files changed, 1100 insertions(+)
 create mode 100644 include/monitor/stats.h
 create mode 100644 qapi/stats.json

-- 
2.36.0



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

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

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-26 14:16 [PATCH 0/8] qmp, hmp: statistics subsystem and KVM suport Paolo Bonzini
2022-04-26 14:16 ` [PATCH 1/8] qmp: Support for querying stats Paolo Bonzini
2022-04-27  9:19   ` Dr. David Alan Gilbert
2022-04-27 12:10     ` Paolo Bonzini
2022-05-04 13:22   ` Markus Armbruster
2022-05-05  7:10     ` Paolo Bonzini
2022-05-05  8:00       ` Daniel P. Berrangé
2022-05-05 13:28       ` Markus Armbruster
2022-05-05 13:39         ` Daniel P. Berrangé
2022-05-05 17:21           ` Dr. David Alan Gilbert
2022-05-05 13:58         ` Paolo Bonzini
2022-05-13 13:10           ` Markus Armbruster
2022-05-13 13:57             ` Paolo Bonzini
2022-05-13 14:35               ` Markus Armbruster
2022-05-13 15:50                 ` Paolo Bonzini
2022-05-13 17:47                   ` Markus Armbruster
2022-04-26 14:16 ` [PATCH 2/8] kvm: Support for querying fd-based stats Paolo Bonzini
2022-04-26 14:16 ` [PATCH 3/8] qmp: add filtering of statistics by target vCPU Paolo Bonzini
2022-05-05 13:45   ` Markus Armbruster
2022-05-05 13:59     ` Paolo Bonzini
2022-04-26 14:16 ` [PATCH 4/8] hmp: add basic "info stats" implementation Paolo Bonzini
2022-04-26 14:16 ` [PATCH 5/8] qmp: add filtering of statistics by provider Paolo Bonzini
2022-04-26 14:16 ` [PATCH 6/8] hmp: " Paolo Bonzini
2022-04-26 14:16 ` [PATCH 7/8] qmp: add filtering of statistics by name Paolo Bonzini
2022-04-27 12:01   ` Dr. David Alan Gilbert
2022-04-27 12:18     ` Paolo Bonzini
2022-04-27 12:34       ` Dr. David Alan Gilbert
2022-04-27 14:17         ` Paolo Bonzini
2022-04-27 15:16           ` Dr. David Alan Gilbert
2022-04-27 15:50             ` Paolo Bonzini
2022-04-27 17:16               ` Dr. David Alan Gilbert
2022-04-28  9:53                 ` Paolo Bonzini
2022-04-26 14:16 ` [PATCH 8/8] hmp: " Paolo Bonzini
2022-05-23 15:05 [PATCH v4 0/8] qmp, hmp: statistics subsystem and KVM suport Paolo Bonzini
2022-05-23 15:07 ` [PATCH 1/8] qmp: Support for querying stats Paolo Bonzini
2022-05-24 10:41   ` Markus Armbruster
2022-05-24 16:47     ` Paolo Bonzini
2022-05-24 12:20   ` Markus Armbruster

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.