^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 power
^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)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #if !defined(_TRACE_HOOK_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define _TRACE_HOOK_POWER_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/tracepoint.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <trace/hooks/vendor_hooks.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * Following tracepoints are not exported in tracefs and provide a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * mechanism for vendor modules to hook and extend functionality
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #ifdef __GENKSYMS__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) enum freq_qos_req_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) struct freq_constraints;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) struct freq_qos_request;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct task_struct;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* enum freq_qos_req_type, struct freq_constraints, struct freq_qos_request */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #include <linux/pm_qos.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) /* struct task_struct */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #include <linux/sched.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #endif /* __GENKSYMS__ */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) DECLARE_HOOK(android_vh_try_to_freeze_todo,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) TP_PROTO(unsigned int todo, unsigned int elapsed_msecs, bool wq_busy),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) TP_ARGS(todo, elapsed_msecs, wq_busy));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) DECLARE_HOOK(android_vh_try_to_freeze_todo_unfrozen,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) TP_PROTO(struct task_struct *p),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) TP_ARGS(p));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) DECLARE_HOOK(android_vh_freq_qos_add_request,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) TP_PROTO(struct freq_constraints *qos, struct freq_qos_request *req,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) enum freq_qos_req_type type, int value, int ret),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) TP_ARGS(qos, req, type, value, ret));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) DECLARE_HOOK(android_vh_freq_qos_update_request,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) TP_PROTO(struct freq_qos_request *req, int value),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) TP_ARGS(req, value));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) DECLARE_HOOK(android_vh_freq_qos_remove_request,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) TP_PROTO(struct freq_qos_request *req),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) TP_ARGS(req));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) /* macro versions of hooks are no longer required */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) #endif /* _TRACE_HOOK_POWER_H */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) /* This part must be outside protection */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) #include <trace/define_trace.h>