Received: by 10.223.176.46 with SMTP id f43csp447511wra; Fri, 26 Jan 2018 01:17:57 -0800 (PST) X-Google-Smtp-Source: AH8x227qtioVE2B/O3mveK9f+r2O6wmh5DE8DUPoWN/uw6aaFVYm2hoIpKwRcXn10Kuyd4d+fEB9 X-Received: by 10.98.220.72 with SMTP id t69mr18580354pfg.135.1516958277603; Fri, 26 Jan 2018 01:17:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516958277; cv=none; d=google.com; s=arc-20160816; b=caaE++MZtHBmGhN3BmZgG5e0FwfDoRIPt+yOwQ6S0UkxHe2hNBZor3c763mt6s2wvL KWLjroBcz0JUj/FC2UvX6qf/0A96dkzEOx4VyjV0Qx/nYX2MPviT9lsamToV/rt3nmvO Ca6sia8OxSMwYlQ14nBXpJlgiaTaqWn9qVAjZpFYr3V00smEhQWWsOd7brP9HmDbrT+Q N6tNlPuCpEfWCEzYIvmGoMdNmlQ/h3cixNomf7VBQPNWJTbvh35t1jMlNPKA597rQ9oS JiNHnIC7FtyZPF47xlYcNwUkAWyiKMV5tlqiB1K+Vd9ExOUwiuvah8LYS9h4b8pIDanE Hm8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=BVRNHwULMYari5z8jlRkb+kzqpI0mPyruvRHTrQwg6k=; b=sRt5bAKu12GlVU17f4UQeyt8s4vNp9LI62pJ56spxewT6d2jyPxEPxvzqHL7Wb44vP Q1dZ2tg7wrgdAqDYpVhRW09lFAXDmQ7N5FoXEvLOi8hE2EJ0APyN73n/xoS1oSBkGzZt IvDnY0NAE6kMWcQSSCWmEbTLpIResihs/HjIiRWgSveTdZlkcLArC3H3pesH8wRRGN6b F5be7GncZxFixGFjjq9wBOVvgpwtw954H6JlzQ0gF1AXUl2vSMM9xA5STi/08thsmd+x xOMbQfXBTh5V0ORyZCY8KMvU+LPsDKc0Bn5g+guDhRPjWGiSO8VGWYlUEbH/Sz5PAxjP Px0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q23si6048789pff.403.2018.01.26.01.17.43; Fri, 26 Jan 2018 01:17:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752665AbeAZJQl (ORCPT + 99 others); Fri, 26 Jan 2018 04:16:41 -0500 Received: from mx2.suse.de ([195.135.220.15]:33800 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752521AbeAZJQh (ORCPT ); Fri, 26 Jan 2018 04:16:37 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 075D7AE06; Fri, 26 Jan 2018 09:16:36 +0000 (UTC) From: Johannes Thumshirn To: Christoph Hellwig Cc: Sagi Grimberg , Keith Busch , Linux Kernel Mailinglist , Hannes Reinecke , Linux NVMe Mailinglist , "Martin K . Petersen" , Johannes Thumshirn Subject: [PATCH v8 2/2] nvme: add tracepoint for nvme_complete_rq Date: Fri, 26 Jan 2018 10:16:29 +0100 Message-Id: <20180126091629.31829-3-jthumshirn@suse.de> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180126091629.31829-1-jthumshirn@suse.de> References: <20180126091629.31829-1-jthumshirn@suse.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a tracepoint in nvme_complete_rq() for completions of NVMe commands. An expmale output of the trace-point is as follows: -0 [001] d.h. 3.505266: nvme_complete_rq: cmdid=989, qid=1, res=0, retries=0, flags=0x0, status=0 Signed-off-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg --- Changes to v6: * Rebase onto nvme-4.16 Changes to v4: * Print QID for completions (Christoph) Changes to v2: * Pass the whole struct request to the tracepoint * Removed spaces after parenthesis (Christoph) --- drivers/nvme/host/core.c | 2 ++ drivers/nvme/host/trace.h | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 358dfdc1f6da..7cbd4a260d30 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -220,6 +220,8 @@ void nvme_complete_rq(struct request *req) { blk_status_t status = nvme_error_status(req); + trace_nvme_complete_rq(req); + if (unlikely(status != BLK_STS_OK && nvme_req_needs_retry(req))) { if (nvme_req_needs_failover(req, status)) { nvme_failover_req(req); diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h index f17dbfbead5a..afd87235311b 100644 --- a/drivers/nvme/host/trace.h +++ b/drivers/nvme/host/trace.h @@ -130,6 +130,32 @@ TRACE_EVENT(nvme_setup_nvm_cmd, __parse_nvme_cmd(__entry->opcode, __entry->cdw10)) ); +TRACE_EVENT(nvme_complete_rq, + TP_PROTO(struct request *req), + TP_ARGS(req), + TP_STRUCT__entry( + __field(int, qid) + __field(int, cid) + __field(__le64, result) + __field(u8, retries) + __field(u8, flags) + __field(u16, status) + ), + TP_fast_assign( + __entry->qid = req->q->id; + __entry->cid = req->tag; + __entry->result = nvme_req(req)->result.u64; + __entry->retries = nvme_req(req)->retries; + __entry->flags = nvme_req(req)->flags; + __entry->status = nvme_req(req)->status; + ), + TP_printk("cmdid=%u, qid=%d, res=%llu, retries=%u, flags=0x%x, status=%u", + __entry->cid, __entry->qid, + le64_to_cpu(__entry->result), + __entry->retries, __entry->flags, __entry->status) + +); + #endif /* _TRACE_NVME_H */ #undef TRACE_INCLUDE_PATH -- 2.13.6