qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/8] qmp: add filtering of statistics by target vCPU


From: Paolo Bonzini
Subject: Re: [PATCH 3/8] qmp: add filtering of statistics by target vCPU
Date: Thu, 5 May 2022 15:59:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0

On 5/5/22 15:45, Markus Armbruster wrote:
Paolo Bonzini <pbonzini@redhat.com> writes:

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]" ] } }

What heartless people put these poor vCPUs in the orphanage?

Phil tried to fix it but the testsuites hung in weird ways.

Paolo


Extracted from a patch by Mark Kanda.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

[...]

diff --git a/qapi/stats.json b/qapi/stats.json
index bcc897258a..26ee69588f 100644
--- a/qapi/stats.json
+++ b/qapi/stats.json
@@ -65,6 +65,16 @@
  { 'enum': 'StatsTarget',
    'data': [ 'vm', 'vcpu' ] }
+##
+# @StatsVCPUFilter:
+#
+# @vcpus: list of qom paths for the desired vCPU objects.

"QOM paths", because that's how we spell it elsewhere.

+#
+# Since: 7.1
+##
+{ 'struct': 'StatsVCPUFilter',
+  'data': { '*vcpus': [ 'str' ] } }
+
  ##
  # @StatsFilter:
  #
@@ -73,8 +83,10 @@
  #
  # Since: 7.1
  ##
-{ 'struct': 'StatsFilter',
-  'data': { 'target': 'StatsTarget' } }
+{ 'union': 'StatsFilter',
+        'base': { 'target': 'StatsTarget' },
+  'discriminator': 'target',
+  'data': { 'vcpu': 'StatsVCPUFilter' } }
##
  # @StatsValue:






reply via email to

[Prev in Thread] Current Thread [Next in Thread]