scsi: ufs: Make UPIU trace easier differentiate among CDB, OSF, and TM
Transaction Specific Fields (TSF) in the UPIU package could be CDB (SCSI/UFS Command Descriptor Block), OSF (Opcode Specific Field), and TM I/O parameter (Task Management Input/Output Parameter). But, currently, we take all of these as CDB in the UPIU trace. Thus makes user confuse among CDB, OSF, and TM message. So fix it with this patch. Link: https://lore.kernel.org/r/20210105113446.16027-7-huobean@gmail.com Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Bean Huo <beanhuo@micron.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
0ed083e916
commit
867fdc2d6e
|
@ -554,6 +554,13 @@ enum ufs_trace_str_t {
|
|||
UFS_TM_SEND, UFS_TM_COMP, UFS_TM_ERR
|
||||
};
|
||||
|
||||
/*
|
||||
* Transaction Specific Fields (TSF) type in the UPIU package, this enum is
|
||||
* used in include/trace/events/ufs.h for UFS command trace.
|
||||
*/
|
||||
enum ufs_trace_tsf_t {
|
||||
UFS_TSF_CDB, UFS_TSF_OSF, UFS_TSF_TM_INPUT, UFS_TSF_TM_OUTPUT
|
||||
};
|
||||
|
||||
/**
|
||||
* ufs_is_valid_unit_desc_lun - checks if the given LUN has a unit descriptor
|
||||
|
|
|
@ -312,7 +312,8 @@ static void ufshcd_add_cmd_upiu_trace(struct ufs_hba *hba, unsigned int tag,
|
|||
if (!trace_ufshcd_upiu_enabled())
|
||||
return;
|
||||
|
||||
trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq->header, &rq->sc.cdb);
|
||||
trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq->header, &rq->sc.cdb,
|
||||
UFS_TSF_CDB);
|
||||
}
|
||||
|
||||
static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, unsigned int tag,
|
||||
|
@ -329,7 +330,7 @@ static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, unsigned int tag,
|
|||
rq_rsp = (struct utp_upiu_req *)hba->lrb[tag].ucd_rsp_ptr;
|
||||
|
||||
trace_ufshcd_upiu(dev_name(hba->dev), str_t, &rq_rsp->header,
|
||||
&rq_rsp->qr);
|
||||
&rq_rsp->qr, UFS_TSF_OSF);
|
||||
}
|
||||
|
||||
static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag,
|
||||
|
@ -343,10 +344,10 @@ static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag,
|
|||
|
||||
if (str_t == UFS_TM_SEND)
|
||||
trace_ufshcd_upiu(dev_name(hba->dev), str_t, &descp->req_header,
|
||||
&descp->input_param1);
|
||||
&descp->input_param1, UFS_TSF_TM_INPUT);
|
||||
else
|
||||
trace_ufshcd_upiu(dev_name(hba->dev), str_t, &descp->rsp_header,
|
||||
&descp->output_param1);
|
||||
&descp->output_param1, UFS_TSF_TM_OUTPUT);
|
||||
}
|
||||
|
||||
static void ufshcd_add_uic_command_trace(struct ufs_hba *hba,
|
||||
|
|
|
@ -48,6 +48,12 @@
|
|||
EM(UFS_TM_COMP, "tm_complete") \
|
||||
EMe(UFS_TM_ERR, "tm_complete_err")
|
||||
|
||||
#define UFS_CMD_TRACE_TSF_TYPES \
|
||||
EM(UFS_TSF_CDB, "CDB") \
|
||||
EM(UFS_TSF_OSF, "OSF") \
|
||||
EM(UFS_TSF_TM_INPUT, "TM_INPUT") \
|
||||
EMe(UFS_TSF_TM_OUTPUT, "TM_OUTPUT")
|
||||
|
||||
/* Enums require being exported to userspace, for user tool parsing */
|
||||
#undef EM
|
||||
#undef EMe
|
||||
|
@ -58,6 +64,7 @@ UFS_LINK_STATES;
|
|||
UFS_PWR_MODES;
|
||||
UFSCHD_CLK_GATING_STATES;
|
||||
UFS_CMD_TRACE_STRINGS
|
||||
UFS_CMD_TRACE_TSF_TYPES
|
||||
|
||||
/*
|
||||
* Now redefine the EM() and EMe() macros to map the enums to the strings
|
||||
|
@ -70,6 +77,8 @@ UFS_CMD_TRACE_STRINGS
|
|||
|
||||
#define show_ufs_cmd_trace_str(str_t) \
|
||||
__print_symbolic(str_t, UFS_CMD_TRACE_STRINGS)
|
||||
#define show_ufs_cmd_trace_tsf(tsf) \
|
||||
__print_symbolic(tsf, UFS_CMD_TRACE_TSF_TYPES)
|
||||
|
||||
TRACE_EVENT(ufshcd_clk_gating,
|
||||
|
||||
|
@ -311,15 +320,16 @@ TRACE_EVENT(ufshcd_uic_command,
|
|||
|
||||
TRACE_EVENT(ufshcd_upiu,
|
||||
TP_PROTO(const char *dev_name, enum ufs_trace_str_t str_t, void *hdr,
|
||||
void *tsf),
|
||||
void *tsf, enum ufs_trace_tsf_t tsf_t),
|
||||
|
||||
TP_ARGS(dev_name, str_t, hdr, tsf),
|
||||
TP_ARGS(dev_name, str_t, hdr, tsf, tsf_t),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__string(dev_name, dev_name)
|
||||
__field(enum ufs_trace_str_t, str_t)
|
||||
__array(unsigned char, hdr, 12)
|
||||
__array(unsigned char, tsf, 16)
|
||||
__field(enum ufs_trace_tsf_t, tsf_t)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
|
@ -327,12 +337,14 @@ TRACE_EVENT(ufshcd_upiu,
|
|||
__entry->str_t = str_t;
|
||||
memcpy(__entry->hdr, hdr, sizeof(__entry->hdr));
|
||||
memcpy(__entry->tsf, tsf, sizeof(__entry->tsf));
|
||||
__entry->tsf_t = tsf_t;
|
||||
),
|
||||
|
||||
TP_printk(
|
||||
"%s: %s: HDR:%s, CDB:%s",
|
||||
"%s: %s: HDR:%s, %s:%s",
|
||||
show_ufs_cmd_trace_str(__entry->str_t), __get_str(dev_name),
|
||||
__print_hex(__entry->hdr, sizeof(__entry->hdr)),
|
||||
show_ufs_cmd_trace_tsf(__entry->tsf_t),
|
||||
__print_hex(__entry->tsf, sizeof(__entry->tsf))
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue