2019-05-29 07:17:58 -07:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2016-12-22 18:39:51 -08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM ufs
|
|
|
|
|
|
|
|
#if !defined(_TRACE_UFS_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define _TRACE_UFS_H
|
|
|
|
|
2024-08-21 08:54:11 +03:00
|
|
|
#include <ufs/ufs.h>
|
2016-12-22 18:39:51 -08:00
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
|
2020-11-17 08:58:37 -08:00
|
|
|
#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" })
|
|
|
|
|
2021-01-05 12:34:41 +01:00
|
|
|
#define UFS_LINK_STATES \
|
|
|
|
EM(UIC_LINK_OFF_STATE, "UIC_LINK_OFF_STATE") \
|
|
|
|
EM(UIC_LINK_ACTIVE_STATE, "UIC_LINK_ACTIVE_STATE") \
|
|
|
|
EMe(UIC_LINK_HIBERN8_STATE, "UIC_LINK_HIBERN8_STATE")
|
|
|
|
|
|
|
|
#define UFS_PWR_MODES \
|
|
|
|
EM(UFS_ACTIVE_PWR_MODE, "UFS_ACTIVE_PWR_MODE") \
|
|
|
|
EM(UFS_SLEEP_PWR_MODE, "UFS_SLEEP_PWR_MODE") \
|
|
|
|
EM(UFS_POWERDOWN_PWR_MODE, "UFS_POWERDOWN_PWR_MODE") \
|
|
|
|
EMe(UFS_DEEPSLEEP_PWR_MODE, "UFS_DEEPSLEEP_PWR_MODE")
|
|
|
|
|
|
|
|
#define UFSCHD_CLK_GATING_STATES \
|
|
|
|
EM(CLKS_OFF, "CLKS_OFF") \
|
|
|
|
EM(CLKS_ON, "CLKS_ON") \
|
|
|
|
EM(REQ_CLKS_OFF, "REQ_CLKS_OFF") \
|
|
|
|
EMe(REQ_CLKS_ON, "REQ_CLKS_ON")
|
2016-12-22 18:39:51 -08:00
|
|
|
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
#define UFS_CMD_TRACE_STRINGS \
|
|
|
|
EM(UFS_CMD_SEND, "send_req") \
|
|
|
|
EM(UFS_CMD_COMP, "complete_rsp") \
|
|
|
|
EM(UFS_DEV_COMP, "dev_complete") \
|
|
|
|
EM(UFS_QUERY_SEND, "query_send") \
|
|
|
|
EM(UFS_QUERY_COMP, "query_complete") \
|
|
|
|
EM(UFS_QUERY_ERR, "query_complete_err") \
|
|
|
|
EM(UFS_TM_SEND, "tm_send") \
|
|
|
|
EM(UFS_TM_COMP, "tm_complete") \
|
|
|
|
EMe(UFS_TM_ERR, "tm_complete_err")
|
|
|
|
|
2021-01-05 12:34:46 +01:00
|
|
|
#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")
|
|
|
|
|
2016-12-22 18:39:51 -08:00
|
|
|
/* Enums require being exported to userspace, for user tool parsing */
|
|
|
|
#undef EM
|
|
|
|
#undef EMe
|
2021-01-05 12:34:41 +01:00
|
|
|
#define EM(a, b) TRACE_DEFINE_ENUM(a);
|
|
|
|
#define EMe(a, b) TRACE_DEFINE_ENUM(a);
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
UFS_LINK_STATES;
|
|
|
|
UFS_PWR_MODES;
|
|
|
|
UFSCHD_CLK_GATING_STATES;
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
UFS_CMD_TRACE_STRINGS
|
2021-01-05 12:34:46 +01:00
|
|
|
UFS_CMD_TRACE_TSF_TYPES
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Now redefine the EM() and EMe() macros to map the enums to the strings
|
|
|
|
* that will be printed in the output.
|
|
|
|
*/
|
|
|
|
#undef EM
|
|
|
|
#undef EMe
|
2021-01-05 12:34:41 +01:00
|
|
|
#define EM(a, b) {a, b},
|
|
|
|
#define EMe(a, b) {a, b}
|
2016-12-22 18:39:51 -08:00
|
|
|
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
#define show_ufs_cmd_trace_str(str_t) \
|
|
|
|
__print_symbolic(str_t, UFS_CMD_TRACE_STRINGS)
|
2021-01-05 12:34:46 +01:00
|
|
|
#define show_ufs_cmd_trace_tsf(tsf) \
|
|
|
|
__print_symbolic(tsf, UFS_CMD_TRACE_TSF_TYPES)
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
|
2016-12-22 18:39:51 -08:00
|
|
|
TRACE_EVENT(ufshcd_clk_gating,
|
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int state),
|
2016-12-22 18:39:51 -08:00
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, state),
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2025-02-14 16:29:36 +08:00
|
|
|
__field(struct ufs_hba *, hba)
|
2016-12-22 18:39:51 -08:00
|
|
|
__field(int, state)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2025-02-14 16:29:36 +08:00
|
|
|
__entry->hba = hba;
|
2016-12-22 18:39:51 -08:00
|
|
|
__entry->state = state;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%s: gating state changed to %s",
|
2025-02-14 16:29:36 +08:00
|
|
|
dev_name(__entry->hba->dev),
|
2016-12-22 18:39:51 -08:00
|
|
|
__print_symbolic(__entry->state, UFSCHD_CLK_GATING_STATES))
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(ufshcd_clk_scaling,
|
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, const char *state, const char *clk,
|
2016-12-22 18:39:51 -08:00
|
|
|
u32 prev_state, u32 curr_state),
|
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, state, clk, prev_state, curr_state),
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2025-02-14 16:29:36 +08:00
|
|
|
__field(struct ufs_hba *, hba)
|
2016-12-22 18:39:51 -08:00
|
|
|
__string(state, state)
|
|
|
|
__string(clk, clk)
|
|
|
|
__field(u32, prev_state)
|
|
|
|
__field(u32, curr_state)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2025-02-14 16:29:36 +08:00
|
|
|
__entry->hba = hba;
|
2024-05-16 13:34:54 -04:00
|
|
|
__assign_str(state);
|
|
|
|
__assign_str(clk);
|
2016-12-22 18:39:51 -08:00
|
|
|
__entry->prev_state = prev_state;
|
|
|
|
__entry->curr_state = curr_state;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%s: %s %s from %u to %u Hz",
|
2025-02-14 16:29:36 +08:00
|
|
|
dev_name(__entry->hba->dev), __get_str(state), __get_str(clk),
|
2016-12-22 18:39:51 -08:00
|
|
|
__entry->prev_state, __entry->curr_state)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(ufshcd_auto_bkops_state,
|
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, const char *state),
|
2016-12-22 18:39:51 -08:00
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, state),
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2025-02-14 16:29:36 +08:00
|
|
|
__field(struct ufs_hba *, hba)
|
2016-12-22 18:39:51 -08:00
|
|
|
__string(state, state)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2025-02-14 16:29:36 +08:00
|
|
|
__entry->hba = hba;
|
2024-05-16 13:34:54 -04:00
|
|
|
__assign_str(state);
|
2016-12-22 18:39:51 -08:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%s: auto bkops - %s",
|
2025-02-14 16:29:36 +08:00
|
|
|
dev_name(__entry->hba->dev), __get_str(state))
|
2016-12-22 18:39:51 -08:00
|
|
|
);
|
|
|
|
|
2016-12-22 18:41:48 -08:00
|
|
|
DECLARE_EVENT_CLASS(ufshcd_profiling_template,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, const char *profile_info, s64 time_us,
|
2016-12-22 18:41:48 -08:00
|
|
|
int err),
|
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, profile_info, time_us, err),
|
2016-12-22 18:41:48 -08:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2025-02-14 16:29:36 +08:00
|
|
|
__field(struct ufs_hba *, hba)
|
2016-12-22 18:41:48 -08:00
|
|
|
__string(profile_info, profile_info)
|
|
|
|
__field(s64, time_us)
|
|
|
|
__field(int, err)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2025-02-14 16:29:36 +08:00
|
|
|
__entry->hba = hba;
|
2024-05-16 13:34:54 -04:00
|
|
|
__assign_str(profile_info);
|
2016-12-22 18:41:48 -08:00
|
|
|
__entry->time_us = time_us;
|
|
|
|
__entry->err = err;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%s: %s: took %lld usecs, err %d",
|
2025-02-14 16:29:36 +08:00
|
|
|
dev_name(__entry->hba->dev), __get_str(profile_info),
|
2016-12-22 18:41:48 -08:00
|
|
|
__entry->time_us, __entry->err)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_profiling_template, ufshcd_profile_hibern8,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, const char *profile_info, s64 time_us,
|
2016-12-22 18:41:48 -08:00
|
|
|
int err),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, profile_info, time_us, err));
|
2016-12-22 18:41:48 -08:00
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_profiling_template, ufshcd_profile_clk_gating,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, const char *profile_info, s64 time_us,
|
2016-12-22 18:41:48 -08:00
|
|
|
int err),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, profile_info, time_us, err));
|
2016-12-22 18:41:48 -08:00
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_profiling_template, ufshcd_profile_clk_scaling,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, const char *profile_info, s64 time_us,
|
2016-12-22 18:41:48 -08:00
|
|
|
int err),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, profile_info, time_us, err));
|
2016-12-22 18:41:48 -08:00
|
|
|
|
2016-12-22 18:39:51 -08:00
|
|
|
DECLARE_EVENT_CLASS(ufshcd_template,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2016-12-22 18:39:51 -08:00
|
|
|
int dev_state, int link_state),
|
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state),
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(s64, usecs)
|
|
|
|
__field(int, err)
|
2025-02-14 16:29:36 +08:00
|
|
|
__field(struct ufs_hba *, hba)
|
2016-12-22 18:39:51 -08:00
|
|
|
__field(int, dev_state)
|
|
|
|
__field(int, link_state)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->usecs = usecs;
|
|
|
|
__entry->err = err;
|
2025-02-14 16:29:36 +08:00
|
|
|
__entry->hba = hba;
|
2016-12-22 18:39:51 -08:00
|
|
|
__entry->dev_state = dev_state;
|
|
|
|
__entry->link_state = link_state;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"%s: took %lld usecs, dev_state: %s, link_state: %s, err %d",
|
2025-02-14 16:29:36 +08:00
|
|
|
dev_name(__entry->hba->dev),
|
2016-12-22 18:39:51 -08:00
|
|
|
__entry->usecs,
|
|
|
|
__print_symbolic(__entry->dev_state, UFS_PWR_MODES),
|
|
|
|
__print_symbolic(__entry->link_state, UFS_LINK_STATES),
|
|
|
|
__entry->err
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_template, ufshcd_system_suspend,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2016-12-22 18:39:51 -08:00
|
|
|
int dev_state, int link_state),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state));
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_template, ufshcd_system_resume,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2016-12-22 18:39:51 -08:00
|
|
|
int dev_state, int link_state),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state));
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_template, ufshcd_runtime_suspend,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2016-12-22 18:39:51 -08:00
|
|
|
int dev_state, int link_state),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state));
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_template, ufshcd_runtime_resume,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2016-12-22 18:39:51 -08:00
|
|
|
int dev_state, int link_state),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state));
|
2016-12-22 18:39:51 -08:00
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_template, ufshcd_init,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2016-12-22 18:39:51 -08:00
|
|
|
int dev_state, int link_state),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state));
|
2016-12-22 18:42:03 -08:00
|
|
|
|
2021-04-23 17:20:16 -07:00
|
|
|
DEFINE_EVENT(ufshcd_template, ufshcd_wl_suspend,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2021-04-23 17:20:16 -07:00
|
|
|
int dev_state, int link_state),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state));
|
2021-04-23 17:20:16 -07:00
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_template, ufshcd_wl_resume,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2021-04-23 17:20:16 -07:00
|
|
|
int dev_state, int link_state),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state));
|
2021-04-23 17:20:16 -07:00
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_template, ufshcd_wl_runtime_suspend,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2021-04-23 17:20:16 -07:00
|
|
|
int dev_state, int link_state),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state));
|
2021-04-23 17:20:16 -07:00
|
|
|
|
|
|
|
DEFINE_EVENT(ufshcd_template, ufshcd_wl_runtime_resume,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, int err, s64 usecs,
|
2021-04-23 17:20:16 -07:00
|
|
|
int dev_state, int link_state),
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, err, usecs, dev_state, link_state));
|
2021-04-23 17:20:16 -07:00
|
|
|
|
2016-12-22 18:42:03 -08:00
|
|
|
TRACE_EVENT(ufshcd_command,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct scsi_device *sdev, struct ufs_hba *hba,
|
|
|
|
enum ufs_trace_str_t str_t,
|
2023-03-15 15:44:25 +08:00
|
|
|
unsigned int tag, u32 doorbell, u32 hwq_id, int transfer_len,
|
|
|
|
u32 intr, u64 lba, u8 opcode, u8 group_id),
|
2016-12-22 18:42:03 -08:00
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(sdev, hba, str_t, tag, doorbell, hwq_id, transfer_len, intr, lba,
|
scsi: ufs: core: Include the SCSI ID in UFS command tracing output
The logical unit information is missing from the UFS command tracing
output. Although the device name is logged, e.g. 13200000.ufs, this name
does not include logical unit information. Hence this patch that replaces
the device name with the SCSI ID in the tracing output. An example of
tracing output with this patch applied:
kworker/8:0H-80 [008] ..... 89.106063: ufshcd_command: send_req: 0:0:0:4: tag: 10, DB: 0x7ffffbff, size: 524288, IS: 0, LBA: 1085538, opcode: 0x8a (WRITE_16), group_id: 0x0
dd-4225 [000] d.h.. 89.106219: ufshcd_command: complete_rsp: 0:0:0:4: tag: 11, DB: 0x7ffff7ff, size: 524288, IS: 0, LBA: 1081728, opcode: 0x8a (WRITE_16), group_id: 0x0
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230907183739.905938-1-bvanassche@acm.org
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-09-07 11:37:16 -07:00
|
|
|
opcode, group_id),
|
2016-12-22 18:42:03 -08:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
scsi: ufs: core: Include the SCSI ID in UFS command tracing output
The logical unit information is missing from the UFS command tracing
output. Although the device name is logged, e.g. 13200000.ufs, this name
does not include logical unit information. Hence this patch that replaces
the device name with the SCSI ID in the tracing output. An example of
tracing output with this patch applied:
kworker/8:0H-80 [008] ..... 89.106063: ufshcd_command: send_req: 0:0:0:4: tag: 10, DB: 0x7ffffbff, size: 524288, IS: 0, LBA: 1085538, opcode: 0x8a (WRITE_16), group_id: 0x0
dd-4225 [000] d.h.. 89.106219: ufshcd_command: complete_rsp: 0:0:0:4: tag: 11, DB: 0x7ffff7ff, size: 524288, IS: 0, LBA: 1081728, opcode: 0x8a (WRITE_16), group_id: 0x0
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230907183739.905938-1-bvanassche@acm.org
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-09-07 11:37:16 -07:00
|
|
|
__field(struct scsi_device *, sdev)
|
2025-02-14 16:29:36 +08:00
|
|
|
__field(struct ufs_hba *, hba)
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
__field(enum ufs_trace_str_t, str_t)
|
2016-12-22 18:42:03 -08:00
|
|
|
__field(unsigned int, tag)
|
|
|
|
__field(u32, doorbell)
|
2023-03-15 15:44:25 +08:00
|
|
|
__field(u32, hwq_id)
|
2016-12-22 18:42:03 -08:00
|
|
|
__field(u32, intr)
|
|
|
|
__field(u64, lba)
|
2023-03-15 15:44:25 +08:00
|
|
|
__field(int, transfer_len)
|
2016-12-22 18:42:03 -08:00
|
|
|
__field(u8, opcode)
|
2020-11-17 08:58:37 -08:00
|
|
|
__field(u8, group_id)
|
2016-12-22 18:42:03 -08:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
scsi: ufs: core: Include the SCSI ID in UFS command tracing output
The logical unit information is missing from the UFS command tracing
output. Although the device name is logged, e.g. 13200000.ufs, this name
does not include logical unit information. Hence this patch that replaces
the device name with the SCSI ID in the tracing output. An example of
tracing output with this patch applied:
kworker/8:0H-80 [008] ..... 89.106063: ufshcd_command: send_req: 0:0:0:4: tag: 10, DB: 0x7ffffbff, size: 524288, IS: 0, LBA: 1085538, opcode: 0x8a (WRITE_16), group_id: 0x0
dd-4225 [000] d.h.. 89.106219: ufshcd_command: complete_rsp: 0:0:0:4: tag: 11, DB: 0x7ffff7ff, size: 524288, IS: 0, LBA: 1081728, opcode: 0x8a (WRITE_16), group_id: 0x0
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230907183739.905938-1-bvanassche@acm.org
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-09-07 11:37:16 -07:00
|
|
|
__entry->sdev = sdev;
|
2025-02-14 16:29:36 +08:00
|
|
|
__entry->hba = hba;
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
__entry->str_t = str_t;
|
2016-12-22 18:42:03 -08:00
|
|
|
__entry->tag = tag;
|
|
|
|
__entry->doorbell = doorbell;
|
2023-03-15 15:44:25 +08:00
|
|
|
__entry->hwq_id = hwq_id;
|
2016-12-22 18:42:03 -08:00
|
|
|
__entry->intr = intr;
|
|
|
|
__entry->lba = lba;
|
2023-03-15 15:44:25 +08:00
|
|
|
__entry->transfer_len = transfer_len;
|
2016-12-22 18:42:03 -08:00
|
|
|
__entry->opcode = opcode;
|
2020-11-17 08:58:37 -08:00
|
|
|
__entry->group_id = group_id;
|
2016-12-22 18:42:03 -08:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2023-03-15 15:44:25 +08:00
|
|
|
"%s: %s: tag: %u, DB: 0x%x, size: %d, IS: %u, LBA: %llu, opcode: 0x%x (%s), group_id: 0x%x, hwq_id: %d",
|
scsi: ufs: core: Include the SCSI ID in UFS command tracing output
The logical unit information is missing from the UFS command tracing
output. Although the device name is logged, e.g. 13200000.ufs, this name
does not include logical unit information. Hence this patch that replaces
the device name with the SCSI ID in the tracing output. An example of
tracing output with this patch applied:
kworker/8:0H-80 [008] ..... 89.106063: ufshcd_command: send_req: 0:0:0:4: tag: 10, DB: 0x7ffffbff, size: 524288, IS: 0, LBA: 1085538, opcode: 0x8a (WRITE_16), group_id: 0x0
dd-4225 [000] d.h.. 89.106219: ufshcd_command: complete_rsp: 0:0:0:4: tag: 11, DB: 0x7ffff7ff, size: 524288, IS: 0, LBA: 1081728, opcode: 0x8a (WRITE_16), group_id: 0x0
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20230907183739.905938-1-bvanassche@acm.org
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2023-09-07 11:37:16 -07:00
|
|
|
show_ufs_cmd_trace_str(__entry->str_t),
|
|
|
|
dev_name(&__entry->sdev->sdev_dev), __entry->tag,
|
|
|
|
__entry->doorbell, __entry->transfer_len, __entry->intr,
|
2023-03-15 15:44:25 +08:00
|
|
|
__entry->lba, (u32)__entry->opcode, str_opcode(__entry->opcode),
|
|
|
|
(u32)__entry->group_id, __entry->hwq_id
|
2016-12-22 18:42:03 -08:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2020-06-15 15:22:35 +08:00
|
|
|
TRACE_EVENT(ufshcd_uic_command,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, enum ufs_trace_str_t str_t, u32 cmd,
|
2020-06-15 15:22:35 +08:00
|
|
|
u32 arg1, u32 arg2, u32 arg3),
|
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, str_t, cmd, arg1, arg2, arg3),
|
2020-06-15 15:22:35 +08:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2025-02-14 16:29:36 +08:00
|
|
|
__field(struct ufs_hba *, hba)
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
__field(enum ufs_trace_str_t, str_t)
|
2020-06-15 15:22:35 +08:00
|
|
|
__field(u32, cmd)
|
|
|
|
__field(u32, arg1)
|
|
|
|
__field(u32, arg2)
|
|
|
|
__field(u32, arg3)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2025-02-14 16:29:36 +08:00
|
|
|
__entry->hba = hba;
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
__entry->str_t = str_t;
|
2020-06-15 15:22:35 +08:00
|
|
|
__entry->cmd = cmd;
|
|
|
|
__entry->arg1 = arg1;
|
|
|
|
__entry->arg2 = arg2;
|
|
|
|
__entry->arg3 = arg3;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"%s: %s: cmd: 0x%x, arg1: 0x%x, arg2: 0x%x, arg3: 0x%x",
|
2025-02-14 16:29:36 +08:00
|
|
|
show_ufs_cmd_trace_str(__entry->str_t), dev_name(__entry->hba->dev),
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
__entry->cmd, __entry->arg1, __entry->arg2, __entry->arg3
|
2020-06-15 15:22:35 +08:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2018-03-28 12:42:18 +03:00
|
|
|
TRACE_EVENT(ufshcd_upiu,
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, enum ufs_trace_str_t str_t, void *hdr,
|
2021-01-05 12:34:46 +01:00
|
|
|
void *tsf, enum ufs_trace_tsf_t tsf_t),
|
2018-03-28 12:42:18 +03:00
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, str_t, hdr, tsf, tsf_t),
|
2018-03-28 12:42:18 +03:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2025-02-14 16:29:36 +08:00
|
|
|
__field(struct ufs_hba *, hba)
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
__field(enum ufs_trace_str_t, str_t)
|
2018-03-28 12:42:18 +03:00
|
|
|
__array(unsigned char, hdr, 12)
|
|
|
|
__array(unsigned char, tsf, 16)
|
2021-01-05 12:34:46 +01:00
|
|
|
__field(enum ufs_trace_tsf_t, tsf_t)
|
2018-03-28 12:42:18 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2025-02-14 16:29:36 +08:00
|
|
|
__entry->hba = hba;
|
scsi: ufs: Use __print_symbolic() for UFS trace string print
__print_symbolic() is designed for exporting the print formatting table to
userspace and allows parsing tool, such as trace-cmd and perf, to analyze
trace log according to this print formatting table, meanwhile, by using
__print_symbolic()s, save space in the trace ring buffer.
original print format:
print fmt: "%s: %s: HDR:%s, CDB:%s", __get_str(str), __get_str(dev_name),
__print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
after this change:
print fmt: "%s: %s: HDR:%s, CDB:%s",
print_symbolic(REC->str_t, {0, "send"},
{1, "complete"},
{2, "dev_complete"},
{3, "query_send"},
{4, "query_complete"},
{5, "query_complete_err"},
{6, "tm_send"},
{7, "tm_complete"},
{8, "tm_complete_err"}),
__get_str(dev_name), __print_hex(REC->hdr, sizeof(REC->hdr)),
__print_hex(REC->tsf, sizeof(REC->tsf))
Note: This patch just converts current __get_str(str) to __print_symbolic(),
the original tracing log will not be affected by this change, so it
doesn't break what current parsers expect.
Link: https://lore.kernel.org/r/20210105113446.16027-3-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>
2021-01-05 12:34:42 +01:00
|
|
|
__entry->str_t = str_t;
|
2018-03-28 12:42:18 +03:00
|
|
|
memcpy(__entry->hdr, hdr, sizeof(__entry->hdr));
|
|
|
|
memcpy(__entry->tsf, tsf, sizeof(__entry->tsf));
|
2021-01-05 12:34:46 +01:00
|
|
|
__entry->tsf_t = tsf_t;
|
2018-03-28 12:42:18 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
2021-01-05 12:34:46 +01:00
|
|
|
"%s: %s: HDR:%s, %s:%s",
|
2025-02-14 16:29:36 +08:00
|
|
|
show_ufs_cmd_trace_str(__entry->str_t), dev_name(__entry->hba->dev),
|
2018-03-28 12:42:18 +03:00
|
|
|
__print_hex(__entry->hdr, sizeof(__entry->hdr)),
|
2021-01-05 12:34:46 +01:00
|
|
|
show_ufs_cmd_trace_tsf(__entry->tsf_t),
|
2018-03-28 12:42:18 +03:00
|
|
|
__print_hex(__entry->tsf, sizeof(__entry->tsf))
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2021-02-09 08:24:34 +02:00
|
|
|
TRACE_EVENT(ufshcd_exception_event,
|
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_PROTO(struct ufs_hba *hba, u16 status),
|
2021-02-09 08:24:34 +02:00
|
|
|
|
2025-02-14 16:29:36 +08:00
|
|
|
TP_ARGS(hba, status),
|
2021-02-09 08:24:34 +02:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2025-02-14 16:29:36 +08:00
|
|
|
__field(struct ufs_hba *, hba)
|
2021-02-09 08:24:34 +02:00
|
|
|
__field(u16, status)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2025-02-14 16:29:36 +08:00
|
|
|
__entry->hba = hba;
|
2021-02-09 08:24:34 +02:00
|
|
|
__entry->status = status;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("%s: status 0x%x",
|
2025-02-14 16:29:36 +08:00
|
|
|
dev_name(__entry->hba->dev), __entry->status
|
2021-02-09 08:24:34 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2016-12-22 18:39:51 -08:00
|
|
|
#endif /* if !defined(_TRACE_UFS_H) || defined(TRACE_HEADER_MULTI_READ) */
|
|
|
|
|
2024-08-21 08:54:11 +03:00
|
|
|
#undef TRACE_INCLUDE_PATH
|
|
|
|
#define TRACE_INCLUDE_PATH ../../drivers/ufs/core
|
|
|
|
#undef TRACE_INCLUDE_FILE
|
|
|
|
#define TRACE_INCLUDE_FILE ufs_trace
|
|
|
|
|
2016-12-22 18:39:51 -08:00
|
|
|
/* This part must be outside protection */
|
|
|
|
#include <trace/define_trace.h>
|