Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4473537imm; Wed, 30 May 2018 06:23:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIXt/lV1w8DPnwLwLBCQMylsQ+4Q2XuKQfsOes36X0h54KldoD5/+TJ2UOvEmYJJYFrH0tG X-Received: by 2002:a65:4642:: with SMTP id k2-v6mr2286001pgr.305.1527686594767; Wed, 30 May 2018 06:23:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527686594; cv=none; d=google.com; s=arc-20160816; b=zqKQZDft+73rTeIwbbSIokEFc03xU+amT6hu7h2dLCTJ83takEqKsdi0GSU3I+iS/y MVCI9qgHTZ3ONyd0k9iN32TeI/NTui+f7VZ+Sw6Jzqw05ZcVmXL9iwwee6gtadGPEcWW IWi21seevLQeNYztuq/WpybX93KWpOSk7ro93oQnuOV5SEwhOlPG0r1/WXCUhwY1RLgI +tPASYMVxh0sYX0iLo27a0sGvdGCwqoVHGManoD/VvIBunM/F1tdSzBLQOgpNBMzqyLb f/tg4bnuq2ovGrxSRDoic7X/aJqEQ4xyPqt4FNNP3WvI9A8dMgav4uI8GI2FQAQDArG6 BbpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=hcioipJMjhZRzAjn6142tGAS3lmQoNLBzGzaWIVb++0=; b=js97iswYO7wRCdpYbSjLkz2tJUOtVUc6BxVtxhpnF01d/2xOp2Mutbyc53OKeWx5Bb W54ss/KPPyQRyNbUTNPBNHjjVReFr77d4prkzBoYrg0J4am1cjUftxq5+5m65ntyBGnx NAEIuG0j852VkijadoCdOjkTnFVgO42BFRKlXJvT0OdeUAAO/xSEpgFDSNcULL0n9mQX xcAOmuv+DMMkpCqjYBCokExR9QxGHxkmrdjmdlGHTS/uQr9nEnYi0pD1VTS6h7SuLTpS MnnDDdJ2iMZIu2Zu3ieQPqcMCGvCOLpQKK/wtFU/RaCTAfcJJRNJH8ppBFwp5VVTAw4w fFvA== 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 y23-v6si13682463pli.354.2018.05.30.06.23.00; Wed, 30 May 2018 06:23:14 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753565AbeE3NVF (ORCPT + 99 others); Wed, 30 May 2018 09:21:05 -0400 Received: from mx2.suse.de ([195.135.220.15]:49484 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752852AbeE3NVA (ORCPT ); Wed, 30 May 2018 09:21:00 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E788CAC12; Wed, 30 May 2018 13:20:58 +0000 (UTC) From: Johannes Thumshirn To: Christoph Hellwig , Keith Busch , Sagi Grimberg Cc: Linux Kernel Mailinglist , Linux NVMe Mailinglist , Hannes Reinecke , Johannes Thumshirn Subject: [PATCH] nvme: trace: add disk name to tracepoints Date: Wed, 30 May 2018 15:20:49 +0200 Message-Id: <20180530132049.5890-1-jthumshirn@suse.de> X-Mailer: git-send-email 2.16.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add disk name to tracepoints so we can better destinguish between individual disks in the trace output. Signed-off-by: Johannes Thumshirn --- drivers/nvme/host/core.c | 4 ++-- drivers/nvme/host/trace.h | 32 ++++++++++++++++++++------------ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 99b857e5a7a9..eb112ff2bede 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -647,9 +647,9 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req, cmd->common.command_id = req->tag; if (ns) - trace_nvme_setup_nvm_cmd(req->q->id, cmd); + trace_nvme_setup_nvm_cmd(ns->disk->disk_name, req->q->id, cmd); else - trace_nvme_setup_admin_cmd(cmd); + trace_nvme_setup_admin_cmd(ns->disk->disk_name, cmd); return ret; } EXPORT_SYMBOL_GPL(nvme_setup_cmd); diff --git a/drivers/nvme/host/trace.h b/drivers/nvme/host/trace.h index ea91fccd1bc0..3d3f91b933db 100644 --- a/drivers/nvme/host/trace.h +++ b/drivers/nvme/host/trace.h @@ -76,9 +76,10 @@ const char *nvme_trace_parse_nvm_cmd(struct trace_seq *p, u8 opcode, nvme_trace_parse_nvm_cmd(p, opcode, cdw10) TRACE_EVENT(nvme_setup_admin_cmd, - TP_PROTO(struct nvme_command *cmd), - TP_ARGS(cmd), + TP_PROTO(char *disk_name, struct nvme_command *cmd), + TP_ARGS(disk_name, cmd), TP_STRUCT__entry( + __string(name, disk_name) __field(u8, opcode) __field(u8, flags) __field(u16, cid) @@ -86,6 +87,7 @@ TRACE_EVENT(nvme_setup_admin_cmd, __array(u8, cdw10, 24) ), TP_fast_assign( + __assign_str(name, disk_name); __entry->opcode = cmd->common.opcode; __entry->flags = cmd->common.flags; __entry->cid = cmd->common.command_id; @@ -93,17 +95,19 @@ TRACE_EVENT(nvme_setup_admin_cmd, memcpy(__entry->cdw10, cmd->common.cdw10, sizeof(__entry->cdw10)); ), - TP_printk(" cmdid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)", - __entry->cid, __entry->flags, __entry->metadata, + TP_printk("%s: cmdid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)", + __get_str(name), __entry->cid, __entry->flags, + __entry->metadata, show_admin_opcode_name(__entry->opcode), __parse_nvme_admin_cmd(__entry->opcode, __entry->cdw10)) ); TRACE_EVENT(nvme_setup_nvm_cmd, - TP_PROTO(int qid, struct nvme_command *cmd), - TP_ARGS(qid, cmd), + TP_PROTO(char *disk_name, int qid, struct nvme_command *cmd), + TP_ARGS(disk_name, qid, cmd), TP_STRUCT__entry( + __string(name, disk_name) __field(int, qid) __field(u8, opcode) __field(u8, flags) @@ -113,6 +117,7 @@ TRACE_EVENT(nvme_setup_nvm_cmd, __array(u8, cdw10, 24) ), TP_fast_assign( + __assign_str(name, disk_name); __entry->qid = qid; __entry->opcode = cmd->common.opcode; __entry->flags = cmd->common.flags; @@ -122,9 +127,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("%s: qid=%d, nsid=%u, cmdid=%u, flags=0x%x, meta=0x%llx, cmd=(%s %s)", + __get_str(name), __entry->qid, __entry->nsid, + __entry->cid, __entry->flags, __entry->metadata, show_opcode_name(__entry->opcode), __parse_nvme_cmd(__entry->opcode, __entry->cdw10)) ); @@ -133,6 +138,7 @@ TRACE_EVENT(nvme_complete_rq, TP_PROTO(struct request *req), TP_ARGS(req), TP_STRUCT__entry( + __string(name, req->rq_disk->disk_name) __field(int, qid) __field(int, cid) __field(u64, result) @@ -141,6 +147,7 @@ TRACE_EVENT(nvme_complete_rq, __field(u16, status) ), TP_fast_assign( + __assign_str(name, req->rq_disk->disk_name); __entry->qid = req->q->id; __entry->cid = req->tag; __entry->result = le64_to_cpu(nvme_req(req)->result.u64); @@ -148,9 +155,10 @@ TRACE_EVENT(nvme_complete_rq, __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) + TP_printk("%s: cmdid=%u, qid=%d, res=%llu, retries=%u, flags=0x%x, status=%u", + __get_str(name), __entry->cid, __entry->qid, + __entry->result, __entry->retries, __entry->flags, + __entry->status) ); -- 2.16.3