^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define TRACE_SYSTEM ufs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #if !defined(_TRACE_UFS_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #define _TRACE_UFS_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define str_opcode(opcode) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) __print_symbolic(opcode, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) { WRITE_16, "WRITE_16" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) { WRITE_10, "WRITE_10" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) { READ_16, "READ_16" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) { READ_10, "READ_10" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) { SYNCHRONIZE_CACHE, "SYNC" }, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) { UNMAP, "UNMAP" })
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define UFS_LINK_STATES \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) EM(UIC_LINK_OFF_STATE) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) EM(UIC_LINK_ACTIVE_STATE) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) EMe(UIC_LINK_HIBERN8_STATE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define UFS_PWR_MODES \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) EM(UFS_ACTIVE_PWR_MODE) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) EM(UFS_SLEEP_PWR_MODE) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) EMe(UFS_POWERDOWN_PWR_MODE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define UFSCHD_CLK_GATING_STATES \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) EM(CLKS_OFF) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) EM(CLKS_ON) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) EM(REQ_CLKS_OFF) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) EMe(REQ_CLKS_ON)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) /* Enums require being exported to userspace, for user tool parsing */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #undef EM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #undef EMe
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #define EM(a) TRACE_DEFINE_ENUM(a);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #define EMe(a) TRACE_DEFINE_ENUM(a);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) UFS_LINK_STATES;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) UFS_PWR_MODES;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) UFSCHD_CLK_GATING_STATES;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) * Now redefine the EM() and EMe() macros to map the enums to the strings
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * that will be printed in the output.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #undef EM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #undef EMe
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #define EM(a) { a, #a },
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define EMe(a) { a, #a }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) TRACE_EVENT(ufshcd_clk_gating,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) TP_PROTO(const char *dev_name, int state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) TP_ARGS(dev_name, state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) __string(dev_name, dev_name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) __field(int, state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) __assign_str(dev_name, dev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) __entry->state = state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) TP_printk("%s: gating state changed to %s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) __get_str(dev_name),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) __print_symbolic(__entry->state, UFSCHD_CLK_GATING_STATES))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) TRACE_EVENT(ufshcd_clk_scaling,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) TP_PROTO(const char *dev_name, const char *state, const char *clk,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) u32 prev_state, u32 curr_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) TP_ARGS(dev_name, state, clk, prev_state, curr_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) __string(dev_name, dev_name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) __string(state, state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) __string(clk, clk)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) __field(u32, prev_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) __field(u32, curr_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) __assign_str(dev_name, dev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) __assign_str(state, state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) __assign_str(clk, clk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) __entry->prev_state = prev_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) __entry->curr_state = curr_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) TP_printk("%s: %s %s from %u to %u Hz",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) __get_str(dev_name), __get_str(state), __get_str(clk),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) __entry->prev_state, __entry->curr_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) TRACE_EVENT(ufshcd_auto_bkops_state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) TP_PROTO(const char *dev_name, const char *state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) TP_ARGS(dev_name, state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) __string(dev_name, dev_name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) __string(state, state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) __assign_str(dev_name, dev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) __assign_str(state, state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) TP_printk("%s: auto bkops - %s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) __get_str(dev_name), __get_str(state))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) DECLARE_EVENT_CLASS(ufshcd_profiling_template,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) TP_PROTO(const char *dev_name, const char *profile_info, s64 time_us,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) TP_ARGS(dev_name, profile_info, time_us, err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) __string(dev_name, dev_name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) __string(profile_info, profile_info)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) __field(s64, time_us)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) __field(int, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) __assign_str(dev_name, dev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) __assign_str(profile_info, profile_info);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) __entry->time_us = time_us;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) __entry->err = err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) TP_printk("%s: %s: took %lld usecs, err %d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) __get_str(dev_name), __get_str(profile_info),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) __entry->time_us, __entry->err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) DEFINE_EVENT(ufshcd_profiling_template, ufshcd_profile_hibern8,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) TP_PROTO(const char *dev_name, const char *profile_info, s64 time_us,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) TP_ARGS(dev_name, profile_info, time_us, err));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) DEFINE_EVENT(ufshcd_profiling_template, ufshcd_profile_clk_gating,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) TP_PROTO(const char *dev_name, const char *profile_info, s64 time_us,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) TP_ARGS(dev_name, profile_info, time_us, err));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) DEFINE_EVENT(ufshcd_profiling_template, ufshcd_profile_clk_scaling,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) TP_PROTO(const char *dev_name, const char *profile_info, s64 time_us,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) int err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) TP_ARGS(dev_name, profile_info, time_us, err));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) DECLARE_EVENT_CLASS(ufshcd_template,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) TP_PROTO(const char *dev_name, int err, s64 usecs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) int dev_state, int link_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) TP_ARGS(dev_name, err, usecs, dev_state, link_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) __field(s64, usecs)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) __field(int, err)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) __string(dev_name, dev_name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) __field(int, dev_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) __field(int, link_state)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) __entry->usecs = usecs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) __entry->err = err;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) __assign_str(dev_name, dev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) __entry->dev_state = dev_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) __entry->link_state = link_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) TP_printk(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) "%s: took %lld usecs, dev_state: %s, link_state: %s, err %d",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) __get_str(dev_name),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) __entry->usecs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) __print_symbolic(__entry->dev_state, UFS_PWR_MODES),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) __print_symbolic(__entry->link_state, UFS_LINK_STATES),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) __entry->err
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) DEFINE_EVENT(ufshcd_template, ufshcd_system_suspend,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) TP_PROTO(const char *dev_name, int err, s64 usecs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) int dev_state, int link_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) TP_ARGS(dev_name, err, usecs, dev_state, link_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) DEFINE_EVENT(ufshcd_template, ufshcd_system_resume,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) TP_PROTO(const char *dev_name, int err, s64 usecs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) int dev_state, int link_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) TP_ARGS(dev_name, err, usecs, dev_state, link_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) DEFINE_EVENT(ufshcd_template, ufshcd_runtime_suspend,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) TP_PROTO(const char *dev_name, int err, s64 usecs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) int dev_state, int link_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) TP_ARGS(dev_name, err, usecs, dev_state, link_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) DEFINE_EVENT(ufshcd_template, ufshcd_runtime_resume,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) TP_PROTO(const char *dev_name, int err, s64 usecs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) int dev_state, int link_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) TP_ARGS(dev_name, err, usecs, dev_state, link_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) DEFINE_EVENT(ufshcd_template, ufshcd_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) TP_PROTO(const char *dev_name, int err, s64 usecs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) int dev_state, int link_state),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) TP_ARGS(dev_name, err, usecs, dev_state, link_state));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) TRACE_EVENT(ufshcd_command,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) TP_PROTO(const char *dev_name, const char *str, unsigned int tag,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) u32 doorbell, int transfer_len, u32 intr, u64 lba,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) u8 opcode, u8 group_id),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) TP_ARGS(dev_name, str, tag, doorbell, transfer_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) intr, lba, opcode, group_id),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) __string(dev_name, dev_name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) __string(str, str)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) __field(unsigned int, tag)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) __field(u32, doorbell)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) __field(int, transfer_len)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) __field(u32, intr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) __field(u64, lba)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) __field(u8, opcode)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) __field(u8, group_id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) __assign_str(dev_name, dev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) __assign_str(str, str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) __entry->tag = tag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) __entry->doorbell = doorbell;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) __entry->transfer_len = transfer_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) __entry->intr = intr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) __entry->lba = lba;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) __entry->opcode = opcode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) __entry->group_id = group_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) TP_printk(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) "%s: %s: tag: %u, DB: 0x%x, size: %d, IS: %u, LBA: %llu, opcode: 0x%x (%s), group_id: 0x%x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) __get_str(str), __get_str(dev_name), __entry->tag,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) __entry->doorbell, __entry->transfer_len,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) __entry->intr, __entry->lba, (u32)__entry->opcode,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) str_opcode(__entry->opcode), (u32)__entry->group_id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) TRACE_EVENT(ufshcd_uic_command,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) TP_PROTO(const char *dev_name, const char *str, u32 cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) u32 arg1, u32 arg2, u32 arg3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) TP_ARGS(dev_name, str, cmd, arg1, arg2, arg3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) __string(dev_name, dev_name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) __string(str, str)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) __field(u32, cmd)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) __field(u32, arg1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) __field(u32, arg2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) __field(u32, arg3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) __assign_str(dev_name, dev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) __assign_str(str, str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) __entry->cmd = cmd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) __entry->arg1 = arg1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) __entry->arg2 = arg2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) __entry->arg3 = arg3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) TP_printk(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) "%s: %s: cmd: 0x%x, arg1: 0x%x, arg2: 0x%x, arg3: 0x%x",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) __get_str(str), __get_str(dev_name), __entry->cmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) __entry->arg1, __entry->arg2, __entry->arg3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) TRACE_EVENT(ufshcd_upiu,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) TP_PROTO(const char *dev_name, const char *str, void *hdr, void *tsf),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) TP_ARGS(dev_name, str, hdr, tsf),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) TP_STRUCT__entry(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) __string(dev_name, dev_name)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) __string(str, str)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) __array(unsigned char, hdr, 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) __array(unsigned char, tsf, 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) TP_fast_assign(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) __assign_str(dev_name, dev_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) __assign_str(str, str);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) memcpy(__entry->hdr, hdr, sizeof(__entry->hdr));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) memcpy(__entry->tsf, tsf, sizeof(__entry->tsf));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) ),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) TP_printk(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) "%s: %s: HDR:%s, CDB:%s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) __get_str(str), __get_str(dev_name),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) __print_hex(__entry->hdr, sizeof(__entry->hdr)),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) __print_hex(__entry->tsf, sizeof(__entry->tsf))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) )
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) );
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) #endif /* if !defined(_TRACE_UFS_H) || defined(TRACE_HEADER_MULTI_READ) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) #include <trace/define_trace.h>