1 // SPDX-License-Identifier: GPL-2.0-only 2 /* vendor_hook.c 3 * 4 * Copyright 2022 Google LLC 5 */ 6 #include <linux/sched/cputime.h> 7 #include "sched.h" 8 #include "pelt.h" 9 #include "smp.h" 10 11 #define CREATE_TRACE_POINTS 12 #include <trace/hooks/vendor_hooks.h> 13 #include <linux/tracepoint.h> 14 #include <trace/hooks/sched.h> 15 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_task_rq_fair); 16 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_task_rq_rt); 17 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_select_fallback_rq); 18 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_scheduler_tick); 19 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_enqueue_task); 20 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_task); 21 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_can_migrate_task); 22 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_lowest_rq); 23 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_prepare_prio_fork); 24 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_finish_prio_fork); 25 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_rtmutex_force_update); 26 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_rtmutex_prepare_setprio); 27 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_user_nice); 28 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_user_nice_locked); 29 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_setscheduler); 30 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_group); 31 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dump_throttled_rt_tasks); 32 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_jiffies_update); 33 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_newidle_balance); 34 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_nohz_balancer_kick); 35 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_rebalance_domains); 36 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_busiest_queue); 37 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_migrate_queued_task); 38 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpu_overutilized); 39 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_setaffinity); 40 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_cpus_allowed); 41 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_build_sched_domains); 42 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_tick); 43 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup_ignore); 44 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_replace_next_task_fair); 45 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_balance_rt); 46 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_pick_next_entity); 47 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_check_preempt_wakeup); 48 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_cpus_allowed_by_task); 49 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_task); 50 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_copy_process); 51 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_uclamp_eff_get); 52 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_after_enqueue_task); 53 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_after_dequeue_task); 54 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_enqueue_entity); 55 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_entity); 56 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_entity_tick); 57 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_enqueue_task_fair); 58 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_task_fair); 59 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_util_est_update); 60 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_setscheduler_uclamp); 61 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_task_cpu); 62 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_try_to_wake_up); 63 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_try_to_wake_up_success); 64 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_fork); 65 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_wake_up_new_task); 66 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_new_task_stats); 67 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_flush_task); 68 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_tick_entry); 69 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_schedule); 70 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_starting); 71 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_dying); 72 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_account_irq); 73 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_place_entity); 74 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_build_perf_domains); 75 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_util_fits_cpu); 76 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_cpu_capacity); 77 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_misfit_status); 78 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_rto_next_cpu); 79 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_is_cpu_allowed); 80 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_get_nohz_timer_target); 81 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_getaffinity); 82 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_do_sched_yield); 83 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_before_do_sched_yield); 84 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_fork_init); 85 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_ttwu_cond); 86 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_schedule_bug); 87 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_exec); 88 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_update_topology_flags_workfn); 89 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_thermal_stats); 90 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_stat_runtime_rt); 91 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_wake_up_sync); 92 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_wake_flags); 93 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_new_ilb); 94 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_energy_efficient_cpu); 95 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); 96 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_map_util_freq); 97 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_cpus_allowed_comm); 98 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_setaffinity_early); 99 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_process_tick_gran); 100 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_task_time); 101 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dup_task_struct); 102 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_irqtime_account_process_tick); 103 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_post_init_entity_util_avg); 104 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_effective_cpu_util); 105 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmput); 106 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_uclamp_validate); 107 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_sugov_sched_attr); 108 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_iowait); 109 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_attach_entity_load_avg); 110 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_detach_entity_load_avg); 111 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_load_sum); 112 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_load_avg); 113 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_remove_entity_load_avg); 114 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_blocked_fair); 115 EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_rt_rq_load_avg); 116 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_prio_inheritance); 117 EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_prio_restore); 118