Skip to content

Commit 301deca

Browse files
author
Daniel Bristot de Oliveira
committed
rtla/timerlat_aa: Fix previous IRQ delay for IRQs that happens after thread sample
timerlat auto-analysis takes note of all IRQs, before or after the execution of the timerlat thread. Because we cannot go backward in the trace (we will fix it when moving to trace-cmd lib?), timerlat aa take note of the last IRQ execution in the waiting for the IRQ state, and then print it if it is executed after the expected timer IRQ starting time. After the thread sample, the timerlat starts recording the next IRQs as "previous" irq for the next occurrence. However, if an IRQ happens after the thread measurement but before the tracing stops, it is classified as a previous IRQ. That is not wrong, as it can be "previous" for the subsequent activation. What is wrong is considering it as a potential source for the last activation. Ignore the IRQ interference that happens after the IRQ starting time for now. A future improvement for timerlat can be either keeping a list of previous IRQ execution or using the trace-cmd library. Still, it requires further investigation - it is a new feature. Link: https://lore.kernel.org/lkml/a44a3f5c801dcc697bacf7325b65d4a5b0460537.1691162043.git.bristot@kernel.org Fixes: 27e348b ("rtla/timerlat: Add auto-analysis core") Signed-off-by: Daniel Bristot de Oliveira <[email protected]>
1 parent 6c73daf commit 301deca

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tools/tracing/rtla/src/timerlat_aa.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ static int timerlat_aa_kworker_start_handler(struct trace_seq *s, struct tep_rec
545545
static void timerlat_thread_analysis(struct timerlat_aa_data *taa_data, int cpu,
546546
int irq_thresh, int thread_thresh)
547547
{
548-
unsigned long long exp_irq_ts;
548+
long long exp_irq_ts;
549549
int total;
550550
int irq;
551551

@@ -562,12 +562,15 @@ static void timerlat_thread_analysis(struct timerlat_aa_data *taa_data, int cpu,
562562

563563
/*
564564
* Expected IRQ arrival time using the trace clock as the base.
565+
*
566+
* TODO: Add a list of previous IRQ, and then run the list backwards.
565567
*/
566568
exp_irq_ts = taa_data->timer_irq_start_time - taa_data->timer_irq_start_delay;
567-
568-
if (exp_irq_ts < taa_data->prev_irq_timstamp + taa_data->prev_irq_duration)
569-
printf(" Previous IRQ interference: \t\t up to %9.2f us\n",
570-
ns_to_usf(taa_data->prev_irq_duration));
569+
if (exp_irq_ts < taa_data->prev_irq_timstamp + taa_data->prev_irq_duration) {
570+
if (taa_data->prev_irq_timstamp < taa_data->timer_irq_start_time)
571+
printf(" Previous IRQ interference: \t\t up to %9.2f us\n",
572+
ns_to_usf(taa_data->prev_irq_duration));
573+
}
571574

572575
/*
573576
* The delay that the IRQ suffered before starting.

0 commit comments

Comments
 (0)