
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
35 lines
1.0 KiB
C
35 lines
1.0 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM cpufreq
|
|
|
|
#define TRACE_INCLUDE_PATH trace/hooks
|
|
|
|
#if !defined(_TRACE_HOOK_CPUFREQ_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_HOOK_CPUFREQ_H
|
|
|
|
#include <linux/cpufreq.h>
|
|
#include <linux/tracepoint.h>
|
|
#include <trace/hooks/vendor_hooks.h>
|
|
|
|
DECLARE_HOOK(android_vh_show_max_freq,
|
|
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
|
|
TP_ARGS(policy, max_freq));
|
|
|
|
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));
|
|
|
|
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);
|
|
/* macro versions of hooks are no longer required */
|
|
|
|
#endif /* _TRACE_HOOK_CPUFREQ_H */
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|