Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4692827pxu; Wed, 21 Oct 2020 02:57:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxe1Tijxax5S7QQx/k8PmgzK8hqpiuB/HnBvaFZPf8v8IZtqB1bdRFe4y2u9b1mbsYQpsDW X-Received: by 2002:aa7:db82:: with SMTP id u2mr2296934edt.262.1603274258385; Wed, 21 Oct 2020 02:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603274258; cv=none; d=google.com; s=arc-20160816; b=lzus5EZQ8TY9uewV3qmBxjVIRQZSOqIDVnwBG1UpOt6pGZnjNMFFYpvJ6azmSyHFt2 0VBu9z/uW1WxvTwqBBy+u91iWkU4dMNVH3qnvr058Dx704FP5Am2GxQJApXOv1Vp5uc7 YC5BUJmRoW/B4wBmT82BI09kC7zevmBh/1OIEuJU9QKDW18XaiMY6/Ee9ERj7iS9owns EcK7TL7D2H5vWkRYmpvbGkDVIrrLIvc4t1THqmldDUL7H2WGG83yMxCeABs01ruhgwUe SmX62AspHYQNrScsQ3rdg2FFxXSu66dg7hsflgny6FNEh5aQWAXY6Tlu/vEKFqKdVLz2 wxQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dYdb/xpWrPXQyhztClmkUwZ2ARnTX+aGFl2iCeQm1ew=; b=syuB5MrBM7qgVOr3/1EiKRAFGCMrtKYOkz+oeOGJ+WA/el7yNjm/V7LFiWI6hg7tsf 5vupgLluua9iRA3Vw/4b87cEHBiinJx5JKyMxq10OGIKr1MmEX8c2cbrFF9nX6L2KGZo B9NFAwrfvWRJNnim7efVGjhcHudBk3GK0q6iyZOqsLjiqh4+GqSzZtVE8t/4d/9Sbtp0 STpALsg3R3nP+Y1adCHhnxQGELNlW6H45ljcSG1JPV1HZMD0YMVYewYZZSUXM71n9EFO n5td69isJTaQsatuKyaXC0jXLzHPzTyxeMHtekeLiKtS8UX0N8K5zapPb81UZwQtMgRB sDgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hf6mBkBd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d8si1066991edy.313.2020.10.21.02.57.16; Wed, 21 Oct 2020 02:57:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hf6mBkBd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438442AbgJTTxL (ORCPT + 99 others); Tue, 20 Oct 2020 15:53:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:48278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438416AbgJTTxJ (ORCPT ); Tue, 20 Oct 2020 15:53:09 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 108262225D; Tue, 20 Oct 2020 19:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603223588; bh=3mNMAH34s6dDmoYB+7iHPe6OOtDN1SqxKqRVioVfTCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hf6mBkBd05pexukSMkul4zejxom9h9PlDCXE+JgaE6NmdOBdNdDZ/KKA47JmYyb1f CPnhabiHN8d0X88CXQKgJvuFpY/14D8ohRzzI6yQqc7kDGpFQQATSThekefkba+/LN opmFOtQ9VWA3Sqy2LzF80vztiFeaVpUvOuUHyDsk= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com Cc: Jaegeuk Kim , Alim Akhtar , Avri Altman , Can Guo Subject: [PATCH v2 4/5] scsi: add more contexts in the ufs tracepoints Date: Tue, 20 Oct 2020 12:52:57 -0700 Message-Id: <20201020195258.2005605-5-jaegeuk@kernel.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201020195258.2005605-1-jaegeuk@kernel.org> References: <20201020195258.2005605-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jaegeuk Kim This adds user-friendly tracepoints with group id. Cc: Alim Akhtar Cc: Avri Altman Reviewed-by: Can Guo Signed-off-by: Jaegeuk Kim --- drivers/scsi/ufs/ufshcd.c | 6 ++++-- include/trace/events/ufs.h | 21 +++++++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 0858c0b55eac..b5ca0effe636 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -348,7 +348,7 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag, const char *str) { sector_t lba = -1; - u8 opcode = 0; + u8 opcode = 0, group_id = 0; u32 intr, doorbell; struct ufshcd_lrb *lrbp = &hba->lrb[tag]; struct scsi_cmnd *cmd = lrbp->cmd; @@ -374,13 +374,15 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, lba = cmd->request->bio->bi_iter.bi_sector; transfer_len = be32_to_cpu( lrbp->ucd_req_ptr->sc.exp_data_transfer_len); + if (opcode == WRITE_10) + group_id = lrbp->cmd->cmnd[6]; } } intr = ufshcd_readl(hba, REG_INTERRUPT_STATUS); doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); trace_ufshcd_command(dev_name(hba->dev), str, tag, - doorbell, transfer_len, intr, lba, opcode); + doorbell, transfer_len, intr, lba, opcode, group_id); } static void ufshcd_print_clk_freqs(struct ufs_hba *hba) diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h index 84841b3a7ffd..50654f352639 100644 --- a/include/trace/events/ufs.h +++ b/include/trace/events/ufs.h @@ -11,6 +11,15 @@ #include +#define str_opcode(opcode) \ + __print_symbolic(opcode, \ + { WRITE_16, "WRITE_16" }, \ + { WRITE_10, "WRITE_10" }, \ + { READ_16, "READ_16" }, \ + { READ_10, "READ_10" }, \ + { SYNCHRONIZE_CACHE, "SYNC" }, \ + { UNMAP, "UNMAP" }) + #define UFS_LINK_STATES \ EM(UIC_LINK_OFF_STATE) \ EM(UIC_LINK_ACTIVE_STATE) \ @@ -215,9 +224,10 @@ DEFINE_EVENT(ufshcd_template, ufshcd_init, TRACE_EVENT(ufshcd_command, TP_PROTO(const char *dev_name, const char *str, unsigned int tag, u32 doorbell, int transfer_len, u32 intr, u64 lba, - u8 opcode), + u8 opcode, u8 group_id), - TP_ARGS(dev_name, str, tag, doorbell, transfer_len, intr, lba, opcode), + TP_ARGS(dev_name, str, tag, doorbell, transfer_len, + intr, lba, opcode, group_id), TP_STRUCT__entry( __string(dev_name, dev_name) @@ -228,6 +238,7 @@ TRACE_EVENT(ufshcd_command, __field(u32, intr) __field(u64, lba) __field(u8, opcode) + __field(u8, group_id) ), TP_fast_assign( @@ -239,13 +250,15 @@ TRACE_EVENT(ufshcd_command, __entry->intr = intr; __entry->lba = lba; __entry->opcode = opcode; + __entry->group_id = group_id; ), TP_printk( - "%s: %s: tag: %u, DB: 0x%x, size: %d, IS: %u, LBA: %llu, opcode: 0x%x", + "%s: %s: tag: %u, DB: 0x%x, size: %d, IS: %u, LBA: %llu, opcode: 0x%x (%s), group_id: 0x%x", __get_str(str), __get_str(dev_name), __entry->tag, __entry->doorbell, __entry->transfer_len, - __entry->intr, __entry->lba, (u32)__entry->opcode + __entry->intr, __entry->lba, (u32)__entry->opcode, + str_opcode(__entry->opcode), (u32)__entry->group_id ) ); -- 2.29.0.rc1.297.gfa9743e501-goog