summaryrefslogtreecommitdiffstats
path: root/hmp-commands-info.hx
diff options
context:
space:
mode:
authorzhenwei pi2022-08-02 09:37:20 +0200
committerDr. David Alan Gilbert2022-09-15 12:58:37 +0200
commit00d60cfcbda54b86ad9e09b20c7b71250dd6b19b (patch)
tree86953c696116f19b75f9ede92363e1bc1a59fcab /hmp-commands-info.hx
parentMerge tag 'pull-qapi-2022-09-07' of git://repo.or.cz/qemu/armbru into staging (diff)
downloadqemu-00d60cfcbda54b86ad9e09b20c7b71250dd6b19b.tar.gz
qemu-00d60cfcbda54b86ad9e09b20c7b71250dd6b19b.tar.xz
qemu-00d60cfcbda54b86ad9e09b20c7b71250dd6b19b.zip
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 188d9ece3b..e012035541 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,
},