Received: by 10.223.176.46 with SMTP id f43csp454247wra; Wed, 24 Jan 2018 00:30:00 -0800 (PST) X-Google-Smtp-Source: AH8x226mWv7qme0fQCiaYO6pfZueKQk1ZQfK4zaUgemr0r9c8dm4eWhJktE/MGjQcmhwBanzr5yX X-Received: by 10.99.160.88 with SMTP id u24mr10245269pgn.122.1516782600106; Wed, 24 Jan 2018 00:30:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516782600; cv=none; d=google.com; s=arc-20160816; b=ZyPsr/77oL1HxddSwJIPs0YM/oSkHvW6VNAO9MWEnwIpMLhVnCmMJKL0TxdHOLJH2Q gGn67xIntt9LPJ1jwX84AbqsdQTUZcW6ODETunFXsa61cZuhuAbC26fg764vIjjjuqng e02zZYBhbPKA3SHYxDgNgzRHLl3zhGCDj6MuUPMAVOUqgVWNFUYXuMDMmkpsDd4fIeXV gcKsv+IkbkDXtNdJP7JG16ZuDq1diWkX4ViJDSeALw3CanDfBfNbbgO8jm5uYggyCfnr AxJm7VD8+MYW2272Fc1dWcNcfwUB2RS9WARnQXksP9LkWIkG2ln9LVTDKOqlJcnL1e35 t/lg== 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=5gfTkmPnZjJ9GZiD7K8bxW3oZIZaLj4oNRzCWY783ck=; b=yqMkEuMxJd2DwX7N3U0v0eOGDS+c8nU2fTLtBjwF7sCnR8xsmWj5qTgNN7p9TWLuY7 h6WSll+rNESdAsWpUDk0lTZewoQmKFhN5dq46kBaxlNWJhrXdUQbQ54wx30MJEOKDzpf MgpoHjOMFMkxGlUq1vnUhmV7c9pKuJBk0Rj29WcRzxnV3fRHTBTsNf3XMDyMN5Glqxxa jRYgIgdERq8GQdc3rpbCYsRpl/vBlVOY5s42tC9g3FhOMTQK3Eib+ehC3HqTH0SH8tCD xhlOfamlTty2G4bVjE7IJuuKRgcAmOz3AuzV3jfOnsK5gSDrIfACvfKBezj7zdYe/LUc uRmA== 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 w3si15950556pgb.739.2018.01.24.00.29.46; Wed, 24 Jan 2018 00:30:00 -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 S932565AbeAXI3B (ORCPT + 99 others); Wed, 24 Jan 2018 03:29:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:36316 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932085AbeAXI2k (ORCPT ); Wed, 24 Jan 2018 03:28:40 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 8EF7EAE5D; Wed, 24 Jan 2018 08:28:39 +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 v7 2/2] nvme: add tracepoint for nvme_complete_rq Date: Wed, 24 Jan 2018 09:28:28 +0100 Message-Id: <20180124082828.364-3-jthumshirn@suse.de> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180124082828.364-1-jthumshirn@suse.de> References: <20180124082828.364-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 --- 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