From nobody Mon Nov 17 12:05:03 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1603806984; cv=none; d=zohomail.com; s=zohoarc; b=malqvO+3X263JBTDN15LodaUwyBXHo+CvzpGn4SbWy7OEKq4Kg65njZgDemhnY/+jbM18TecQTAWK0ZhN7QJx0w+cZjefAqA3yv7Nv2sPQUiivdsmWQashomnE68bgZq29FJIFSZeiGJTlZKrcj5qup7DW8e6odak1WjT5Zgens= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603806984; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=W4p23PAiAshE1wqHPJXxubFhGilm8TUfsmi+fLR5mFU=; b=L7vOOiU+YBrBH/oU3FkxPHrQBCO0fmOitffgons+/puYXTmZewW84DtVlYxb7DqKwSbgd7yIhkPv1MQz4JJJac/lu2FbYWi3wPjcczvn2kk5XtZ2/rTFjezRh00mJaFHOqycDFTYkU4DTaI0MQBckyJpXg93NS3ZZ5C6DOoELVI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1603806984452495.6567300246279; Tue, 27 Oct 2020 06:56:24 -0700 (PDT) Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-515-QJheQ2t_Oe--c3dP5iO_vQ-1; Tue, 27 Oct 2020 09:56:19 -0400 Received: by mail-ed1-f69.google.com with SMTP id i9so711294edx.10 for ; Tue, 27 Oct 2020 06:56:18 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (237.red-88-18-140.staticip.rima-tde.net. [88.18.140.237]) by smtp.gmail.com with ESMTPSA id ce15sm1179509ejc.39.2020.10.27.06.56.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Oct 2020 06:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603806982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W4p23PAiAshE1wqHPJXxubFhGilm8TUfsmi+fLR5mFU=; b=Sl+tVcp0l89EiHYJMYNJvTPuqIoM6k0UtygK4jKL2zQsJqv4eTEkjiJep8aVDalwdHWjNc kmwRSrghBhtozgQSc/jm73RIhzO+SCZpZi+D4MpHeQCEeNV4s3GvbdjDHHQLUwUuqt4Y9n CMWZOq0qITgssEGvzCpWLoA0ojvQemU= X-MC-Unique: QJheQ2t_Oe--c3dP5iO_vQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W4p23PAiAshE1wqHPJXxubFhGilm8TUfsmi+fLR5mFU=; b=Wt7iThXDdbzC1hCN0L1OUJ3CGEERf0FHMA9kkWfad+PdSRATsT1Hq0l/greJXvwgUK InOplUm5u5dVhpDlHmnvkin518d2ASgzEQaPhayZ92Rxdwo93QffRUFMhz2XdYN8REri VaFdOZS/E/p0/lxBE77Pon4bWjW/w2vGyTt3FsmMPsfuOQLvwFLK9tryLiBiC9uQbvH1 GLu4Fq9pO9x+VicRQHVF2LtGyPOgfvD1TEkgLK2GiiN8o3DvCgWmRMlgArZupY+D8uyn /ivPdYJSog25d3F8XMr/9PdDfQVGw6hAuMZ31g6xjBgvYTXr3fErux2AZEUGrpFER8Qv XypA== X-Gm-Message-State: AOAM530r+NDFnnRXBPbjSgNKGJY5wfaGGm/HUUrpeQpoFvq7sgpvRPDF nW35cnfcKDCxIM3WAtHPxUYTH7G3ejzIZIp9EOung84Uu+LALswWE2p5muWH8uyiKQcW9JLe4kK 4BsoyDXJDrPJimg== X-Received: by 2002:a05:6402:1597:: with SMTP id c23mr2333559edv.155.1603806977126; Tue, 27 Oct 2020 06:56:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCRg3m9AjyyZc8sVf3hr531fxX8NHAcXcVOzmNdPiFosGkCCMbuKs3qZZhGAqy2IGvrMhbIw== X-Received: by 2002:a05:6402:1597:: with SMTP id c23mr2333537edv.155.1603806976927; Tue, 27 Oct 2020 06:56:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Klaus Jensen , qemu-block@nongnu.org, Fam Zheng , Keith Busch , Eric Auger , Stefan Hajnoczi , Kevin Wolf , Max Reitz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 05/25] block/nvme: Trace nvme_poll_queue() per queue Date: Tue, 27 Oct 2020 14:55:27 +0100 Message-Id: <20201027135547.374946-6-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201027135547.374946-1-philmd@redhat.com> References: <20201027135547.374946-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) As we want to enable multiple queues, report the event in each nvme_poll_queue() call, rather than once in the callback calling nvme_poll_queues(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi --- block/nvme.c | 2 +- block/trace-events | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/block/nvme.c b/block/nvme.c index 361b5772b7a..8d74401ae7a 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -594,6 +594,7 @@ static bool nvme_poll_queue(NVMeQueuePair *q) const size_t cqe_offset =3D q->cq.head * NVME_CQ_ENTRY_BYTES; NvmeCqe *cqe =3D (NvmeCqe *)&q->cq.queue[cqe_offset]; =20 + trace_nvme_poll_queue(q->s, q->index); /* * Do an early check for completions. q->lock isn't needed because * nvme_process_completion() only runs in the event loop thread and @@ -684,7 +685,6 @@ static bool nvme_poll_cb(void *opaque) BDRVNVMeState *s =3D container_of(e, BDRVNVMeState, irq_notifier[MSIX_SHARED_IRQ_IDX]); =20 - trace_nvme_poll_cb(s); return nvme_poll_queues(s); } =20 diff --git a/block/trace-events b/block/trace-events index b90b07b15fa..86292f3312b 100644 --- a/block/trace-events +++ b/block/trace-events @@ -145,7 +145,7 @@ nvme_complete_command(void *s, int index, int cid) "s %= p queue %d cid %d" nvme_submit_command(void *s, int index, int cid) "s %p queue %d cid %d" nvme_submit_command_raw(int c0, int c1, int c2, int c3, int c4, int c5, in= t c6, int c7) "%02x %02x %02x %02x %02x %02x %02x %02x" nvme_handle_event(void *s) "s %p" -nvme_poll_cb(void *s) "s %p" +nvme_poll_queue(void *s, unsigned q_index) "s %p q #%u" nvme_prw_aligned(void *s, int is_write, uint64_t offset, uint64_t bytes, i= nt flags, int niov) "s %p is_write %d offset 0x%"PRIx64" bytes %"PRId64" fl= ags %d niov %d" nvme_write_zeroes(void *s, uint64_t offset, uint64_t bytes, int flags) "s = %p offset 0x%"PRIx64" bytes %"PRId64" flags %d" nvme_qiov_unaligned(const void *qiov, int n, void *base, size_t size, int = align) "qiov %p n %d base %p size 0x%zx align 0x%x" --=20 2.26.2