mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
qmp: add filtering of statistics by target vCPU
Introduce a simple filtering of statistics, that allows to retrieve
statistics for a subset of the guest vCPUs. This will be used for
example by the HMP monitor, in order to retrieve the statistics
for the currently selected CPU.
Example:
{ "execute": "query-stats",
"arguments": {
"target": "vcpu",
"vcpus": [ "/machine/unattached/device[2]",
"/machine/unattached/device[4]" ] } }
Extracted from a patch by Mark Kanda.
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
+10
-1
@@ -11,7 +11,7 @@
|
||||
#include "qapi/qapi-types-stats.h"
|
||||
|
||||
typedef void StatRetrieveFunc(StatsResultList **result, StatsTarget target,
|
||||
Error **errp);
|
||||
strList *targets, Error **errp);
|
||||
typedef void SchemaRetrieveFunc(StatsSchemaList **result, Error **errp);
|
||||
|
||||
/*
|
||||
@@ -31,4 +31,13 @@ void add_stats_entry(StatsResultList **, StatsProvider, const char *id,
|
||||
void add_stats_schema(StatsSchemaList **, StatsProvider, StatsTarget,
|
||||
StatsSchemaValueList *);
|
||||
|
||||
/*
|
||||
* True if a string matches the filter passed to the stats_fn callabck,
|
||||
* false otherwise.
|
||||
*
|
||||
* Note that an empty list means no filtering, i.e. all strings will
|
||||
* return true.
|
||||
*/
|
||||
bool apply_str_list_filter(const char *string, strList *list);
|
||||
|
||||
#endif /* STATS_H */
|
||||
|
||||
Reference in New Issue
Block a user