qemu/monitor
Paolo Bonzini cf7405bc02 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>
2022-06-14 16:50:30 +02:00
..
hmp-cmds.c hmp: add filtering of statistics by provider 2022-06-14 16:50:30 +02:00
hmp.c compiler.h: replace QEMU_NORETURN with G_NORETURN 2022-04-21 17:03:51 +04:00
meson.build meson: add spice_headers dependency. 2020-10-15 11:14:40 +02:00
misc.c mos6522: fix linking error when CONFIG_MOS6522 is not set 2022-05-26 17:11:32 -03:00
monitor-internal.h monitor/hmp: add support for flag argument with value 2022-03-02 18:12:40 +00:00
monitor.c Move error_printf_unless_qmp() with monitor unit 2022-04-21 17:09:09 +04:00
qmp-cmds-control.c qapi: Implement deprecated-output=hide for QMP introspection 2021-03-19 16:05:11 +01:00
qmp-cmds.c qmp: add filtering of statistics by name 2022-06-14 16:50:30 +02:00
qmp.c monitor/qmp: fix race on CHR_EVENT_CLOSED without OOB 2021-05-12 17:29:11 +02:00
trace-events docs: fix references to docs/devel/tracing.rst 2021-06-02 06:51:09 +02:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00