From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: berrange@redhat.com, armbru@redhat.com, dgilbert@redhat.com
Subject: [PATCH 0/8] qmp, hmp: statistics subsystem and KVM suport.
Date: Tue, 26 Apr 2022 16:16:11 +0200 [thread overview]
Message-ID: <20220426141619.304611-1-pbonzini@redhat.com> (raw)
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
next reply other threads:[~2022-04-26 14:18 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-26 14:16 Paolo Bonzini [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220426141619.304611-1-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.