From patchwork Wed Nov 4 15:18:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 11880991 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6F89C2D0A3 for ; Wed, 4 Nov 2020 15:19:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 525C52074F for ; Wed, 4 Nov 2020 15:19:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FWivzlhI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729630AbgKDPTf (ORCPT ); Wed, 4 Nov 2020 10:19:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36689 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730411AbgKDPTc (ORCPT ); Wed, 4 Nov 2020 10:19:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1604503171; 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=CRaqFAw0pIpfUOQtgkrvq47FZKmkwaftYt1bLa1tgto=; b=FWivzlhIF/1+j2NCcUgOuNgc3YcCqpOQtEYoUK1k5nChIZTcRFiFJh30gUiUwpBDj7mZ8n x7IPhegRhFKXJ7nKJehtsgE//1rrWPFrKpboMir4qMpHh5+WOjYOuVV+JGhra2mV0vn0BJ t0/hzyuGpgyvTOeKIa9h8VHHVPhyTps= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-khTHMmgRMQyyYbkAacqy8A-1; Wed, 04 Nov 2020 10:19:28 -0500 X-MC-Unique: khTHMmgRMQyyYbkAacqy8A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 447DF80401E; Wed, 4 Nov 2020 15:19:26 +0000 (UTC) Received: from localhost (ovpn-115-145.ams2.redhat.com [10.36.115.145]) by smtp.corp.redhat.com (Postfix) with ESMTP id 06AA56266E; Wed, 4 Nov 2020 15:19:18 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org, Peter Maydell Cc: kvm@vger.kernel.org, "Dr. David Alan Gilbert" , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Eduardo Habkost , Markus Armbruster , Eric Blake , Fam Zheng , Stefan Hajnoczi , Keith Busch , Max Reitz , qemu-block@nongnu.org, Kevin Wolf , Coiby Xu , Paolo Bonzini , Klaus Jensen , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eric Auger Subject: [PULL 07/33] block/nvme: Trace nvme_poll_queue() per queue Date: Wed, 4 Nov 2020 15:18:02 +0000 Message-Id: <20201104151828.405824-8-stefanha@redhat.com> In-Reply-To: <20201104151828.405824-1-stefanha@redhat.com> References: <20201104151828.405824-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Philippe Mathieu-Daudé 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(). Reviewed-by: Eric Auger Reviewed-by: Stefan Hajnoczi Tested-by: Eric Auger Signed-off-by: Philippe Mathieu-Daudé Message-id: 20201029093306.1063879-6-philmd@redhat.com Signed-off-by: Stefan Hajnoczi Tested-by: Eric Auger --- 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 361b5772b7..8d74401ae7 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 = q->cq.head * NVME_CQ_ENTRY_BYTES; NvmeCqe *cqe = (NvmeCqe *)&q->cq.queue[cqe_offset]; + 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 = container_of(e, BDRVNVMeState, irq_notifier[MSIX_SHARED_IRQ_IDX]); - trace_nvme_poll_cb(s); return nvme_poll_queues(s); } diff --git a/block/trace-events b/block/trace-events index b90b07b15f..86292f3312 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, int 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, int flags, int niov) "s %p is_write %d offset 0x%"PRIx64" bytes %"PRId64" flags %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"