^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #undef TRACE_SYSTEM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define TRACE_SYSTEM ufshcd
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #define TRACE_INCLUDE_PATH trace/hooks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #if !defined(_TRACE_HOOK_UFSHCD_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define _TRACE_HOOK_UFSHCD_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <trace/hooks/vendor_hooks.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * Following tracepoints are not exported in tracefs and provide a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * mechanism for vendor modules to hook and extend functionality
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #ifdef __GENKSYMS__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct ufs_hba;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct ufshcd_lrb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct uic_command;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct request;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct scsi_device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* struct ufs_hba, struct ufshcd_lrb, struct uic_command */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <../drivers/scsi/ufs/ufshcd.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) /* struct request */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/blkdev.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /* struct scsi_device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #include <scsi/scsi_device.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #endif /* __GENKSYMS__ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) DECLARE_HOOK(android_vh_ufs_fill_prdt,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) TP_PROTO(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) unsigned int segments, int *err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) TP_ARGS(hba, lrbp, segments, err));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) DECLARE_RESTRICTED_HOOK(android_rvh_ufs_complete_init,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) TP_PROTO(struct ufs_hba *hba),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) TP_ARGS(hba), 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) DECLARE_RESTRICTED_HOOK(android_rvh_ufs_reprogram_all_keys,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) TP_PROTO(struct ufs_hba *hba, int *err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) TP_ARGS(hba, err), 1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) DECLARE_HOOK(android_vh_ufs_prepare_command,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) TP_PROTO(struct ufs_hba *hba, struct request *rq,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct ufshcd_lrb *lrbp, int *err),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) TP_ARGS(hba, rq, lrbp, err));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) DECLARE_HOOK(android_vh_ufs_update_sysfs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) TP_PROTO(struct ufs_hba *hba),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) TP_ARGS(hba));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) DECLARE_HOOK(android_vh_ufs_send_command,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) TP_PROTO(struct ufs_hba *hba, struct ufshcd_lrb *lrbp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) TP_ARGS(hba, lrbp));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) DECLARE_HOOK(android_vh_ufs_compl_command,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) TP_PROTO(struct ufs_hba *hba, struct ufshcd_lrb *lrbp),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) TP_ARGS(hba, lrbp));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) DECLARE_HOOK(android_vh_ufs_send_uic_command,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) TP_PROTO(struct ufs_hba *hba, struct uic_command *ucmd,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) const char *str),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) TP_ARGS(hba, ucmd, str));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) DECLARE_HOOK(android_vh_ufs_send_tm_command,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) TP_PROTO(struct ufs_hba *hba, int tag, const char *str),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) TP_ARGS(hba, tag, str));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) DECLARE_HOOK(android_vh_ufs_check_int_errors,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) TP_PROTO(struct ufs_hba *hba, bool queue_eh_work),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) TP_ARGS(hba, queue_eh_work));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) DECLARE_HOOK(android_vh_ufs_update_sdev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) TP_PROTO(struct scsi_device *sdev),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) TP_ARGS(sdev));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) DECLARE_HOOK(android_vh_ufs_clock_scaling,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) TP_PROTO(struct ufs_hba *hba, bool *force_out, bool *force_scaling, bool *scale_up),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) TP_ARGS(hba, force_out, force_scaling, scale_up));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) #endif /* _TRACE_HOOK_UFSHCD_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) #include <trace/define_trace.h>