b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #undef TRACE_SYSTEM |
| 3 | #define TRACE_SYSTEM sched |
| 4 | #define TRACE_INCLUDE_PATH trace/hooks |
| 5 | #if !defined(_TRACE_HOOK_SCHED_H) || defined(TRACE_HEADER_MULTI_READ) |
| 6 | #define _TRACE_HOOK_SCHED_H |
| 7 | #include <linux/tracepoint.h> |
| 8 | #include <trace/hooks/vendor_hooks.h> |
| 9 | /* |
| 10 | * Following tracepoints are not exported in tracefs and provide a |
| 11 | * mechanism for vendor modules to hook and extend functionality |
| 12 | */ |
| 13 | struct task_struct; |
| 14 | DECLARE_RESTRICTED_HOOK(android_rvh_select_task_rq_fair, |
| 15 | TP_PROTO(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags, int *new_cpu), |
| 16 | TP_ARGS(p, prev_cpu, sd_flag, wake_flags, new_cpu), 1); |
| 17 | |
| 18 | DECLARE_RESTRICTED_HOOK(android_rvh_select_task_rq_rt, |
| 19 | TP_PROTO(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags, int *new_cpu), |
| 20 | TP_ARGS(p, prev_cpu, sd_flag, wake_flags, new_cpu), 1); |
| 21 | |
| 22 | DECLARE_RESTRICTED_HOOK(android_rvh_select_fallback_rq, |
| 23 | TP_PROTO(int cpu, struct task_struct *p, int *new_cpu), |
| 24 | TP_ARGS(cpu, p, new_cpu), 1); |
| 25 | |
| 26 | struct rq; |
| 27 | DECLARE_HOOK(android_vh_scheduler_tick, |
| 28 | TP_PROTO(struct rq *rq), |
| 29 | TP_ARGS(rq)); |
| 30 | |
| 31 | DECLARE_RESTRICTED_HOOK(android_rvh_enqueue_task, |
| 32 | TP_PROTO(struct rq *rq, struct task_struct *p), |
| 33 | TP_ARGS(rq, p), 1); |
| 34 | |
| 35 | DECLARE_RESTRICTED_HOOK(android_rvh_dequeue_task, |
| 36 | TP_PROTO(struct rq *rq, struct task_struct *p), |
| 37 | TP_ARGS(rq, p), 1); |
| 38 | |
| 39 | DECLARE_RESTRICTED_HOOK(android_rvh_can_migrate_task, |
| 40 | TP_PROTO(struct task_struct *p, int dst_cpu, int *can_migrate), |
| 41 | TP_ARGS(p, dst_cpu, can_migrate), 1); |
| 42 | |
| 43 | DECLARE_RESTRICTED_HOOK(android_rvh_find_lowest_rq, |
| 44 | TP_PROTO(struct task_struct *p, struct cpumask *local_cpu_mask, |
| 45 | int *lowest_cpu), |
| 46 | TP_ARGS(p, local_cpu_mask, lowest_cpu), 1); |
| 47 | |
| 48 | DECLARE_RESTRICTED_HOOK(android_rvh_prepare_prio_fork, |
| 49 | TP_PROTO(struct task_struct *p), |
| 50 | TP_ARGS(p), 1); |
| 51 | |
| 52 | DECLARE_RESTRICTED_HOOK(android_rvh_finish_prio_fork, |
| 53 | TP_PROTO(struct task_struct *p), |
| 54 | TP_ARGS(p), 1); |
| 55 | |
| 56 | DECLARE_RESTRICTED_HOOK(android_rvh_rtmutex_prepare_setprio, |
| 57 | TP_PROTO(struct task_struct *p, struct task_struct *pi_task), |
| 58 | TP_ARGS(p, pi_task), 1); |
| 59 | |
| 60 | DECLARE_RESTRICTED_HOOK(android_rvh_set_user_nice, |
| 61 | TP_PROTO(struct task_struct *p, long *nice, bool *allowed), |
| 62 | TP_ARGS(p, nice, allowed), 1); |
| 63 | |
| 64 | DECLARE_RESTRICTED_HOOK(android_rvh_setscheduler, |
| 65 | TP_PROTO(struct task_struct *p), |
| 66 | TP_ARGS(p), 1); |
| 67 | |
| 68 | struct sched_group; |
| 69 | DECLARE_RESTRICTED_HOOK(android_rvh_find_busiest_group, |
| 70 | TP_PROTO(struct sched_group *busiest, struct rq *dst_rq, int *out_balance), |
| 71 | TP_ARGS(busiest, dst_rq, out_balance), 1); |
| 72 | |
| 73 | DECLARE_HOOK(android_vh_map_util_freq, |
| 74 | TP_PROTO(unsigned long util, unsigned long freq, |
| 75 | unsigned long cap, unsigned long *next_freq), |
| 76 | TP_ARGS(util, freq, cap, next_freq)); |
| 77 | |
| 78 | struct em_perf_domain; |
| 79 | DECLARE_HOOK(android_vh_em_pd_energy, |
| 80 | TP_PROTO(struct em_perf_domain *pd, |
| 81 | unsigned long max_util, unsigned long sum_util, |
| 82 | unsigned long *energy), |
| 83 | TP_ARGS(pd, max_util, sum_util, energy)); |
| 84 | |
| 85 | /* macro versions of hooks are no longer required */ |
| 86 | |
| 87 | #endif /* _TRACE_HOOK_SCHED_H */ |
| 88 | /* This part must be outside protection */ |
| 89 | #include <trace/define_trace.h> |