linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Can Guo <cang@codeaurora.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	kernel-team@android.com, Jaegeuk Kim <jaegeuk@google.com>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>
Subject: Re: [PATCH 4/4] scsi: add more contexts in the ufs tracepoints
Date: Tue, 20 Oct 2020 10:18:39 +0800	[thread overview]
Message-ID: <f55c7b379283bfb90e884e9b1bdf170e@codeaurora.org> (raw)
In-Reply-To: <20201005223635.2922805-4-jaegeuk@kernel.org>

On 2020-10-06 06:36, Jaegeuk Kim wrote:
> From: Jaegeuk Kim <jaegeuk@google.com>
> 
> This adds user-friendly tracepoints with group id.
> 
> Cc: Alim Akhtar <alim.akhtar@samsung.com>
> Cc: Avri Altman <avri.altman@wdc.com>
> Cc: Can Guo <cang@codeaurora.org>
> Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>

Reviewed-by: Can Guo <cang@codeaurora.org>

> ---
>  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 76e95963887be..a2db8182663da 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -336,7 +336,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;
> @@ -362,13 +362,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 84841b3a7ffd5..50654f3526392 100644
> --- a/include/trace/events/ufs.h
> +++ b/include/trace/events/ufs.h
> @@ -11,6 +11,15 @@
> 
>  #include <linux/tracepoint.h>
> 
> +#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
>  	)
>  );

  reply	other threads:[~2020-10-20  2:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-05 22:36 [PATCH 1/4] scsi: ufs: atomic update for clkgating_enable Jaegeuk Kim
2020-10-05 22:36 ` [PATCH 2/4] scsi: ufs: clear UAC for FFU and RPMB LUNs Jaegeuk Kim
2020-10-20  2:17   ` Can Guo
2020-10-20 18:36     ` jaegeuk
2020-10-05 22:36 ` [PATCH 3/4] scsi: ufs: use WQ_HIGHPRI for gating work Jaegeuk Kim
2020-10-20  2:19   ` Can Guo
2020-10-20 18:27     ` jaegeuk
2020-10-05 22:36 ` [PATCH 4/4] scsi: add more contexts in the ufs tracepoints Jaegeuk Kim
2020-10-20  2:18   ` Can Guo [this message]
2020-10-20 10:51     ` Avri Altman
2020-10-20 11:02       ` Can Guo
2020-10-20 11:54         ` Avri Altman
2020-10-20 11:57         ` Can Guo
2020-10-20 12:33           ` Can Guo
2020-10-20  2:30 ` [PATCH 1/4] scsi: ufs: atomic update for clkgating_enable Can Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f55c7b379283bfb90e884e9b1bdf170e@codeaurora.org \
    --to=cang@codeaurora.org \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=jaegeuk@google.com \
    --cc=jaegeuk@kernel.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).