aboutsummaryrefslogtreecommitdiff
path: root/qga/qapi-schema.json
diff options
context:
space:
mode:
authorzhenwei pi <pizhenwei@bytedance.com>2022-07-07 08:56:02 +0800
committerKonstantin Kostiuk <kkostiuk@redhat.com>2022-07-13 12:19:18 +0300
commit1db8a0b0ea2fb72ecab36bd3143a9715c083d5d3 (patch)
treefb9e329f89c25214d7a002b48fbce58c71cedef8 /qga/qapi-schema.json
parentfd89c8ab091bf7faeea04bef51d4296a53a35279 (diff)
qga: add command 'guest-get-cpustats'
A vCPU thread always reaches 100% utilization when: - guest uses idle=poll - disable HLT vm-exit - enable MWAIT Add new guest agent command 'guest-get-cpustats' to get guest CPU statistics, we can know the guest workload and how busy the CPU is. Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Message-Id: <20220707005602.696557-3-pizhenwei@bytedance.com> Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Diffstat (limited to 'qga/qapi-schema.json')
-rw-r--r--qga/qapi-schema.json81
1 files changed, 81 insertions, 0 deletions
diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
index 9fa20e791b..869399ea1a 100644
--- a/qga/qapi-schema.json
+++ b/qga/qapi-schema.json
@@ -1576,3 +1576,84 @@
{ 'command': 'guest-get-diskstats',
'returns': ['GuestDiskStatsInfo']
}
+
+##
+# @GuestCpuStatsType:
+#
+# An enumeration of OS type
+#
+# Since: 7.1
+##
+{ 'enum': 'GuestCpuStatsType',
+ 'data': [ 'linux' ] }
+
+
+##
+# @GuestLinuxCpuStats:
+#
+# CPU statistics of Linux
+#
+# @cpu: CPU index in guest OS
+#
+# @user: Time spent in user mode
+#
+# @nice: Time spent in user mode with low priority (nice)
+#
+# @system: Time spent in system mode
+#
+# @idle: Time spent in the idle task
+#
+# @iowait: Time waiting for I/O to complete (since Linux 2.5.41)
+#
+# @irq: Time servicing interrupts (since Linux 2.6.0-test4)
+#
+# @softirq: Time servicing softirqs (since Linux 2.6.0-test4)
+#
+# @steal: Stolen time by host (since Linux 2.6.11)
+#
+# @guest: ime spent running a virtual CPU for guest operating systems under
+# the control of the Linux kernel (since Linux 2.6.24)
+#
+# @guestnice: Time spent running a niced guest (since Linux 2.6.33)
+#
+# Since: 7.1
+##
+{ 'struct': 'GuestLinuxCpuStats',
+ 'data': {'cpu': 'int',
+ 'user': 'uint64',
+ 'nice': 'uint64',
+ 'system': 'uint64',
+ 'idle': 'uint64',
+ '*iowait': 'uint64',
+ '*irq': 'uint64',
+ '*softirq': 'uint64',
+ '*steal': 'uint64',
+ '*guest': 'uint64',
+ '*guestnice': 'uint64'
+ } }
+
+##
+# @GuestCpuStats:
+#
+# Get statistics of each CPU in millisecond.
+#
+# - @linux: Linux style CPU statistics
+#
+# Since: 7.1
+##
+{ 'union': 'GuestCpuStats',
+ 'base': { 'type': 'GuestCpuStatsType' },
+ 'discriminator': 'type',
+ 'data': { 'linux': 'GuestLinuxCpuStats' } }
+
+##
+# @guest-get-cpustats:
+#
+# Retrieve information about CPU stats.
+# Returns: List of CPU stats of guest.
+#
+# Since: 7.1
+##
+{ 'command': 'guest-get-cpustats',
+ 'returns': ['GuestCpuStats']
+}