[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v6 02/15] block/nvme: Avoid further processing if trace event not
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v6 02/15] block/nvme: Avoid further processing if trace event not enabled |
Date: |
Fri, 21 Aug 2020 21:53:46 +0200 |
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>
---
block/nvme.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/nvme.c b/block/nvme.c
index 2f5e3c2adfa..8c30a5fee28 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],
--
2.26.2
- [PATCH v6 00/15] block/nvme: Various cleanups required to use multiple queues, Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 01/15] block/nvme: Replace magic value by SCALE_MS definition, Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 02/15] block/nvme: Avoid further processing if trace event not enabled,
Philippe Mathieu-Daudé <=
- [PATCH v6 03/15] block/nvme: Let nvme_create_queue_pair() fail gracefully, Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 04/15] block/nvme: Define INDEX macros to ease code review, Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 05/15] block/nvme: Improve error message when IO queue creation failed, Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 06/15] block/nvme: Use common error path in nvme_add_io_queue(), Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 07/15] block/nvme: Rename local variable, Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures, Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 09/15] block/nvme: Replace qemu_try_blockalign0 by qemu_try_blockalign/memset, Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 10/15] block/nvme: Replace qemu_try_blockalign(bs) by qemu_try_memalign(pg_sz), Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 11/15] block/nvme: Simplify nvme_init_queue() arguments, Philippe Mathieu-Daudé, 2020/08/21
- [PATCH v6 12/15] block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE, Philippe Mathieu-Daudé, 2020/08/21