ANDROID: cputime: seprate irq entry and exit tracehooks

Currently the code has single hook for tracking irqs. However
modules need to deduce start and end of the irq.

Create separate hooks for irq start and end since the
cputime has already figured it out.

Bug: 231341763
Change-Id: Ie0dd503b283d83f69d01171ebd1cd6127c3bafd0
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
This commit is contained in:
Shaleen Agrawal
2022-05-03 15:56:24 -07:00
committed by Ashay Jaiswal
parent 3eebd9f7e4
commit aec40de3d7
3 changed files with 21 additions and 2 deletions

View File

@@ -153,6 +153,8 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_schedule);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_starting);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_sched_cpu_dying);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_account_irq);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_account_irq_start);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_account_irq_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_place_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_build_perf_domains);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_cpu_capacity);

View File

@@ -203,6 +203,14 @@ DECLARE_RESTRICTED_HOOK(android_rvh_account_irq,
TP_PROTO(struct task_struct *curr, int cpu, s64 delta),
TP_ARGS(curr, cpu, delta), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_account_irq_start,
TP_PROTO(struct task_struct *curr, int cpu, s64 delta),
TP_ARGS(curr, cpu, delta), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_account_irq_end,
TP_PROTO(struct task_struct *curr, int cpu, s64 delta),
TP_ARGS(curr, cpu, delta), 1);
struct sched_entity;
DECLARE_RESTRICTED_HOOK(android_rvh_place_entity,
TP_PROTO(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial, u64 *vruntime),

View File

@@ -56,6 +56,7 @@ void irqtime_account_irq(struct task_struct *curr, unsigned int offset)
unsigned int pc;
s64 delta;
int cpu;
bool irq_start = true;
if (!sched_clock_irqtime)
return;
@@ -71,12 +72,20 @@ void irqtime_account_irq(struct task_struct *curr, unsigned int offset)
* in that case, so as not to confuse scheduler with a special task
* that do not consume any time, but still wants to run.
*/
if (pc & HARDIRQ_MASK)
if (pc & HARDIRQ_MASK) {
irqtime_account_delta(irqtime, delta, CPUTIME_IRQ);
else if ((pc & SOFTIRQ_OFFSET) && curr != this_cpu_ksoftirqd())
irq_start = false;
} else if ((pc & SOFTIRQ_OFFSET) && curr != this_cpu_ksoftirqd()) {
irqtime_account_delta(irqtime, delta, CPUTIME_SOFTIRQ);
irq_start = false;
}
trace_android_rvh_account_irq(curr, cpu, delta);
if (irq_start)
trace_android_rvh_account_irq_start(curr, cpu, delta);
else
trace_android_rvh_account_irq_end(curr, cpu, delta);
}
static u64 irqtime_tick_accounted(u64 maxtime)