Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp412897imm; Thu, 28 Jun 2018 23:23:09 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLi5hk7tGrwDlwQUIbRToKpDeR0I9LLLwSNDPk6dvZL70jtb1SVF93Q1D+DaAlryV3+KqfS X-Received: by 2002:a63:ac57:: with SMTP id z23-v6mr11139977pgn.74.1530253389914; Thu, 28 Jun 2018 23:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530253389; cv=none; d=google.com; s=arc-20160816; b=zPdA5ijB0VOZou4HezCryELH0sopYNeB9Ub3shAL7BtiOxM040+es7ObKDw8Nn4P4J voaGZZ7+iDaEbDapndStN9J425JEnMj7HRV7FPGTuu0xyx1a34UyJPkr0TGaJwM2/IZs PnCHKIQIjMwqEDzY4l3wL83kjP3CRGwFw5jS9IEJ/Y5u9BHPB69DsVR9rxDWRevC3kgd K2dwsgKFRRLVdWC5HJSMe05PMKRGeexITwdWKTK/Fs18kyeWgLHDPJoQXc+ahwLANjFT O8mhFT/z8jZfJ+dg+cdG0Qvc+fyaE5frlknxLatrIzmulsAMcJksYfwHA6vN+/I7RVFs GseQ== 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=qmHVH7ExJW5f46Nmq0t6Wcx6cbstO3fufiVlaEX7mZg=; b=TiqjvEnb+1FZaAiEwpOYSqtOpnpwlele40UMBknfeoLMKklvwlTPJO10bjSA0esat6 qOT1/AyU3jYccG+DTT1cGy6Ej63rq4X9ayEyhUk9bBvCeKMHDh6+owpHXx9E/jUxf/F2 a3fvFyMcQqblA+IEekAd0Z2hXuLMhmW5OFqdUvOnIH4DLdLJcximP3SIQEXS3DSd67vT 3dx14NwSQX93+dF1tK7LSGXJuvcBEZ3wAXSIoxeK5yDkxhVV+a0RrNPQM/EqBaYvNKO3 RcLDbuDEk8VnCMMABI9QB1yfIJxmkWj5hnAjE6KjC8ycs1FjwxF0bwBJuxGgVG9sCLef KcYA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t127-v6si8940870pfc.174.2018.06.28.23.22.55; Thu, 28 Jun 2018 23:23:09 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967235AbeF1VxA (ORCPT + 99 others); Thu, 28 Jun 2018 17:53:00 -0400 Received: from mga05.intel.com ([192.55.52.43]:16533 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966500AbeF1VvB (ORCPT ); Thu, 28 Jun 2018 17:51:01 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 14:51:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,285,1526367600"; d="scan'208";a="67214454" Received: from unknown (HELO localhost.lm.intel.com) ([10.232.112.44]) by fmsmga004.fm.intel.com with ESMTP; 28 Jun 2018 14:50:49 -0700 From: Keith Busch To: Johannes Thumshirn , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Keith Busch Subject: [PATCHv2 3/4] nvme: trace controller name Date: Thu, 28 Jun 2018 15:49:55 -0600 Message-Id: <20180628214956.13877-4-keith.busch@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180628214956.13877-1-keith.busch@intel.com> References: <20180628214956.13877-1-keith.busch@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This appends the controller instance to the trace buffer for nvme commands to distinguish what controller is dispatching and completing a command. Signed-off-by: Keith Busch --- drivers/nvme/host/trace.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h index 42c99445dd96..a99b2929794a 100644 --- a/drivers/nvme/host/trace.h +++ b/drivers/nvme/host/trace.h @@ -79,6 +79,7 @@ TRACE_EVENT(nvme_setup_nvm_cmd, TP_PROTO(struct request *req, struct nvme_command *cmd), TP_ARGS(req, cmd), TP_STRUCT__entry( + __field(int, ctrl_id) __field(int, qid) __field(u8, opcode) __field(u8, flags) @@ -88,6 +89,7 @@ TRACE_EVENT(nvme_setup_nvm_cmd, __array(u8, cdw10, 24) ), TP_fast_assign( + __entry->ctrl_id = nvme_req(req)->ctrl->instance; __entry->qid = blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(req)) + !!req->rq_disk; __entry->opcode = cmd->common.opcode; __entry->flags = cmd->common.flags; @@ -97,9 +99,9 @@ TRACE_EVENT(nvme_setup_nvm_cmd, memcpy(__entry->cdw10, cmd->common.cdw10, sizeof(__entry->cdw10)); ), - TP_printk("qid=%d, nsid=%u, cmdid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)", - __entry->qid, __entry->nsid, __entry->cid, - __entry->flags, __entry->metadata, + TP_printk("nvme%d: qid=%d, cmdid=%u, nsid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)", + __entry->ctrl_id, __entry->qid, __entry->nsid, + __entry->cid, __entry->flags, __entry->metadata, __entry->qid ? show_opcode_name(__entry->opcode) : show_admin_opcode_name(__entry->opcode), @@ -112,6 +114,7 @@ TRACE_EVENT(nvme_complete_rq, TP_PROTO(struct request *req), TP_ARGS(req), TP_STRUCT__entry( + __field(int, ctrl_id) __field(int, qid) __field(int, cid) __field(u64, result) @@ -120,6 +123,7 @@ TRACE_EVENT(nvme_complete_rq, __field(u16, status) ), TP_fast_assign( + __entry->ctrl_id = nvme_req(req)->ctrl->instance; __entry->qid = blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(req)) + !!req->rq_disk; __entry->cid = req->tag; __entry->result = le64_to_cpu(nvme_req(req)->result.u64); @@ -127,9 +131,10 @@ TRACE_EVENT(nvme_complete_rq, __entry->flags = nvme_req(req)->flags; __entry->status = nvme_req(req)->status; ), - TP_printk("qid=%d, cmdid=%u, res=%llu, retries=%u, flags=0x%x, status=%u", - __entry->qid, __entry->cid, __entry->result, - __entry->retries, __entry->flags, __entry->status) + TP_printk("nvme%d: qid=%d, cmdid=%u, res=%llu, retries=%u, flags=0x%x, status=%u", + __entry->ctrl_id, __entry->qid, __entry->cid, + __entry->result, __entry->retries, __entry->flags, + __entry->status) ); -- 2.14.3