diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-05-24 19:13:16 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-14 16:50:30 +0200 |
commit | cf7405bc0228c795557e19bacbaa3b145bb17370 (patch) | |
tree | bb839b71c8a53be235145a77ff83dfc8f5d478e6 /include/monitor | |
parent | 7716417eac82b319b204f29224ffe1a6d2c0668a (diff) |
qmp: add filtering of statistics by name
Allow retrieving only a subset of statistics. This can be useful
for example in order to plot a subset of the statistics many times
a second: KVM publishes ~40 statistics for each vCPU on x86; retrieving
and serializing all of them would be useless.
Another use will be in HMP in the following patch; implementing the
filter in the backend is easy enough that it was deemed okay to make
this a public interface.
Example:
{ "execute": "query-stats",
"arguments": {
"target": "vcpu",
"vcpus": [ "/machine/unattached/device[2]",
"/machine/unattached/device[4]" ],
"providers": [
{ "provider": "kvm",
"names": [ "l1d_flush", "exits" ] } } }
{ "return": {
"vcpus": [
{ "path": "/machine/unattached/device[2]"
"providers": [
{ "provider": "kvm",
"stats": [ { "name": "l1d_flush", "value": 41213 },
{ "name": "exits", "value": 74291 } ] } ] },
{ "path": "/machine/unattached/device[4]"
"providers": [
{ "provider": "kvm",
"stats": [ { "name": "l1d_flush", "value": 16132 },
{ "name": "exits", "value": 57922 } ] } ] } ] } }
Extracted from a patch by Mark Kanda.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/monitor')
-rw-r--r-- | include/monitor/stats.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/monitor/stats.h b/include/monitor/stats.h index 80a523dd29..fcf0983154 100644 --- a/include/monitor/stats.h +++ b/include/monitor/stats.h @@ -11,7 +11,7 @@ #include "qapi/qapi-types-stats.h" typedef void StatRetrieveFunc(StatsResultList **result, StatsTarget target, - strList *targets, Error **errp); + strList *names, strList *targets, Error **errp); typedef void SchemaRetrieveFunc(StatsSchemaList **result, Error **errp); /* |