diff options
author | zhenwei pi <pizhenwei@bytedance.com> | 2023-03-01 18:58:46 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2023-03-07 12:38:59 -0500 |
commit | f2b901098e14ad1aaffab82464917b8679499cc5 (patch) | |
tree | bc79041378dc0f9c4091f0463415ae18bdf9ddf4 /stats/stats-qmp-cmds.c | |
parent | 2580b452ffccfb2bcba97dbfcb0d6067d06bc453 (diff) | |
download | qemu-f2b901098e14ad1aaffab82464917b8679499cc5.zip qemu-f2b901098e14ad1aaffab82464917b8679499cc5.tar.gz qemu-f2b901098e14ad1aaffab82464917b8679499cc5.tar.bz2 |
cryptodev: Support query-stats QMP command
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é <berrange@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20230301105847.253084-12-pizhenwei@bytedance.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'stats/stats-qmp-cmds.c')
-rw-r--r-- | stats/stats-qmp-cmds.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/stats/stats-qmp-cmds.c b/stats/stats-qmp-cmds.c index bc97374..e214b96 100644 --- a/stats/stats-qmp-cmds.c +++ b/stats/stats-qmp-cmds.c @@ -64,6 +64,8 @@ static bool invoke_stats_cb(StatsCallbacks *entry, targets = filter->u.vcpu.vcpus; } break; + case STATS_TARGET_CRYPTODEV: + break; default: abort(); } |