From patchwork Wed May 13 19:11:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajat Jain X-Patchwork-Id: 6399661 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5BD379F374 for ; Wed, 13 May 2015 19:11:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 688E220411 for ; Wed, 13 May 2015 19:11:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 444B42040F for ; Wed, 13 May 2015 19:11:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934628AbbEMTLa (ORCPT ); Wed, 13 May 2015 15:11:30 -0400 Received: from mail-ie0-f179.google.com ([209.85.223.179]:33121 "EHLO mail-ie0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934295AbbEMTL3 (ORCPT ); Wed, 13 May 2015 15:11:29 -0400 Received: by iebgx4 with SMTP id gx4so41080076ieb.0 for ; Wed, 13 May 2015 12:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=J6ZZwJXiKItpG0smCcPFgzXIc7k3TvaDkJ2TQVfIut0=; b=ayLs8G28lmKqxUh7Ceu+Dd/H0jJPnw6sL5kE0QHruMYfnYC+SgFFnTa/f/FWXbMiOt vCkUQXg71fi2VmfQmcytTtMs+WBBnuaafB1yl6dqJWwKvtgIzHZpRqjfe8AW40WisRs5 RXdTie8oDg+1GwPEN9FhHYYM+hbJUpvqsLam+GmDX/u/NnjAgBH5g1O7eABaxyF1s4Oh pb9PvQ9I3QwNYlU2ax7uSKviyyXy/+ibUfUP+AjCzXYX9JSaqpoMF07GL1VrWQghXHhK xBhuatB8V/aMzKI6g/Xgtc8tsEuWr8pYWjMLuzqDdsv0LiGWWCmGivVG0yu5cVP49QPa UFjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=J6ZZwJXiKItpG0smCcPFgzXIc7k3TvaDkJ2TQVfIut0=; b=nAvOOTx/wM4t9nUHsYIW1RIjY3Qc9bNlEISGl8jSmNV+7zr8QPL5W/5wQxUnAJTDRS VNkMCI89GF5X/12/+TZbfFjvw+dipBDz8cGhvmaANoQi721+2SsfAd8sstdY2F1uiulK QZJjQWcTB7YRRg7GI35cAAsuQW6iZCSRjxzgGj5lB4zHyvfuaO2kCJq2T6Fik7Lq3CN2 T+6OaOpYy/80fbHWA9rjvkviKqpfYQbyeTOCI7/MbR0+yp25ZXH/hypehxzHOQWytTCU ds/lfvETozD4jFdJSPREnmMEvCp5MJSwPf9b1NfIiCde530n7zezes7fG9I6FkXc534m ywXw== X-Gm-Message-State: ALoCoQlLXQMJyhTw1WnT9jhM0srDRqVsQoltR0svnTd/pY1O+bnt7ya+u8YMK4f/dUdqXH0BAaPa X-Received: by 10.42.132.200 with SMTP id e8mr10425131ict.86.1431544288808; Wed, 13 May 2015 12:11:28 -0700 (PDT) Received: from rajatja.mtv.corp.google.com ([172.18.65.137]) by mx.google.com with ESMTPSA id m5sm14892018ioi.4.2015.05.13.12.11.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 May 2015 12:11:28 -0700 (PDT) From: Rajat Jain To: linux-scsi@vger.kernel.org Cc: "Rajat Jain" , Rajat Jain Subject: [PATCH] trace/events/scsi: Add SCSI tag to scsi cmd trace events Date: Wed, 13 May 2015 12:11:01 -0700 Message-Id: <1431544261-17363-1-git-send-email-rajatja@google.com> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Print the tag along with other information while tracing a command. This is useful for tracing & debugging tagged commands. (There are checkpatch errors about spacing, that I did not fix to stay consistent with the code immediately above and below in that file). Signed-off-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 079bd10..d61d3d1 100644 --- a/include/trace/events/scsi.h +++ b/include/trace/events/scsi.h @@ -211,6 +211,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 ) @@ -224,6 +225,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); @@ -231,10 +233,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)) @@ -254,6 +256,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 ) @@ -268,6 +271,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); @@ -275,10 +279,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), @@ -299,6 +303,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 ) @@ -313,6 +318,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); @@ -320,11 +326,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),