diff options
author | Stanley Chu <stanley.chu@mediatek.com> | 2020-06-15 09:22:35 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-06-16 05:35:06 +0200 |
commit | aa5c697988b4c7e1077de1e2eb2298114d531736 (patch) | |
tree | 2f7317121be07317385190085de9bd7975f369fb /include/trace | |
parent | scsi: ufs: Remove unused field in struct uic_command (diff) | |
download | linux-aa5c697988b4c7e1077de1e2eb2298114d531736.tar.xz linux-aa5c697988b4c7e1077de1e2eb2298114d531736.zip |
scsi: ufs: Add trace event for UIC commands
Use the ftrace infrastructure to conditionally trace UFS UIC command
events.
New trace event "ufshcd_uic_command" is created, which samples the
following UFS UIC command data:
- Device name
- Optional identification string
- UIC command opcode
- UIC command argument1
- UIC command argument2
- UIC command argement3
Usage:
echo 1 > /sys/kernel/debug/tracing/events/ufs/enable
cat /sys/kernel/debug/tracing/trace_pipe
Link: https://lore.kernel.org/r/20200615072235.23042-3-stanley.chu@mediatek.com
Acked-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/ufs.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h index 5f300739240d..84841b3a7ffd 100644 --- a/include/trace/events/ufs.h +++ b/include/trace/events/ufs.h @@ -249,6 +249,37 @@ TRACE_EVENT(ufshcd_command, ) ); +TRACE_EVENT(ufshcd_uic_command, + TP_PROTO(const char *dev_name, const char *str, u32 cmd, + u32 arg1, u32 arg2, u32 arg3), + + TP_ARGS(dev_name, str, cmd, arg1, arg2, arg3), + + TP_STRUCT__entry( + __string(dev_name, dev_name) + __string(str, str) + __field(u32, cmd) + __field(u32, arg1) + __field(u32, arg2) + __field(u32, arg3) + ), + + TP_fast_assign( + __assign_str(dev_name, dev_name); + __assign_str(str, str); + __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", + __get_str(str), __get_str(dev_name), __entry->cmd, + __entry->arg1, __entry->arg2, __entry->arg3 + ) +); + TRACE_EVENT(ufshcd_upiu, TP_PROTO(const char *dev_name, const char *str, void *hdr, void *tsf), |