From patchwork Mon Apr 16 14:31:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bean Huo X-Patchwork-Id: 10343179 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C8AF60542 for ; Mon, 16 Apr 2018 14:51:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EABB28701 for ; Mon, 16 Apr 2018 14:51:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1354C2871C; Mon, 16 Apr 2018 14:51:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F48728701 for ; Mon, 16 Apr 2018 14:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752973AbeDPOvT convert rfc822-to-8bit (ORCPT ); Mon, 16 Apr 2018 10:51:19 -0400 Received: from mailout.micron.com ([137.201.242.129]:62164 "EHLO mailout.micron.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750795AbeDPOuQ (ORCPT ); Mon, 16 Apr 2018 10:50:16 -0400 X-Greylist: delayed 1062 seconds by postgrey-1.27 at vger.kernel.org; Mon, 16 Apr 2018 10:50:13 EDT Received: from mail.micron.com (bowex36d.micron.com [137.201.85.223]) by mailout.micron.com (8.14.4/8.14.6) with ESMTP id w3GEVqnw000485; Mon, 16 Apr 2018 08:31:52 -0600 Received: from SIWEX5F.sing.micron.com (10.160.29.64) by bowex36d.micron.com (137.201.85.223) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 16 Apr 2018 08:31:52 -0600 Received: from SIWEX5A.sing.micron.com (10.160.29.59) by SIWEX5F.sing.micron.com (10.160.29.64) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 16 Apr 2018 22:31:50 +0800 Received: from SIWEX5A.sing.micron.com ([fe80::a9c5:8ccb:fd84:268d]) by SIWEX5A.sing.micron.com ([fe80::a9c5:8ccb:fd84:268d%25]) with mapi id 15.00.1347.000; Mon, 16 Apr 2018 22:31:50 +0800 From: "Bean Huo (beanhuo)" To: Steven Rostedt , "axboe@kernel.dk" , "jejb@linux.vnet.ibm.com" , "martin.petersen@oracle.com" CC: "linux-block@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "mingo@redhad.com" , "Bart.VanAssche@sandisk.com" , "linux-kernel@vger.kernel.org" , "Bean Huo (beanhuo)" , "rajatja@google.com" Subject: [RESEND PATCH v1 1/2] trace: events: scsi: Add tag in SCSI trace events Thread-Topic: [RESEND PATCH v1 1/2] trace: events: scsi: Add tag in SCSI trace events Thread-Index: AdPVj5Jy/9Ew2ExTSbalJ+RQV0SXDQ== Date: Mon, 16 Apr 2018 14:31:49 +0000 Message-ID: <4650cbf668fd4853ad98dba834141e08@SIWEX5A.sing.micron.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.160.29.124] X-TM-AS-Product-Ver: SMEX-12.0.0.1782-8.200.1013-23786.005 X-TM-AS-Result: No--7.046300-0.000000-31 X-TM-AS-MatchedID: 707163-707451-851106-188019-700767-705602-851458-708712-7 00079-705450-708060-700476-148004-148050-148980-42000-42003-29961-63 X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No x-mt-checkinternalsenderrule: True MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 137.201.82.98 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Print the request tag along with other information while tracing a command. Signed-off-by: Bean Huo Acked-by: Steven Rostedt (VMware) Acked-by: Rajat Jain --- include/trace/events/scsi.h | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h index f624969..a4ada90 100644 --- a/include/trace/events/scsi.h +++ b/include/trace/events/scsi.h @@ -210,6 +210,7 @@ TRACE_EVENT(scsi_dispatch_cmd_start, __field( unsigned int, lun ) __field( unsigned int, opcode ) __field( unsigned int, cmd_len ) + __field( int, tag ) __field( unsigned int, data_sglen ) __field( unsigned int, prot_sglen ) __field( unsigned char, prot_op ) @@ -223,6 +224,7 @@ TRACE_EVENT(scsi_dispatch_cmd_start, __entry->lun = cmd->device->lun; __entry->opcode = cmd->cmnd[0]; __entry->cmd_len = cmd->cmd_len; + __entry->tag = cmd->request->tag; __entry->data_sglen = scsi_sg_count(cmd); __entry->prot_sglen = scsi_prot_sg_count(cmd); __entry->prot_op = scsi_get_prot_op(cmd); @@ -230,10 +232,10 @@ TRACE_EVENT(scsi_dispatch_cmd_start, ), TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ - " prot_op=%s cmnd=(%s %s raw=%s)", + " prot_op=%s tag=%d cmnd=(%s %s raw=%s)", __entry->host_no, __entry->channel, __entry->id, __entry->lun, __entry->data_sglen, __entry->prot_sglen, - show_prot_op_name(__entry->prot_op), + show_prot_op_name(__entry->prot_op), __entry->tag, show_opcode_name(__entry->opcode), __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len)) @@ -253,6 +255,7 @@ TRACE_EVENT(scsi_dispatch_cmd_error, __field( int, rtn ) __field( unsigned int, opcode ) __field( unsigned int, cmd_len ) + __field( int, tag ) __field( unsigned int, data_sglen ) __field( unsigned int, prot_sglen ) __field( unsigned char, prot_op ) @@ -267,6 +270,7 @@ TRACE_EVENT(scsi_dispatch_cmd_error, __entry->rtn = rtn; __entry->opcode = cmd->cmnd[0]; __entry->cmd_len = cmd->cmd_len; + __entry->tag = cmd->request->tag; __entry->data_sglen = scsi_sg_count(cmd); __entry->prot_sglen = scsi_prot_sg_count(cmd); __entry->prot_op = scsi_get_prot_op(cmd); @@ -274,10 +278,10 @@ TRACE_EVENT(scsi_dispatch_cmd_error, ), TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u" \ - " prot_op=%s cmnd=(%s %s raw=%s) rtn=%d", + " prot_op=%s tag=%d cmnd=(%s %s raw=%s) rtn=%d", __entry->host_no, __entry->channel, __entry->id, __entry->lun, __entry->data_sglen, __entry->prot_sglen, - show_prot_op_name(__entry->prot_op), + show_prot_op_name(__entry->prot_op), __entry->tag, show_opcode_name(__entry->opcode), __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len), @@ -298,6 +302,7 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, __field( int, result ) __field( unsigned int, opcode ) __field( unsigned int, cmd_len ) + __field( int, tag ) __field( unsigned int, data_sglen ) __field( unsigned int, prot_sglen ) __field( unsigned char, prot_op ) @@ -312,6 +317,7 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, __entry->result = cmd->result; __entry->opcode = cmd->cmnd[0]; __entry->cmd_len = cmd->cmd_len; + __entry->tag = cmd->request->tag; __entry->data_sglen = scsi_sg_count(cmd); __entry->prot_sglen = scsi_prot_sg_count(cmd); __entry->prot_op = scsi_get_prot_op(cmd); @@ -319,11 +325,11 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template, ), TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u " \ - "prot_sgl=%u prot_op=%s cmnd=(%s %s raw=%s) result=(driver=" \ - "%s host=%s message=%s status=%s)", + "prot_sgl=%u prot_op=%s tag=%d cmnd=(%s %s raw=%s) " \ + "result=(driver=%s host=%s message=%s status=%s)", __entry->host_no, __entry->channel, __entry->id, __entry->lun, __entry->data_sglen, __entry->prot_sglen, - show_prot_op_name(__entry->prot_op), + show_prot_op_name(__entry->prot_op), __entry->tag, show_opcode_name(__entry->opcode), __parse_cdb(__get_dynamic_array(cmnd), __entry->cmd_len), __print_hex(__get_dynamic_array(cmnd), __entry->cmd_len),