ANDROID: remove inclusions from hook definition headers

To avoid changing the visibiliy of data types when including
hook definition headers remove header file inclusions from
the hook definition header files.

Instead, the hook definition headers should just have forward
declarations that don't require full definition.

To provide full definitions of the types for the KMI, the
headers that define the types should be included by the
source file that instantiates the hooks - normally
vendor_hooks.c.

Bug: 233047575
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: Iaaa1a6f45a356569c04ad2fea0b1514e0454f041
This commit is contained in:
Todd Kjos
2022-09-02 22:39:29 +00:00
parent b6dace455e
commit b3efd2ad71
45 changed files with 121 additions and 153 deletions

View File

@@ -9,10 +9,8 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct snd_usb_audio */ struct snd_usb_audio;
#include <../sound/usb/usbaudio.h> struct usb_interface;
/* struct usb_interface */
#include <linux/usb.h>
DECLARE_HOOK(android_vh_audio_usb_offload_vendor_set, DECLARE_HOOK(android_vh_audio_usb_offload_vendor_set,
TP_PROTO(void *arg), TP_PROTO(void *arg),

View File

@@ -10,12 +10,13 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct binder_proc, struct binder_thread, struct binder_transaction */
#include <../drivers/android/binder_internal.h> struct binder_proc;
/* struct task_struct */ struct binder_thread;
#include <linux/sched.h> struct binder_transaction;
/* struct binder_transaction_data */ struct task_struct;
#include <uapi/linux/android/binder.h> struct binder_transaction_data;
DECLARE_HOOK(android_vh_binder_transaction_init, DECLARE_HOOK(android_vh_binder_transaction_init,
TP_PROTO(struct binder_transaction *t), TP_PROTO(struct binder_transaction *t),
TP_ARGS(t)); TP_ARGS(t));

View File

@@ -7,15 +7,11 @@
#if !defined(_TRACE_HOOK_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_HOOK_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_BLOCK_H #define _TRACE_HOOK_BLOCK_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct blk_mq_tags */ struct blk_mq_tags;
#include <../block/blk-mq-tag.h> struct blk_mq_alloc_data;
/* struct blk_mq_alloc_data */ struct blk_mq_tag_set;
#include <../block/blk-mq.h>
/* struct blk_mq_tag_set */
#include <linux/blk-mq.h>
DECLARE_HOOK(android_vh_blk_alloc_rqs, DECLARE_HOOK(android_vh_blk_alloc_rqs,
TP_PROTO(size_t *rq_size, struct blk_mq_tag_set *set, TP_PROTO(size_t *rq_size, struct blk_mq_tag_set *set,

View File

@@ -8,7 +8,9 @@
#define _TRACE_HOOK_CFG80211_H #define _TRACE_HOOK_CFG80211_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
#include <net/cfg80211.h>
struct wiphy;
struct wireless_dev;
DECLARE_HOOK(android_vh_cfg80211_set_context, DECLARE_HOOK(android_vh_cfg80211_set_context,
TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int context_id, TP_PROTO(struct wiphy *wiphy, struct wireless_dev *wdev, int context_id,

View File

@@ -7,16 +7,12 @@
#define _TRACE_HOOK_CGROUP_H #define _TRACE_HOOK_CGROUP_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
#ifndef __GENKSYMS__ struct cgroup;
struct cgroup_taskset; struct cgroup_taskset;
#else struct cgroup_subsys;
/* struct cgroup_taskset */ struct cgroup_subsys_state;
#include <../kernel/cgroup/cgroup-internal.h> struct task_struct;
#endif
/* struct cgroup_subsys */
#include <linux/cgroup-defs.h>
/* struct task_struct */
#include <linux/sched.h>
DECLARE_HOOK(android_vh_cgroup_set_task, DECLARE_HOOK(android_vh_cgroup_set_task,
TP_PROTO(int ret, struct task_struct *task), TP_PROTO(int ret, struct task_struct *task),
TP_ARGS(ret, task)); TP_ARGS(ret, task));

View File

@@ -7,9 +7,10 @@
#if !defined(_TRACE_HOOK_CPUFREQ_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_HOOK_CPUFREQ_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_CPUFREQ_H #define _TRACE_HOOK_CPUFREQ_H
#include <linux/cpufreq.h>
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
struct cpufreq_policy;
DECLARE_RESTRICTED_HOOK(android_rvh_show_max_freq, DECLARE_RESTRICTED_HOOK(android_rvh_show_max_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq), TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
TP_ARGS(policy, max_freq), 1); TP_ARGS(policy, max_freq), 1);

View File

@@ -9,8 +9,7 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct cpuidle_device */ struct cpuidle_device;
#include <linux/cpuidle.h>
DECLARE_HOOK(android_vh_cpu_idle_enter, DECLARE_HOOK(android_vh_cpu_idle_enter,
TP_PROTO(int *state, struct cpuidle_device *dev), TP_PROTO(int *state, struct cpuidle_device *dev),

View File

@@ -10,8 +10,8 @@
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct cpuidle_device */ struct cpuidle_device;
#include <linux/cpuidle.h>
DECLARE_HOOK(android_vh_cpuidle_psci_enter, DECLARE_HOOK(android_vh_cpuidle_psci_enter,
TP_PROTO(struct cpuidle_device *dev, bool s2idle), TP_PROTO(struct cpuidle_device *dev, bool s2idle),
TP_ARGS(dev, s2idle)); TP_ARGS(dev, s2idle));

View File

@@ -10,10 +10,9 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct cred */ struct cred;
#include <linux/cred.h> struct task_struct;
/* struct task_struct */
#include <linux/sched.h>
DECLARE_RESTRICTED_HOOK(android_rvh_commit_creds, DECLARE_RESTRICTED_HOOK(android_rvh_commit_creds,
TP_PROTO(const struct task_struct *task, const struct cred *new), TP_PROTO(const struct task_struct *task, const struct cred *new),
TP_ARGS(task, new), 1); TP_ARGS(task, new), 1);

View File

@@ -9,8 +9,7 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct pt_regs */ struct pt_regs;
#include <asm/ptrace.h>
DECLARE_HOOK(android_vh_ipi_stop, DECLARE_HOOK(android_vh_ipi_stop,
TP_PROTO(struct pt_regs *regs), TP_PROTO(struct pt_regs *regs),

View File

@@ -11,8 +11,8 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct dma_buf */ struct dma_buf;
#include <linux/dma-buf.h>
DECLARE_HOOK(android_vh_dma_buf_release, DECLARE_HOOK(android_vh_dma_buf_release,
TP_PROTO(struct dma_buf *data), TP_PROTO(struct dma_buf *data),
TP_ARGS(data)); TP_ARGS(data));

View File

@@ -11,10 +11,9 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct drm_atomic_state */ struct drm_atomic_state;
#include <drm/drm_atomic.h> struct drm_crtc;
/* struct drm_crtc */
#include <drm/drm_crtc.h>
DECLARE_HOOK(android_vh_drm_atomic_check_modeset, DECLARE_HOOK(android_vh_drm_atomic_check_modeset,
TP_PROTO(struct drm_atomic_state *state, struct drm_crtc *crtc, bool *allow), TP_PROTO(struct drm_atomic_state *state, struct drm_crtc *crtc, bool *allow),
TP_ARGS(state, crtc, allow)) TP_ARGS(state, crtc, allow))

View File

@@ -11,8 +11,8 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct drm_framebuffer */ struct drm_framebuffer;
#include <drm/drm_framebuffer.h>
DECLARE_HOOK(android_vh_atomic_remove_fb, DECLARE_HOOK(android_vh_atomic_remove_fb,
TP_PROTO(struct drm_framebuffer *fb, bool *allow), TP_PROTO(struct drm_framebuffer *fb, bool *allow),
TP_ARGS(fb, allow)) TP_ARGS(fb, allow))

View File

@@ -10,14 +10,11 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct mutex */ struct mutex;
#include <linux/mutex.h> struct rt_mutex_base;
/* struct rt_mutex_base */ struct rw_semaphore;
#include <linux/rtmutex.h> struct task_struct;
/* struct rw_semaphore */
#include <linux/rwsem.h>
/* struct task_struct */
#include <linux/sched.h>
DECLARE_HOOK(android_vh_mutex_wait_start, DECLARE_HOOK(android_vh_mutex_wait_start,
TP_PROTO(struct mutex *lock), TP_PROTO(struct mutex *lock),
TP_ARGS(lock)); TP_ARGS(lock));

View File

@@ -7,8 +7,8 @@
#define _TRACE_HOOK_FAULT_H #define _TRACE_HOOK_FAULT_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct pt_regs */ struct pt_regs;
#include <asm/ptrace.h>
DECLARE_RESTRICTED_HOOK(android_rvh_die_kernel_fault, DECLARE_RESTRICTED_HOOK(android_rvh_die_kernel_fault,
TP_PROTO(const char *msg, unsigned long addr, unsigned int esr, struct pt_regs *regs), TP_PROTO(const char *msg, unsigned long addr, unsigned int esr, struct pt_regs *regs),
TP_ARGS(msg, addr, esr, regs), 1); TP_ARGS(msg, addr, esr, regs), 1);

View File

@@ -7,8 +7,7 @@
#define _TRACE_HOOK_FIPS140_H #define _TRACE_HOOK_FIPS140_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct crypto_aes_ctx */ struct crypto_aes_ctx;
#include <crypto/aes.h>
/* /*
* These hooks exist only for the benefit of the FIPS140 crypto module, which * These hooks exist only for the benefit of the FIPS140 crypto module, which

View File

@@ -9,8 +9,7 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct task_struct */ struct task_struct;
#include <linux/sched.h>
DECLARE_HOOK(android_vh_is_fpsimd_save, DECLARE_HOOK(android_vh_is_fpsimd_save,
TP_PROTO(struct task_struct *prev, struct task_struct *next), TP_PROTO(struct task_struct *prev, struct task_struct *next),

View File

@@ -7,11 +7,10 @@
#if !defined(_TRACE_HOOK_FTRACE_DUMP_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_HOOK_FTRACE_DUMP_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_FTRACE_DUMP_H #define _TRACE_HOOK_FTRACE_DUMP_H
#include <linux/trace_seq.h>
#include <linux/trace_events.h>
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
struct trace_seq;
DECLARE_HOOK(android_vh_ftrace_oops_enter, DECLARE_HOOK(android_vh_ftrace_oops_enter,
TP_PROTO(bool *ftrace_check), TP_PROTO(bool *ftrace_check),
TP_ARGS(ftrace_check)); TP_ARGS(ftrace_check));

View File

@@ -6,7 +6,9 @@
#if !defined(_TRACE_HOOK_FUTEX_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_HOOK_FUTEX_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_FUTEX_H #define _TRACE_HOOK_FUTEX_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
#include <linux/plist.h>
struct plist_node;
struct plist_head;
/* /*
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality

View File

@@ -8,8 +8,8 @@
#define _TRACE_HOOK_GIC_H #define _TRACE_HOOK_GIC_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct irq_data */
#include <linux/irq.h> struct irq_data;
struct gic_chip_data; struct gic_chip_data;
DECLARE_HOOK(android_vh_gic_resume, DECLARE_HOOK(android_vh_gic_resume,

View File

@@ -9,10 +9,9 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct cpumask */ struct cpumask;
#include <linux/cpumask.h> struct irq_data;
/* struct irq_data */
#include <linux/irq.h>
DECLARE_HOOK(android_vh_gic_v3_affinity_init, DECLARE_HOOK(android_vh_gic_v3_affinity_init,
TP_PROTO(int irq, u32 offset, u64 *affinity), TP_PROTO(int irq, u32 offset, u64 *affinity),
TP_ARGS(irq, offset, affinity)); TP_ARGS(irq, offset, affinity));

View File

@@ -9,6 +9,8 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
struct task_struct;
DECLARE_HOOK(android_vh_check_uninterruptible_tasks, DECLARE_HOOK(android_vh_check_uninterruptible_tasks,
TP_PROTO(struct task_struct *t, unsigned long timeout, TP_PROTO(struct task_struct *t, unsigned long timeout,
bool *need_check), bool *need_check),

View File

@@ -7,12 +7,10 @@
#if !defined(_TRACE_HOOK_IOMMU_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_HOOK_IOMMU_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_IOMMU_H #define _TRACE_HOOK_IOMMU_H
#include <linux/types.h>
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct iova_domain */ struct iova_domain;
#include <linux/iova.h>
DECLARE_RESTRICTED_HOOK(android_rvh_iommu_setup_dma_ops, DECLARE_RESTRICTED_HOOK(android_rvh_iommu_setup_dma_ops,
TP_PROTO(struct device *dev, u64 dma_base, u64 dma_limit), TP_PROTO(struct device *dev, u64 dma_base, u64 dma_limit),
TP_ARGS(dev, dma_base, dma_limit), 1); TP_ARGS(dev, dma_base, dma_limit), 1);

View File

@@ -6,7 +6,6 @@
#if !defined(_TRACE_HOOK_IPV4_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_HOOK_IPV4_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_IPV4_H #define _TRACE_HOOK_IPV4_H
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
DECLARE_RESTRICTED_HOOK(android_rvh_tcp_sendmsg_locked, DECLARE_RESTRICTED_HOOK(android_rvh_tcp_sendmsg_locked,

View File

@@ -9,8 +9,8 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct printk_record, struct printk_ringbuffer */ struct printk_ringbuffer;
#include <../kernel/printk/printk_ringbuffer.h> struct printk_record;
DECLARE_HOOK(android_vh_logbuf, DECLARE_HOOK(android_vh_logbuf,
TP_PROTO(struct printk_ringbuffer *rb, struct printk_record *r), TP_PROTO(struct printk_ringbuffer *rb, struct printk_record *r),

View File

@@ -7,14 +7,11 @@
#if !defined(_TRACE_HOOK_MM_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_HOOK_MM_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_MM_H #define _TRACE_HOOK_MM_H
#include <linux/types.h>
#include <linux/mm.h>
#include <linux/oom.h>
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct slabinfo */ struct oom_control;
#include <../mm/slab.h> struct slabinfo;
DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags, DECLARE_RESTRICTED_HOOK(android_rvh_set_skip_swapcache_flags,
TP_PROTO(gfp_t *flags), TP_PROTO(gfp_t *flags),
TP_ARGS(flags), 1); TP_ARGS(flags), 1);

View File

@@ -5,15 +5,13 @@
#define TRACE_INCLUDE_PATH trace/hooks #define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_MMC_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_HOOK_MMC_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_MMC_H #define _TRACE_HOOK_MMC_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct blk_mq_queue_data */
#include <linux/blk-mq.h> struct blk_mq_queue_data;
/* struct mmc_host */ struct mmc_host;
#include <linux/mmc/host.h> struct mmc_card;
/* struct mmc_card */ struct sdhci_host;
#include <linux/mmc/card.h>
/* struct sdhci_host */
#include "../../drivers/mmc/host/sdhci.h"
/* /*
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a

View File

@@ -10,8 +10,8 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct module */ struct module;
#include <linux/module.h>
DECLARE_HOOK(android_vh_set_module_permit_before_init, DECLARE_HOOK(android_vh_set_module_permit_before_init,
TP_PROTO(const struct module *mod), TP_PROTO(const struct module *mod),
TP_ARGS(mod)); TP_ARGS(mod));

View File

@@ -10,8 +10,8 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct task_struct */ struct task_struct;
#include <linux/sched.h>
DECLARE_HOOK(android_vh_mpam_set, DECLARE_HOOK(android_vh_mpam_set,
TP_PROTO(struct task_struct *prev, struct task_struct *next), TP_PROTO(struct task_struct *prev, struct task_struct *next),
TP_ARGS(prev, next)); TP_ARGS(prev, next));

View File

@@ -8,12 +8,10 @@
#define _TRACE_HOOK_NET_VH_H #define _TRACE_HOOK_NET_VH_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct packet_type */ struct packet_type;
#include <linux/netdevice.h> struct sk_buff;
/* struct sk_buff */ struct list_head;
#include <linux/skbuff.h>
/* struct list_head */
#include <linux/types.h>
DECLARE_HOOK(android_vh_ptype_head, DECLARE_HOOK(android_vh_ptype_head,
TP_PROTO(const struct packet_type *pt, struct list_head *vendor_pt), TP_PROTO(const struct packet_type *pt, struct list_head *vendor_pt),
TP_ARGS(pt, vendor_pt)); TP_ARGS(pt, vendor_pt));

View File

@@ -10,8 +10,8 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct generic_pm_domain */ struct generic_pm_domain;
#include <linux/pm_domain.h>
DECLARE_HOOK(android_vh_allow_domain_state, DECLARE_HOOK(android_vh_allow_domain_state,
TP_PROTO(struct generic_pm_domain *genpd, uint32_t idx, bool *allow), TP_PROTO(struct generic_pm_domain *genpd, uint32_t idx, bool *allow),
TP_ARGS(genpd, idx, allow)) TP_ARGS(genpd, idx, allow))

View File

@@ -7,8 +7,8 @@
#define _TRACE_HOOK_POWER_H #define _TRACE_HOOK_POWER_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct task_struct */ struct task_struct;
#include <linux/sched.h>
DECLARE_HOOK(android_vh_try_to_freeze_todo, DECLARE_HOOK(android_vh_try_to_freeze_todo,
TP_PROTO(unsigned int todo, unsigned int elapsed_msecs, bool wq_busy), TP_PROTO(unsigned int todo, unsigned int elapsed_msecs, bool wq_busy),
TP_ARGS(todo, elapsed_msecs, wq_busy)); TP_ARGS(todo, elapsed_msecs, wq_busy));

View File

@@ -8,10 +8,8 @@
#define _TRACE_HOOK_REGMAP_H #define _TRACE_HOOK_REGMAP_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct regmap */ struct regmap;
#include <../drivers/base/regmap/internal.h> struct regmap_config;
/* struct regmap_config */
#include <linux/regmap.h>
/* /*
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a

View File

@@ -7,13 +7,9 @@
#if !defined(_TRACE_HOOK_RPROC_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_HOOK_RPROC_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_RPROC_H #define _TRACE_HOOK_RPROC_H
/* struct rproc */
#include <linux/remoteproc.h>
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct rproc */ struct rproc;
#include <linux/remoteproc.h>
/* When recovery succeeds */ /* When recovery succeeds */
DECLARE_HOOK(android_vh_rproc_recovery, DECLARE_HOOK(android_vh_rproc_recovery,

View File

@@ -10,8 +10,9 @@
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct rw_semaphore, struct rwsem_waiter */ struct rw_semaphore;
#include <linux/rwsem.h> struct rwsem_waiter;
DECLARE_HOOK(android_vh_rwsem_init, DECLARE_HOOK(android_vh_rwsem_init,
TP_PROTO(struct rw_semaphore *sem), TP_PROTO(struct rw_semaphore *sem),
TP_ARGS(sem)); TP_ARGS(sem));

View File

@@ -9,20 +9,16 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
#ifndef __GENKSYMS__
struct cgroup_taskset; struct cgroup_taskset;
#else struct cgroup_subsys_state;
/* struct cgroup_taskset */ struct em_perf_domain;
#include <../kernel/cgroup/cgroup-internal.h> enum uclamp_id;
#endif struct sched_entity;
/* struct cgroup_subsys_state */ struct task_struct;
#include <linux/cgroup-defs.h> struct uclamp_se;
/* struct em_perf_domain */ struct sched_attr;
#include <linux/energy_model.h>
/* enum uclamp_id, struct sched_entity, struct task_struct, struct uclamp_se */
#include <linux/sched.h>
/* struct sched_attr */
#include <uapi/linux/sched/types.h>
DECLARE_RESTRICTED_HOOK(android_rvh_select_task_rq_fair, DECLARE_RESTRICTED_HOOK(android_rvh_select_task_rq_fair,
TP_PROTO(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags, int *new_cpu), TP_PROTO(struct task_struct *p, int prev_cpu, int sd_flag, int wake_flags, int *new_cpu),
TP_ARGS(p, prev_cpu, sd_flag, wake_flags, new_cpu), 1); TP_ARGS(p, prev_cpu, sd_flag, wake_flags, new_cpu), 1);

View File

@@ -7,8 +7,8 @@
#define _TRACE_HOOK_SOFTLOCKUP_H #define _TRACE_HOOK_SOFTLOCKUP_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct pt_regs */ struct pt_regs;
#include <asm/ptrace.h>
DECLARE_HOOK(android_vh_watchdog_timer_softlockup, DECLARE_HOOK(android_vh_watchdog_timer_softlockup,
TP_PROTO(int duration, struct pt_regs *regs, bool is_panic), TP_PROTO(int duration, struct pt_regs *regs, bool is_panic),
TP_ARGS(duration, regs, is_panic)); TP_ARGS(duration, regs, is_panic));

View File

@@ -7,8 +7,8 @@
#define _TRACE_HOOK_SYS_H #define _TRACE_HOOK_SYS_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct task_struct */ struct task_struct;
#include <linux/sched.h>
DECLARE_HOOK(android_vh_syscall_prctl_finished, DECLARE_HOOK(android_vh_syscall_prctl_finished,
TP_PROTO(int option, struct task_struct *task), TP_PROTO(int option, struct task_struct *task),
TP_ARGS(option, task)); TP_ARGS(option, task));

View File

@@ -10,10 +10,9 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct file */ struct file;
#include <linux/fs.h> union bpf_attr;
/* union bpf_attr */
#include <uapi/linux/bpf.h>
DECLARE_HOOK(android_vh_check_mmap_file, DECLARE_HOOK(android_vh_check_mmap_file,
TP_PROTO(const struct file *file, unsigned long prot, TP_PROTO(const struct file *file, unsigned long prot,
unsigned long flag, unsigned long ret), unsigned long flag, unsigned long ret),

View File

@@ -8,10 +8,10 @@
#define _TRACE_HOOK_THERMAL_H #define _TRACE_HOOK_THERMAL_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
#include <linux/cpufreq.h>
/* struct thermal_cooling_device, struct thermal_zone_device */ struct thermal_cooling_device;
#include <linux/thermal.h> struct thermal_zone_device;
DECLARE_HOOK(android_vh_modify_thermal_request_freq, DECLARE_HOOK(android_vh_modify_thermal_request_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned long *request_freq), TP_PROTO(struct cpufreq_policy *policy, unsigned long *request_freq),
TP_ARGS(policy, request_freq)); TP_ARGS(policy, request_freq));

View File

@@ -9,8 +9,8 @@
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct timekeeper */ struct timekeeper;
#include <linux/timekeeper_internal.h>
DECLARE_RESTRICTED_HOOK(android_rvh_tk_based_time_sync, DECLARE_RESTRICTED_HOOK(android_rvh_tk_based_time_sync,
TP_PROTO(struct timekeeper *tk), TP_PROTO(struct timekeeper *tk),
TP_ARGS(tk), 1); TP_ARGS(tk), 1);

View File

@@ -8,7 +8,8 @@
#define _TRACE_HOOK_TOPOLOGY_H #define _TRACE_HOOK_TOPOLOGY_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
#include <linux/cpumask.h>
struct cpumask;
DECLARE_HOOK(android_vh_arch_set_freq_scale, DECLARE_HOOK(android_vh_arch_set_freq_scale,
TP_PROTO(const struct cpumask *cpus, unsigned long freq, TP_PROTO(const struct cpumask *cpus, unsigned long freq,

View File

@@ -7,8 +7,8 @@
#define _TRACE_HOOK_TRAPS_H #define _TRACE_HOOK_TRAPS_H
#include <trace/hooks/vendor_hooks.h> #include <trace/hooks/vendor_hooks.h>
/* struct pt_regs */ struct pt_regs;
#include <asm/ptrace.h>
DECLARE_RESTRICTED_HOOK(android_rvh_do_undefinstr, DECLARE_RESTRICTED_HOOK(android_rvh_do_undefinstr,
TP_PROTO(struct pt_regs *regs), TP_PROTO(struct pt_regs *regs),
TP_ARGS(regs), TP_ARGS(regs),

View File

@@ -9,12 +9,12 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct ufs_hba, struct ufshcd_lrb, struct uic_command */
#include <ufs/ufshcd.h> struct ufs_hba;
/* struct request */ struct ufshcd_lrb;
#include <linux/blkdev.h> struct uic_command;
/* struct scsi_device */ struct request;
#include <scsi/scsi_device.h> struct scsi_device;
DECLARE_HOOK(android_vh_ufs_fill_prdt, DECLARE_HOOK(android_vh_ufs_fill_prdt,
TP_PROTO(struct ufs_hba *hba, struct ufshcd_lrb *lrbp, TP_PROTO(struct ufs_hba *hba, struct ufshcd_lrb *lrbp,

View File

@@ -10,8 +10,8 @@
* Following tracepoints are not exported in tracefs and provide a * Following tracepoints are not exported in tracefs and provide a
* mechanism for vendor modules to hook and extend functionality * mechanism for vendor modules to hook and extend functionality
*/ */
/* struct usb_device */ struct usb_device;
#include <linux/usb.h>
DECLARE_HOOK(android_vh_usb_new_device_added, DECLARE_HOOK(android_vh_usb_new_device_added,
TP_PROTO(struct usb_device *udev, int *err), TP_PROTO(struct usb_device *udev, int *err),
TP_ARGS(udev, err)); TP_ARGS(udev, err));