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
This commit is contained in:
@@ -298,3 +298,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_vmalloc_stack);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_show_stack_hash);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_track_hash);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_task_comm);
|
||||
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)
|
||||
|
@@ -20,6 +20,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