aboutsummaryrefslogtreecommitdiff
path: root/include/monitor
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-04-26 11:49:33 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-14 16:50:30 +0200
commit068cc51d42f771d2a453d628c10e199e7d104edd (patch)
treee89f2af7614e6975703837af8c2f3bc7137ec80c /include/monitor
parent433815f5bdf71b5b2c47d9f1104816b95b551c49 (diff)
downloadqemu-068cc51d42f771d2a453d628c10e199e7d104edd.zip
qemu-068cc51d42f771d2a453d628c10e199e7d104edd.tar.gz
qemu-068cc51d42f771d2a453d628c10e199e7d104edd.tar.bz2
qmp: add filtering of statistics by provider
Allow retrieving the statistics from a specific provider only. This can be used in the future by HMP commands such as "info sync-profile" or "info profile". The next patch also adds filter-by-provider capabilities to the HMP equivalent of query-stats, "info stats". Example: { "execute": "query-stats", "arguments": { "target": "vm", "providers": [ { "provider": "kvm" } ] } } The QAPI is a bit more verbose than just a list of StatsProvider, so that it can be subsequently extended with filtering of statistics by name. If a provider is specified more than once in the filter, each request will be included separately in the output. Extracted from a patch by Mark Kanda. Reviewed-by: Markus Armbruster <armbru@redhat.com> 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.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/monitor/stats.h b/include/monitor/stats.h
index 8c50fee..80a523d 100644
--- a/include/monitor/stats.h
+++ b/include/monitor/stats.h
@@ -17,10 +17,12 @@ typedef void SchemaRetrieveFunc(StatsSchemaList **result, Error **errp);
/*
* Register callbacks for the QMP query-stats command.
*
+ * @provider: stats provider checked against QMP command arguments
* @stats_fn: routine to query stats:
* @schema_fn: routine to query stat schemas:
*/
-void add_stats_callbacks(StatRetrieveFunc *stats_fn,
+void add_stats_callbacks(StatsProvider provider,
+ StatRetrieveFunc *stats_fn,
SchemaRetrieveFunc *schemas_fn);
/*