aboutsummaryrefslogtreecommitdiff
path: root/block/nvme.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-08-21 21:53:46 +0200
committerKevin Wolf <kwolf@redhat.com>2020-09-07 12:23:55 +0200
commite266f52cfb77e9fb162d3d02230170a373076d85 (patch)
tree9627037cbc0ede537ba6bdef5343ac78a72fb9ca /block/nvme.c
parente4f310fe7f5ed85c96c4a2175ec46054d02e0f81 (diff)
downloadqemu-e266f52cfb77e9fb162d3d02230170a373076d85.zip
qemu-e266f52cfb77e9fb162d3d02230170a373076d85.tar.gz
qemu-e266f52cfb77e9fb162d3d02230170a373076d85.tar.bz2
block/nvme: Avoid further processing if trace event not enabled
Avoid further processing if TRACE_NVME_SUBMIT_COMMAND_RAW is not enabled. This is an untested intend of performance optimization. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200821195359.1285345-3-philmd@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/nvme.c')
-rw-r--r--block/nvme.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/nvme.c b/block/nvme.c
index a2b006b..4d4f728 100644
--- a/block/nvme.c
+++ b/block/nvme.c
@@ -441,6 +441,9 @@ static void nvme_trace_command(const NvmeCmd *cmd)
{
int i;
+ if (!trace_event_get_state_backends(TRACE_NVME_SUBMIT_COMMAND_RAW)) {
+ return;
+ }
for (i = 0; i < 8; ++i) {
uint8_t *cmdp = (uint8_t *)cmd + i * 8;
trace_nvme_submit_command_raw(cmdp[0], cmdp[1], cmdp[2], cmdp[3],