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 <tkjos@google.com>
Change-Id: I4b50447e9a922ed038663d1459d7622dab30ffbb
This commit is contained in:
Todd Kjos 2021-01-26 13:57:52 -08:00 committed by Greg Kroah-Hartman
parent 8dd18a05ba
commit 9e0cf0e90d
17 changed files with 3 additions and 117 deletions

View File

@ -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,
@ -29,13 +28,6 @@ DECLARE_HOOK(android_vh_binder_wakeup_poll_threads_ilocked,
DECLARE_HOOK(android_vh_binder_wakeup_thread_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_poll_threads_ilocked(task)
#define trace_android_vh_binder_wakeup_thread_ilocked(task)
#endif
#endif /* _TRACE_HOOK_BINDER_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -10,8 +10,6 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#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,6 @@ 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
#endif /* _TRACE_HOOK_CPUFREQ_H */
/* This part must be outside protection */

View File

@ -10,7 +10,6 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#if defined(CONFIG_TRACEPOINTS) && defined(CONFIG_ANDROID_VENDOR_HOOKS)
struct cpuidle_device;
DECLARE_HOOK(android_vh_cpu_idle_enter,
@ -19,10 +18,6 @@ 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
#endif /* _TRACE_HOOK_CPUIDLE_H */
/* This part must be outside protection */

View File

@ -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,6 @@ 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
#endif /* _TRACE_HOOK_DTASK_H */
/* This part must be outside protection */

View File

@ -10,8 +10,6 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#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,6 @@ 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
#endif /* _TRACE_HOOK_EPOCH_H */
/* This part must be outside protection */

View File

@ -10,16 +10,11 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#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
#endif /* _TRACE_HOOK_FPSIMD_H */
/* This part must be outside protection */

View File

@ -12,15 +12,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_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
#endif /* _TRACE_HOOK_FUTEX_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -12,18 +12,10 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#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
#endif /* _TRACE_HOOK_GIC_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -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,7 @@ 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
#endif /* _TRACE_HOOK_GIC_V3_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -12,8 +12,6 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#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,14 +22,6 @@ 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
#endif /* _TRACE_HOOK_MM_H */
/* This part must be outside protection */

View File

@ -11,14 +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)
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
#endif /* _TRACE_HOOK_MPAM_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -11,8 +11,6 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#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,15 +27,6 @@ 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
#endif /* _TRACE_HOOK_PREEMPTIRQ_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -10,18 +10,10 @@
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
#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
#endif /* _TRACE_HOOK_PRINTK_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -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,7 @@ 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
#endif /* _TRACE_HOOK_RWSEM_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -11,13 +11,9 @@
* 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
#endif /* _TRACE_HOOK_SYSRQCRASH_H */
/* This part must be outside protection */

View File

@ -11,19 +11,11 @@
#include <trace/hooks/vendor_hooks.h>
#include <linux/cpumask.h>
#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
#endif /* _TRACE_HOOK_TOPOLOGY_H */
/* This part must be outside protection */
#include <trace/define_trace.h>

View File

@ -11,13 +11,9 @@
* 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
#endif /* _TRACE_HOOK_WQLOCKUP_H */
/* This part must be outside protection */