On Wed, Mar 01, 2023 at 10:51:23AM +0800, zhenwei pi wrote: > Now we can use "query-stats" QMP command to query statistics of > crypto devices. (Originally this was designed to show statistics > by '{"execute": "query-cryptodev"}'. Daniel Berrangé suggested that > querying configuration info by "query-cryptodev", and querying > runtime performance info by "query-stats". This makes sense!) > > Example: > ~# virsh qemu-monitor-command vm '{"execute": "query-stats", \ > "arguments": {"target": "cryptodev"} }' | jq > { > "return": [ > { > "provider": "cryptodev", > "stats": [ > { > "name": "asym-verify-bytes", > "value": 7680 > }, > ... > { > "name": "asym-decrypt-ops", > "value": 32 > }, > { > "name": "asym-encrypt-ops", > "value": 48 > } > ], > "qom-path": "/objects/cryptodev0" # support asym only > }, > { > "provider": "cryptodev", > "stats": [ > { > "name": "asym-verify-bytes", > "value": 0 > }, > ... > { > "name": "sym-decrypt-bytes", > "value": 5376 > }, > ... > ], > "qom-path": "/objects/cryptodev1" # support asym/sym > } > ], > "id": "libvirt-422" > } > > Suggested-by: Daniel P. Berrangé <berra...@redhat.com> > Signed-off-by: zhenwei pi <pizhen...@bytedance.com> > --- > backends/cryptodev.c | 155 +++++++++++++++++++++++++++++++++++++++++ > qapi/stats.json | 10 ++- > stats/stats-hmp-cmds.c | 5 ++ > stats/stats-qmp-cmds.c | 2 + > 4 files changed, 170 insertions(+), 2 deletions(-)
Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|