ANDROID: vendor_hooks: Add hook for jiffies updates

Create a vendor hook for jiffies updates by the
tick_do_timer_cpu.

Bug: 148928265
Change-Id: Ia442e20d446b8ce4f2b3f2be76655e72919c76eb
Signed-off-by: Amir Vajid <avajid@codeaurora.org>
This commit is contained in:
Amir Vajid
2020-10-20 15:58:14 -07:00
committed by Todd Kjos
parent 861a024589
commit 9bdaa3fa87
4 changed files with 12 additions and 1 deletions
+1
View File
@@ -66,3 +66,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ipi_stop);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sysrq_crash);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_dump_throttled_rt_tasks);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_printk_hotplug);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_jiffies_update);
+5
View File
@@ -70,11 +70,15 @@ struct sched_group;
DECLARE_RESTRICTED_HOOK(android_rvh_find_busiest_group,
TP_PROTO(struct sched_group *busiest, struct rq *dst_rq, int *out_balance),
TP_ARGS(busiest, dst_rq, out_balance), 1);
DECLARE_HOOK(android_vh_dump_throttled_rt_tasks,
TP_PROTO(int cpu, u64 clock, ktime_t rt_period, u64 rt_runtime,
s64 rt_period_timer_expires),
TP_ARGS(cpu, clock, rt_period, rt_runtime, rt_period_timer_expires));
DECLARE_HOOK(android_vh_jiffies_update,
TP_PROTO(void *unused),
TP_ARGS(unused));
#else
#define trace_android_rvh_select_task_rq_fair(p, prev_cpu, sd_flag, wake_flags, new_cpu)
#define trace_android_rvh_select_task_rq_rt(p, prev_cpu, sd_flag, wake_flags, new_cpu)
@@ -91,6 +95,7 @@ DECLARE_HOOK(android_vh_dump_throttled_rt_tasks,
#define trace_android_rvh_setscheduler(p)
#define trace_android_rvh_find_busiest_group(busiest, dst_rq, out_balance)
#define trace_android_vh_dump_throttled_rt_tasks(cpu, clock, rt_period, rt_runtime, rt_period_timer_expires)
#define trace_android_vh_jiffies_update(unused)
#endif
#endif /* _TRACE_HOOK_SCHED_H */
/* This part must be outside protection */
+2
View File
@@ -17,6 +17,7 @@
#include <linux/sched.h>
#include <linux/module.h>
#include <trace/events/power.h>
#include <trace/hooks/sched.h>
#include <asm/irq_regs.h>
@@ -94,6 +95,7 @@ static void tick_periodic(int cpu)
write_seqcount_end(&jiffies_seq);
raw_spin_unlock(&jiffies_lock);
update_wall_time();
trace_android_vh_jiffies_update(NULL);
}
update_process_times(user_mode(get_irq_regs()));
+4 -1
View File
@@ -25,6 +25,7 @@
#include <linux/posix-timers.h>
#include <linux/context_tracking.h>
#include <linux/mm.h>
#include <trace/hooks/sched.h>
#include <asm/irq_regs.h>
@@ -143,8 +144,10 @@ static void tick_sched_do_timer(struct tick_sched *ts, ktime_t now)
#endif
/* Check, if the jiffies need an update */
if (tick_do_timer_cpu == cpu)
if (tick_do_timer_cpu == cpu) {
tick_do_update_jiffies64(now);
trace_android_vh_jiffies_update(NULL);
}
if (ts->inidle)
ts->got_idle_tick = 1;