From 5c5b7a4da67ca427d09d4225d798d7b83f6498f8 Mon Sep 17 00:00:00 2001 From: Peifeng Li Date: Thu, 22 Sep 2022 11:36:30 +0800 Subject: [PATCH] ANDROID: vendor_hook: rename the the name of hooks Renamed trace_android_vh_record_percpu_rwsem_lock_starttime to trace_android_vh_record_pcpu_rwsem_starttime. Because the orignal name is too long, which results to the compile-err of .ko that uses the symbol: ERROR: modpost: too long symbol "__tracepoint_android_vh_record_percpu_rwsem_lock_starttime" There is not any users of the the orignal hooks so that it is safe to rename it. Bug: 241191475 Signed-off-by: Peifeng Li Change-Id: Ie246a933414db5e9e28a65a4c280fae3a1cbefe3 --- drivers/android/vendor_hooks.c | 2 +- include/linux/percpu-rwsem.h | 8 ++++---- include/trace/hooks/dtask.h | 2 +- kernel/locking/percpu-rwsem.c | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index ea1b1cf1468e..0790c299d2be 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -267,7 +267,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_revert_creds); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_mutex_lock_starttime); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rtmutex_lock_starttime); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_rwsem_lock_starttime); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_percpu_rwsem_lock_starttime); +EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_record_pcpu_rwsem_starttime); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_x); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_nx); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_memory_ro); diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index 2f33e0a6e1a9..92d172cfce06 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h @@ -9,7 +9,7 @@ #include #include -void _trace_android_vh_record_percpu_rwsem_lock_starttime( +void _trace_android_vh_record_pcpu_rwsem_starttime( struct task_struct *tsk, unsigned long settime); struct percpu_rw_semaphore { @@ -76,7 +76,7 @@ static inline void percpu_down_read(struct percpu_rw_semaphore *sem) * bleeding the critical section out. */ preempt_enable(); - _trace_android_vh_record_percpu_rwsem_lock_starttime(current, jiffies); + _trace_android_vh_record_pcpu_rwsem_starttime(current, jiffies); } static inline bool percpu_down_read_trylock(struct percpu_rw_semaphore *sem) @@ -98,7 +98,7 @@ static inline bool percpu_down_read_trylock(struct percpu_rw_semaphore *sem) */ if (ret) { - _trace_android_vh_record_percpu_rwsem_lock_starttime(current, jiffies); + _trace_android_vh_record_pcpu_rwsem_starttime(current, jiffies); rwsem_acquire_read(&sem->dep_map, 0, 1, _RET_IP_); } @@ -107,7 +107,7 @@ static inline bool percpu_down_read_trylock(struct percpu_rw_semaphore *sem) static inline void percpu_up_read(struct percpu_rw_semaphore *sem) { - _trace_android_vh_record_percpu_rwsem_lock_starttime(current, 0); + _trace_android_vh_record_pcpu_rwsem_starttime(current, 0); rwsem_release(&sem->dep_map, _RET_IP_); preempt_disable(); diff --git a/include/trace/hooks/dtask.h b/include/trace/hooks/dtask.h index 208edf8ac265..956e8421755c 100644 --- a/include/trace/hooks/dtask.h +++ b/include/trace/hooks/dtask.h @@ -77,7 +77,7 @@ DECLARE_HOOK(android_vh_record_rtmutex_lock_starttime, DECLARE_HOOK(android_vh_record_rwsem_lock_starttime, TP_PROTO(struct task_struct *tsk, unsigned long settime_jiffies), TP_ARGS(tsk, settime_jiffies)); -DECLARE_HOOK(android_vh_record_percpu_rwsem_lock_starttime, +DECLARE_HOOK(android_vh_record_pcpu_rwsem_starttime, TP_PROTO(struct task_struct *tsk, unsigned long settime_jiffies), TP_ARGS(tsk, settime_jiffies)); diff --git a/kernel/locking/percpu-rwsem.c b/kernel/locking/percpu-rwsem.c index 4a9e7aafd7f4..c8a474aa1b3b 100644 --- a/kernel/locking/percpu-rwsem.c +++ b/kernel/locking/percpu-rwsem.c @@ -13,17 +13,17 @@ #include /* - * trace_android_vh_record_percpu_rwsem_lock_starttime is called in + * trace_android_vh_record_pcpu_rwsem_starttime is called in * include/linux/percpu-rwsem.h by including include/hooks/dtask.h, which * will result to build-err. So we create - * func:_trace_android_vh_record_percpu_rwsem_lock_starttime for percpu-rwsem.h to call. + * func:_trace_android_vh_record_pcpu_rwsem_starttime for percpu-rwsem.h to call. */ -void _trace_android_vh_record_percpu_rwsem_lock_starttime(struct task_struct *tsk, +void _trace_android_vh_record_pcpu_rwsem_starttime(struct task_struct *tsk, unsigned long settime) { - trace_android_vh_record_percpu_rwsem_lock_starttime(tsk, settime); + trace_android_vh_record_pcpu_rwsem_starttime(tsk, settime); } -EXPORT_SYMBOL_GPL(_trace_android_vh_record_percpu_rwsem_lock_starttime); +EXPORT_SYMBOL_GPL(_trace_android_vh_record_pcpu_rwsem_starttime); int __percpu_init_rwsem(struct percpu_rw_semaphore *sem, const char *name, struct lock_class_key *key) @@ -252,13 +252,13 @@ void percpu_down_write(struct percpu_rw_semaphore *sem) /* Wait for all active readers to complete. */ rcuwait_wait_event(&sem->writer, readers_active_check(sem), TASK_UNINTERRUPTIBLE); - trace_android_vh_record_percpu_rwsem_lock_starttime(current, jiffies); + trace_android_vh_record_pcpu_rwsem_starttime(current, jiffies); } EXPORT_SYMBOL_GPL(percpu_down_write); void percpu_up_write(struct percpu_rw_semaphore *sem) { - trace_android_vh_record_percpu_rwsem_lock_starttime(current, 0); + trace_android_vh_record_pcpu_rwsem_starttime(current, 0); rwsem_release(&sem->dep_map, _RET_IP_); /*