ANDROID: vendor_hooks: Add hooks for cpufreq_acct_update_power
We want to record the cputime of each running process by adding hooks for cpufreq_acct_update_power. Bug: 186604985 Signed-off-by: zhengding chen <chenzhengding@oppo.com> Change-Id: I35e38be4680781df3338b4a01041922294aecaa0 (cherry picked from commit 3983753280987d68138ce249232b3d1b775ab1e6)
This commit is contained in:
committed by
Treehugger Robot
parent
76be364a84
commit
55f112e068
@@ -459,3 +459,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_modify_thermal_cpu_get_power);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_cache_forced_ra);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_reclaim_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_pages_failure_bypass);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpufreq_acct_update_power);
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/threads.h>
|
||||
#include <trace/hooks/cpufreq.h>
|
||||
|
||||
static DEFINE_SPINLOCK(task_time_in_state_lock); /* task->time_in_state */
|
||||
|
||||
@@ -146,6 +147,8 @@ void cpufreq_acct_update_power(struct task_struct *p, u64 cputime)
|
||||
p->time_in_state)
|
||||
p->time_in_state[state] += cputime;
|
||||
spin_unlock_irqrestore(&task_time_in_state_lock, flags);
|
||||
|
||||
trace_android_vh_cpufreq_acct_update_power(cputime, p, state);
|
||||
}
|
||||
|
||||
static int cpufreq_times_get_index(struct cpu_freqs *freqs, unsigned int freq)
|
||||
|
||||
@@ -19,6 +19,10 @@ DECLARE_HOOK(android_vh_freq_table_limits,
|
||||
unsigned int max_freq),
|
||||
TP_ARGS(policy, min_freq, max_freq));
|
||||
|
||||
DECLARE_HOOK(android_vh_cpufreq_acct_update_power,
|
||||
TP_PROTO(u64 cputime, struct task_struct *p, unsigned int state),
|
||||
TP_ARGS(cputime, p, state));
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_cpufreq_transition,
|
||||
TP_PROTO(struct cpufreq_policy *policy),
|
||||
TP_ARGS(policy), 1);
|
||||
|
||||
Reference in New Issue
Block a user