qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 0/8] qmp, hmp: statistics subsystem and KVM suport.


From: Paolo Bonzini
Subject: [PATCH 0/8] qmp, hmp: statistics subsystem and KVM suport.
Date: Tue, 26 Apr 2022 16:16:11 +0200

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]