aboutsummaryrefslogtreecommitdiff
path: root/hmp-commands-info.hx
diff options
context:
space:
mode:
authorzhenwei pi <pizhenwei@bytedance.com>2022-08-02 15:37:20 +0800
committerDr. David Alan Gilbert <dgilbert@redhat.com>2022-09-15 11:58:37 +0100
commit00d60cfcbda54b86ad9e09b20c7b71250dd6b19b (patch)
tree86953c696116f19b75f9ede92363e1bc1a59fcab /hmp-commands-info.hx
parent79dfa177ae348bb5ab5f97c0915359b13d6186e2 (diff)
downloadqemu-00d60cfcbda54b86ad9e09b20c7b71250dd6b19b.zip
qemu-00d60cfcbda54b86ad9e09b20c7b71250dd6b19b.tar.gz
qemu-00d60cfcbda54b86ad9e09b20c7b71250dd6b19b.tar.bz2
monitor: Support specified vCPU registers
Originally we have to get all the vCPU registers and parse the specified one. To improve the performance of this usage, allow user specified vCPU id to query registers. Run a VM with 16 vCPU, use bcc tool to track the latency of 'hmp_info_registers': 'info registers -a' uses about 3ms; 'info registers 12' uses about 150us. Cc: Darren Kenny <darren.kenny@oracle.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: zhenwei pi <pizhenwei@bytedance.com> Reviewed-by: Darren Kenny <darren.kenny@oracle.com> Message-Id: <20220802073720.1236988-2-pizhenwei@bytedance.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'hmp-commands-info.hx')
-rw-r--r--hmp-commands-info.hx8
1 files changed, 5 insertions, 3 deletions
diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx
index 188d9ec..e012035 100644
--- a/hmp-commands-info.hx
+++ b/hmp-commands-info.hx
@@ -100,9 +100,11 @@ ERST
{
.name = "registers",
- .args_type = "cpustate_all:-a",
- .params = "[-a]",
- .help = "show the cpu registers (-a: all - show register info for all cpus)",
+ .args_type = "cpustate_all:-a,vcpu:i?",
+ .params = "[-a|vcpu]",
+ .help = "show the cpu registers (-a: show register info for all cpus;"
+ " vcpu: specific vCPU to query; show the current CPU's registers if"
+ " no argument is specified)",
.cmd = hmp_info_registers,
},