Received: by 10.223.176.46 with SMTP id f43csp505387wra; Fri, 26 Jan 2018 02:23:06 -0800 (PST) X-Google-Smtp-Source: AH8x2267dbrJlbrFF66nre/nVhEzjtPlSaRzve4mC8A3p6B7AiLWaQoTFY65RmOwie3v84CdDcXG X-Received: by 2002:a17:902:1682:: with SMTP id h2-v6mr13690075plh.116.1516962186294; Fri, 26 Jan 2018 02:23:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516962186; cv=none; d=google.com; s=arc-20160816; b=RNPM+sg6Mqxn5byR2TWx8MGnOz/xhVuXyNApX8YpFDEtJlwW4a6188YFFkrAG86JAG 9oKwWi0lwUyJiBamWqwFyiqf3flhcmjvUqRDKvi+pc3mhYArNDkD+mFQuIgWhgF1dgCB KW36rgVmbrXWCSFW+lenS+rITWHYJLrB6zkefnt+wqvM+toWJzv6brK09Dhi7Bu7zLMe VtIxm9zA0RL9RTzi1ZxDDnzsepwEz5FK7qOhy4DSgXoHAmxO8XlIIc+vU4CRZVTm8c+g 16DF2s8opXdQw2Rbyu0KEYNyNKpDkMrEWYnMIOhHI4RmlUI+AFZZ5Gmc3HDCCyF6PfOD J5BA== 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=dkZqI6Ya4MovP6QhcXDWdlbIT5Je/a9YJzyVznU7Jyg=; b=RemyWo4HOhE5QItp7nAb+NBAJCs1ZDgdTBlkYP6F9OaIxmGhR6KYLsgMoX9i34BFeA LLiQOgKT8oNvIdI4DnulTOY2dPPLZcB6aytRe2fv3oLgIdo9EEmp7jgdzXG/+ETvU0la IJAGfHycdatGWyqvXHN54DYLIce518JWUGEVZw5x0X0d427vBwkpLs+abKZm1EBe/sj9 SKAuCbuSoUrBs3OKypDiLadUT9E8N45nd4yBcScW7jXrSxiud0POoUYKqfTTwtVaiVTS vNxEfm2r/0+uSCJWOLkMjRqvD8A5aVlngrRbOqXdqVuct44ieUGr+VnmkNdwA3UlfXkw RcBw== 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 n7si2826063pgv.705.2018.01.26.02.22.51; Fri, 26 Jan 2018 02:23:06 -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 S1752219AbeAZKVv (ORCPT + 99 others); Fri, 26 Jan 2018 05:21:51 -0500 Received: from mx2.suse.de ([195.135.220.15]:39120 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752151AbeAZKVt (ORCPT ); Fri, 26 Jan 2018 05:21:49 -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 59998B2FB; Fri, 26 Jan 2018 10:21:48 +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 v9 2/2] nvme: add tracepoint for nvme_complete_rq Date: Fri, 26 Jan 2018 11:21:38 +0100 Message-Id: <20180126102138.15529-3-jthumshirn@suse.de> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180126102138.15529-1-jthumshirn@suse.de> References: <20180126102138.15529-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 | 25 +++++++++++++++++++++++++ 2 files changed, 27 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 feadf0b57d17..ea91fccd1bc0 100644 --- a/drivers/nvme/host/trace.h +++ b/drivers/nvme/host/trace.h @@ -129,6 +129,31 @@ 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(u64, result) + __field(u8, retries) + __field(u8, flags) + __field(u16, status) + ), + TP_fast_assign( + __entry->qid = req->q->id; + __entry->cid = req->tag; + __entry->result = le64_to_cpu(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, __entry->result, + __entry->retries, __entry->flags, __entry->status) + +); + #endif /* _TRACE_NVME_H */ #undef TRACE_INCLUDE_PATH -- 2.13.6