From 10fc8b258438ad24dc32d3c2a29329e1e23e62ba Mon Sep 17 00:00:00 2001 From: Todd Kjos Date: Tue, 26 Jan 2021 13:57:52 -0800 Subject: [PATCH] ANDROID: simplify vendor hook definitions Remove macro versions of hooks that are no longer needed. The macro versions are still needed when the _rcuidle version of the hook is used (as in include/trace/hooks/debug.h). Bug: 177416721 Signed-off-by: Todd Kjos Change-Id: I4b50447e9a922ed038663d1459d7622dab30ffbb --- include/trace/hooks/binder.h | 10 +++------- include/trace/hooks/cpu.h | 2 ++ include/trace/hooks/cpufreq.h | 8 +------- include/trace/hooks/cpuidle.h | 7 ++----- include/trace/hooks/dtask.h | 12 ++---------- include/trace/hooks/epoch.h | 8 +------- include/trace/hooks/fpsimd.h | 5 +---- include/trace/hooks/ftrace_dump.h | 12 +----------- include/trace/hooks/futex.h | 7 +++---- include/trace/hooks/gic.h | 8 +------- include/trace/hooks/gic_v3.h | 8 +++----- include/trace/hooks/mm.h | 10 +--------- include/trace/hooks/mpam.h | 7 +++---- include/trace/hooks/pm_domain.h | 5 +---- include/trace/hooks/preemptirq.h | 11 +---------- include/trace/hooks/printk.h | 8 +------- include/trace/hooks/rwsem.h | 10 +++------- include/trace/hooks/sysrqcrash.h | 6 ++---- include/trace/hooks/topology.h | 8 +------- include/trace/hooks/wqlockup.h | 6 ++---- 20 files changed, 35 insertions(+), 123 deletions(-) diff --git a/include/trace/hooks/binder.h b/include/trace/hooks/binder.h index 012b50bf7a0d..92f2eb058276 100644 --- a/include/trace/hooks/binder.h +++ b/include/trace/hooks/binder.h @@ -11,7 +11,6 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) struct binder_transaction; struct task_struct; DECLARE_HOOK(android_vh_binder_transaction_init, @@ -26,12 +25,9 @@ DECLARE_HOOK(android_vh_binder_restore_priority, DECLARE_HOOK(android_vh_binder_wakeup_ilocked, TP_PROTO(struct task_struct *task), TP_ARGS(task)); -#else -#define trace_android_vh_binder_transaction_init(t) -#define trace_android_vh_binder_set_priority(t, task) -#define trace_android_vh_binder_restore_priority(t, task) -#define trace_android_vh_binder_wakeup_ilocked(task) -#endif + +/* macro versions of hooks are no longer required */ + #endif /* _TRACE_HOOK_BINDER_H */ /* This part must be outside protection */ #include diff --git a/include/trace/hooks/cpu.h b/include/trace/hooks/cpu.h index eccab9e57fd9..645702996b00 100644 --- a/include/trace/hooks/cpu.h +++ b/include/trace/hooks/cpu.h @@ -18,6 +18,8 @@ DECLARE_HOOK(android_vh_cpu_down, TP_PROTO(void *unused), TP_ARGS(unused)); +/* macro versions of hooks are no longer required */ + #endif /* _TRACE_HOOK_CPU_H */ /* This part must be outside protection */ #include diff --git a/include/trace/hooks/cpufreq.h b/include/trace/hooks/cpufreq.h index 79e6ddf31cb8..819b06ee138b 100644 --- a/include/trace/hooks/cpufreq.h +++ b/include/trace/hooks/cpufreq.h @@ -10,8 +10,6 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - DECLARE_HOOK(android_vh_show_max_freq, TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq), TP_ARGS(policy, max_freq)); @@ -20,12 +18,8 @@ DECLARE_HOOK(android_vh_freq_table_limits, TP_PROTO(struct cpufreq_policy *policy, unsigned int min_freq, unsigned int max_freq), TP_ARGS(policy, min_freq, max_freq)); -#else -#define trace_android_vh_show_max_freq(policy, max_freq) -#define trace_android_vh_freq_table_limits(policy, min_freq, max_freq) - -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_CPUFREQ_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/cpuidle.h b/include/trace/hooks/cpuidle.h index 28b39f490ef8..6d1f4bf7f1ed 100644 --- a/include/trace/hooks/cpuidle.h +++ b/include/trace/hooks/cpuidle.h @@ -10,7 +10,6 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) struct cpuidle_device; DECLARE_HOOK(android_vh_cpu_idle_enter, @@ -19,10 +18,8 @@ DECLARE_HOOK(android_vh_cpu_idle_enter, DECLARE_HOOK(android_vh_cpu_idle_exit, TP_PROTO(int state, struct cpuidle_device *dev), TP_ARGS(state, dev)) -#else -#define trace_android_vh_cpu_idle_enter(state, dev) -#define trace_android_vh_cpu_idle_exit(state, dev) -#endif + +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_CPUIDLE_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/dtask.h b/include/trace/hooks/dtask.h index f4fafbfedc23..422cb0192407 100644 --- a/include/trace/hooks/dtask.h +++ b/include/trace/hooks/dtask.h @@ -11,7 +11,6 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) struct mutex; DECLARE_HOOK(android_vh_mutex_wait_start, TP_PROTO(struct mutex *lock), @@ -38,15 +37,8 @@ struct task_struct; DECLARE_HOOK(android_vh_sched_show_task, TP_PROTO(struct task_struct *task), TP_ARGS(task)); -#else -#define trace_android_vh_mutex_wait_start(lock) -#define trace_android_vh_mutex_wait_finish(lock) -#define trace_android_vh_rwsem_read_wait_start(sem) -#define trace_android_vh_rwsem_read_wait_finish(sem) -#define trace_android_vh_rwsem_write_wait_start(sem) -#define trace_android_vh_rwsem_write_wait_finish(sem) -#define trace_android_vh_sched_show_task(task) -#endif + +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_DTASK_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/epoch.h b/include/trace/hooks/epoch.h index 7da3139dfeb0..f1c5342c822e 100644 --- a/include/trace/hooks/epoch.h +++ b/include/trace/hooks/epoch.h @@ -10,8 +10,6 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - DECLARE_HOOK(android_vh_show_suspend_epoch_val, TP_PROTO(u64 suspend_ns, u64 suspend_cycles), TP_ARGS(suspend_ns, suspend_cycles)); @@ -19,12 +17,8 @@ DECLARE_HOOK(android_vh_show_suspend_epoch_val, DECLARE_HOOK(android_vh_show_resume_epoch_val, TP_PROTO(u64 resume_cycles), TP_ARGS(resume_cycles)); -#else -#define trace_android_vh_show_suspend_epoch_val(suspend_ns, suspend_cycles) -#define trace_android_vh_show_resume_epoch_val(resume_cycles) - -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_EPOCH_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/fpsimd.h b/include/trace/hooks/fpsimd.h index 73ad2c0009c3..a4a3ce228fff 100644 --- a/include/trace/hooks/fpsimd.h +++ b/include/trace/hooks/fpsimd.h @@ -10,16 +10,13 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) struct task_struct; DECLARE_HOOK(android_vh_is_fpsimd_save, TP_PROTO(struct task_struct *prev, struct task_struct *next), TP_ARGS(prev, next)) -#else -#define trace_android_vh_is_fpsimd_save(prev, next) -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_FPSIMD_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/ftrace_dump.h b/include/trace/hooks/ftrace_dump.h index ce33479cb17b..ed3be8a0d74b 100644 --- a/include/trace/hooks/ftrace_dump.h +++ b/include/trace/hooks/ftrace_dump.h @@ -13,8 +13,6 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - DECLARE_HOOK(android_vh_ftrace_oops_enter, TP_PROTO(bool *ftrace_check), TP_ARGS(ftrace_check)); @@ -35,15 +33,7 @@ DECLARE_HOOK(android_vh_ftrace_dump_buffer, TP_PROTO(struct trace_seq *trace_buf, bool *dump_printk), TP_ARGS(trace_buf, dump_printk)); -#else - -#define trace_android_vh_ftrace_oops_enter(ftrace_check) -#define trace_android_vh_ftrace_oops_exit(ftrace_check) -#define trace_android_vh_ftrace_size_check(size, ftrace_check) -#define trace_android_vh_ftrace_format_check(ftrace_check) -#define trace_android_vh_ftrace_dump_buffer(trace_buf, dump_printk) - -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_FTRACE_DUMP_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/futex.h b/include/trace/hooks/futex.h index cbf6abb66a57..0692dd68d93c 100644 --- a/include/trace/hooks/futex.h +++ b/include/trace/hooks/futex.h @@ -12,15 +12,14 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) DECLARE_HOOK(android_vh_alter_futex_plist_add, TP_PROTO(struct plist_node *node, struct plist_head *head, bool *already_on_hb), TP_ARGS(node, head, already_on_hb)); -#else -#define trace_android_vh_alter_futex_plist_add(node, head, already_on_hb) -#endif + +/* macro versions of hooks are no longer required */ + #endif /* _TRACE_HOOK_FUTEX_H */ /* This part must be outside protection */ #include diff --git a/include/trace/hooks/gic.h b/include/trace/hooks/gic.h index bdc923552809..6d51859e8f16 100644 --- a/include/trace/hooks/gic.h +++ b/include/trace/hooks/gic.h @@ -12,17 +12,11 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - DECLARE_HOOK(android_vh_gic_resume, TP_PROTO(struct irq_domain *domain, void __iomem *dist_base), TP_ARGS(domain, dist_base)); -#else - -#define trace_android_vh_gic_resume(domain, dist_base) - -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_GIC_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/gic_v3.h b/include/trace/hooks/gic_v3.h index 8cf67e51f79e..cd2eb8df37d4 100644 --- a/include/trace/hooks/gic_v3.h +++ b/include/trace/hooks/gic_v3.h @@ -10,7 +10,6 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) struct irq_data; struct cpumask; DECLARE_HOOK(android_vh_gic_v3_affinity_init, @@ -20,10 +19,9 @@ DECLARE_HOOK(android_vh_gic_v3_set_affinity, TP_PROTO(struct irq_data *d, const struct cpumask *mask_val, u64 *affinity), TP_ARGS(d, mask_val, affinity)); -#else -#define trace_android_vh_gic_v3_affinity_init(irq, offset, affinity) -#define trace_android_vh_gic_v3_set_affinity(d, mask_val, affinity) -#endif + +/* macro versions of hooks are no longer required */ + #endif /* _TRACE_HOOK_GIC_V3_H */ /* This part must be outside protection */ #include diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index b7fb70f6d8d7..8784aa0710b6 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -12,8 +12,6 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags, TP_PROTO(gfp_t *flags), TP_ARGS(flags), 1); @@ -24,13 +22,7 @@ DECLARE_RESTRICTED_HOOK(android_rvh_set_readahead_gfp_mask, TP_PROTO(gfp_t *flags), TP_ARGS(flags), 1); -#else - -#define trace_android_rvh_set_skip_swapcache_flags(gfp_flags) -#define trace_android_rvh_set_gfp_zone_flags(gfp_flags) -#define trace_android_rvh_set_readahead_gfp_mask(gfp_flags) - -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_MM_H */ diff --git a/include/trace/hooks/mpam.h b/include/trace/hooks/mpam.h index 1a89dae9b1fb..8479fe7c2356 100644 --- a/include/trace/hooks/mpam.h +++ b/include/trace/hooks/mpam.h @@ -11,14 +11,13 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) struct task_struct; DECLARE_HOOK(android_vh_mpam_set, TP_PROTO(struct task_struct *prev, struct task_struct *next), TP_ARGS(prev, next)); -#else -#define trace_android_vh_mpam_set(prev, next) -#endif + +/* macro versions of hooks are no longer required */ + #endif /* _TRACE_HOOK_MPAM_H */ /* This part must be outside protection */ #include diff --git a/include/trace/hooks/pm_domain.h b/include/trace/hooks/pm_domain.h index ad856f980bd3..548e350e8090 100644 --- a/include/trace/hooks/pm_domain.h +++ b/include/trace/hooks/pm_domain.h @@ -11,15 +11,12 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) struct generic_pm_domain; DECLARE_HOOK(android_vh_allow_domain_state, TP_PROTO(struct generic_pm_domain *genpd, uint32_t idx, bool *allow), TP_ARGS(genpd, idx, allow)) -#else -#define trace_android_vh_allow_domain_state(genpd, idx, allow) -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_PM_DOMAIN_H */ diff --git a/include/trace/hooks/preemptirq.h b/include/trace/hooks/preemptirq.h index be96261280a6..b4d32c473f3a 100644 --- a/include/trace/hooks/preemptirq.h +++ b/include/trace/hooks/preemptirq.h @@ -11,8 +11,6 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - DECLARE_RESTRICTED_HOOK(android_rvh_preempt_disable, TP_PROTO(unsigned long ip, unsigned long parent_ip), TP_ARGS(ip, parent_ip), 1); @@ -29,14 +27,7 @@ DECLARE_RESTRICTED_HOOK(android_rvh_irqs_enable, TP_PROTO(unsigned long ip, unsigned long parent_ip), TP_ARGS(ip, parent_ip), 1); -#else - -#define trace_android_rvh_preempt_disable(ip, parent_ip) -#define trace_android_rvh_preempt_enable(ip, parent_ip) -#define trace_android_rvh_irqs_disable(ip, parent_ip) -#define trace_android_rvh_irqs_enable(ip, parent_ip) - -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_PREEMPTIRQ_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/printk.h b/include/trace/hooks/printk.h index 83f8ad5e710d..e4df6e4bf7a8 100644 --- a/include/trace/hooks/printk.h +++ b/include/trace/hooks/printk.h @@ -10,17 +10,11 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - DECLARE_HOOK(android_vh_printk_hotplug, TP_PROTO(int *flag), TP_ARGS(flag)); -#else - -#define trace_android_vh_printk_hotplug(flag) - -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_PRINTK_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/rwsem.h b/include/trace/hooks/rwsem.h index 7c7a1f786369..4ec420d5245b 100644 --- a/include/trace/hooks/rwsem.h +++ b/include/trace/hooks/rwsem.h @@ -10,7 +10,6 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) struct rw_semaphore; struct rwsem_waiter; DECLARE_HOOK(android_vh_rwsem_init, @@ -27,12 +26,9 @@ DECLARE_HOOK(android_vh_alter_rwsem_list_add, struct rw_semaphore *sem, bool *already_on_list), TP_ARGS(waiter, sem, already_on_list)); -#else -#define trace_android_vh_rwsem_init(sem) -#define trace_android_vh_rwsem_wake(sem) -#define trace_android_vh_rwsem_write_finished(sem) -#define trace_android_vh_alter_rwsem_list_add(waiter, sem, already_on_list) -#endif + +/* macro versions of hooks are no longer required */ + #endif /* _TRACE_HOOK_RWSEM_H */ /* This part must be outside protection */ #include diff --git a/include/trace/hooks/sysrqcrash.h b/include/trace/hooks/sysrqcrash.h index e5d9102ba4e1..d163f898a9f6 100644 --- a/include/trace/hooks/sysrqcrash.h +++ b/include/trace/hooks/sysrqcrash.h @@ -11,13 +11,11 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) DECLARE_HOOK(android_vh_sysrq_crash, TP_PROTO(void *data), TP_ARGS(data)); -#else -#define trace_android_vh_sysrq_crash(data) -#endif + +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_SYSRQCRASH_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/topology.h b/include/trace/hooks/topology.h index d67d8491eb17..2c3fcab6fd01 100644 --- a/include/trace/hooks/topology.h +++ b/include/trace/hooks/topology.h @@ -11,18 +11,12 @@ #include #include -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) - DECLARE_HOOK(android_vh_arch_set_freq_scale, TP_PROTO(const struct cpumask *cpus, unsigned long freq, unsigned long max, unsigned long *scale), TP_ARGS(cpus, freq, max, scale)); -#else - -#define trace_android_vh_arch_set_freq_scale(cpus, freq, max, scale) - -#endif +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_TOPOLOGY_H */ /* This part must be outside protection */ diff --git a/include/trace/hooks/wqlockup.h b/include/trace/hooks/wqlockup.h index de70eacaa8c8..21e23ad6b9d9 100644 --- a/include/trace/hooks/wqlockup.h +++ b/include/trace/hooks/wqlockup.h @@ -11,13 +11,11 @@ * Following tracepoints are not exported in tracefs and provide a * mechanism for vendor modules to hook and extend functionality */ -#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS) DECLARE_HOOK(android_vh_wq_lockup_pool, TP_PROTO(int cpu, unsigned long pool_ts), TP_ARGS(cpu, pool_ts)); -#else -#define trace_android_vh_wq_lockup_pool(cpu, pool_ts) -#endif + +/* macro versions of hooks are no longer required */ #endif /* _TRACE_HOOK_WQLOCKUP_H */ /* This part must be outside protection */