Lines Matching +full:exit +full:- +full:latency +full:- +full:us
1 // SPDX-License-Identifier: GPL-2.0
23 * Per-cpu data statistics and data.
29 /* timerlat IRQ latency */
34 /* timerlat Thread latency */
64 * If now - timestamp is <= latency, it might have influenced
65 * in the timerlat irq latency. Otherwise, ignore it.
135 * timerlat_aa_get_data - Get the per-cpu data from the timerlat context
140 return &taa_ctx->taa_data[cpu]; in timerlat_aa_get_data()
144 * timerlat_aa_irq_latency - Handles timerlat IRQ event
154 taa_data->curr_state = TIMERLAT_WAITING_THREAD; in timerlat_aa_irq_latency()
155 taa_data->tlat_irq_timstamp = record->ts; in timerlat_aa_irq_latency()
160 taa_data->thread_nmi_sum = 0; in timerlat_aa_irq_latency()
161 taa_data->thread_irq_sum = 0; in timerlat_aa_irq_latency()
162 taa_data->thread_softirq_sum = 0; in timerlat_aa_irq_latency()
163 taa_data->thread_thread_sum = 0; in timerlat_aa_irq_latency()
164 taa_data->thread_blocking_duration = 0; in timerlat_aa_irq_latency()
165 taa_data->timer_irq_start_time = 0; in timerlat_aa_irq_latency()
166 taa_data->timer_irq_duration = 0; in timerlat_aa_irq_latency()
167 taa_data->timer_exit_from_idle = 0; in timerlat_aa_irq_latency()
172 trace_seq_reset(taa_data->nmi_seq); in timerlat_aa_irq_latency()
173 trace_seq_reset(taa_data->irqs_seq); in timerlat_aa_irq_latency()
174 trace_seq_reset(taa_data->softirqs_seq); in timerlat_aa_irq_latency()
175 trace_seq_reset(taa_data->threads_seq); in timerlat_aa_irq_latency()
177 /* IRQ latency values */ in timerlat_aa_irq_latency()
178 tep_get_field_val(s, event, "timer_latency", record, &taa_data->tlat_irq_latency, 1); in timerlat_aa_irq_latency()
179 tep_get_field_val(s, event, "seqnum", record, &taa_data->tlat_irq_seqnum, 1); in timerlat_aa_irq_latency()
182 tep_get_common_field_val(s, event, "common_pid", record, &taa_data->run_thread_pid, 1); in timerlat_aa_irq_latency()
185 * Get exit from idle case. in timerlat_aa_irq_latency()
189 if (taa_data->run_thread_pid) in timerlat_aa_irq_latency()
193 * if the latency is shorter than the known exit from idle: in timerlat_aa_irq_latency()
195 if (taa_data->tlat_irq_latency < taa_data->max_exit_idle_latency) in timerlat_aa_irq_latency()
202 if (taa_data->tlat_irq_timstamp - taa_data->tlat_irq_latency in timerlat_aa_irq_latency()
203 < taa_data->prev_irq_timstamp + taa_data->prev_irq_duration) in timerlat_aa_irq_latency()
206 taa_data->max_exit_idle_latency = taa_data->tlat_irq_latency; in timerlat_aa_irq_latency()
212 * timerlat_aa_thread_latency - Handles timerlat thread event
222 taa_data->curr_state = TIMERLAT_WAITING_IRQ; in timerlat_aa_thread_latency()
223 taa_data->tlat_thread_timstamp = record->ts; in timerlat_aa_thread_latency()
225 /* Thread latency values */ in timerlat_aa_thread_latency()
226 tep_get_field_val(s, event, "timer_latency", record, &taa_data->tlat_thread_latency, 1); in timerlat_aa_thread_latency()
227 tep_get_field_val(s, event, "seqnum", record, &taa_data->tlat_thread_seqnum, 1); in timerlat_aa_thread_latency()
233 * timerlat_aa_handler - Handle timerlat events
237 * Returns 0 on success, -1 otherwise.
243 struct timerlat_aa_data *taa_data = timerlat_aa_get_data(taa_ctx, record->cpu); in timerlat_aa_handler()
247 return -1; in timerlat_aa_handler()
257 * timerlat_aa_nmi_handler - Handles NMI noise
266 struct timerlat_aa_data *taa_data = timerlat_aa_get_data(taa_ctx, record->cpu); in timerlat_aa_nmi_handler()
273 if (taa_data->curr_state == TIMERLAT_WAITING_IRQ) { in timerlat_aa_nmi_handler()
274 taa_data->prev_irq_duration = duration; in timerlat_aa_nmi_handler()
275 taa_data->prev_irq_timstamp = start; in timerlat_aa_nmi_handler()
277 trace_seq_reset(taa_data->prev_irqs_seq); in timerlat_aa_nmi_handler()
278 trace_seq_printf(taa_data->prev_irqs_seq, " %24s %.*s %9.2f us\n", in timerlat_aa_nmi_handler()
285 taa_data->thread_nmi_sum += duration; in timerlat_aa_nmi_handler()
286 trace_seq_printf(taa_data->nmi_seq, " %24s %.*s %9.2f us\n", in timerlat_aa_nmi_handler()
294 * timerlat_aa_irq_handler - Handles IRQ noise
300 * - The IRQs that can delay the timer IRQ before it happened.
301 * - The Timerlat IRQ handler
302 * - The IRQs that happened between the timerlat IRQ and the timerlat thread
309 struct timerlat_aa_data *taa_data = timerlat_aa_get_data(taa_ctx, record->cpu); in timerlat_aa_irq_handler()
325 if (taa_data->curr_state == TIMERLAT_WAITING_IRQ) { in timerlat_aa_irq_handler()
326 taa_data->prev_irq_duration = duration; in timerlat_aa_irq_handler()
327 taa_data->prev_irq_timstamp = start; in timerlat_aa_irq_handler()
329 trace_seq_reset(taa_data->prev_irqs_seq); in timerlat_aa_irq_handler()
330 trace_seq_printf(taa_data->prev_irqs_seq, " %24s:%-3llu %.*s %9.2f us\n", in timerlat_aa_irq_handler()
338 * The timerlat IRQ: taa_data->timer_irq_start_time is zeroed at in timerlat_aa_irq_handler()
341 if (!taa_data->timer_irq_start_time) { in timerlat_aa_irq_handler()
342 expected_start = taa_data->tlat_irq_timstamp - taa_data->tlat_irq_latency; in timerlat_aa_irq_handler()
344 taa_data->timer_irq_start_time = start; in timerlat_aa_irq_handler()
345 taa_data->timer_irq_duration = duration; in timerlat_aa_irq_handler()
360 if (expected_start < taa_data->timer_irq_start_time) in timerlat_aa_irq_handler()
361 taa_data->timer_irq_start_delay = taa_data->timer_irq_start_time - expected_start; in timerlat_aa_irq_handler()
363 taa_data->timer_irq_start_delay = 0; in timerlat_aa_irq_handler()
366 * not exit from idle. in timerlat_aa_irq_handler()
368 if (taa_data->run_thread_pid) in timerlat_aa_irq_handler()
371 if (expected_start > taa_data->prev_irq_timstamp + taa_data->prev_irq_duration) in timerlat_aa_irq_handler()
372 taa_data->timer_exit_from_idle = taa_data->timer_irq_start_delay; in timerlat_aa_irq_handler()
380 taa_data->thread_irq_sum += duration; in timerlat_aa_irq_handler()
381 trace_seq_printf(taa_data->irqs_seq, " %24s:%-3llu %.*s %9.2f us\n", in timerlat_aa_irq_handler()
394 * timerlat_aa_softirq_handler - Handles Softirq noise
399 * It is only printed in the non-rt kernel, as softirqs become thread on RT.
405 struct timerlat_aa_data *taa_data = timerlat_aa_get_data(taa_ctx, record->cpu); in timerlat_aa_softirq_handler()
410 if (taa_data->curr_state == TIMERLAT_WAITING_IRQ) in timerlat_aa_softirq_handler()
417 taa_data->thread_softirq_sum += duration; in timerlat_aa_softirq_handler()
419 trace_seq_printf(taa_data->softirqs_seq, " %24s:%-3llu %.*s %9.2f us\n", in timerlat_aa_softirq_handler()
427 * timerlat_aa_softirq_handler - Handles thread noise
438 struct timerlat_aa_data *taa_data = timerlat_aa_get_data(taa_ctx, record->cpu); in timerlat_aa_thread_handler()
445 if (taa_data->curr_state == TIMERLAT_WAITING_IRQ) in timerlat_aa_thread_handler()
454 if (pid == taa_data->run_thread_pid && !taa_data->thread_blocking_duration) { in timerlat_aa_thread_handler()
455 taa_data->thread_blocking_duration = duration; in timerlat_aa_thread_handler()
458 strncpy(taa_data->run_thread_comm, comm, MAX_COMM); in timerlat_aa_thread_handler()
460 sprintf(taa_data->run_thread_comm, "<...>"); in timerlat_aa_thread_handler()
463 taa_data->thread_thread_sum += duration; in timerlat_aa_thread_handler()
465 trace_seq_printf(taa_data->threads_seq, " %24s:%-12llu %.*s %9.2f us\n", in timerlat_aa_thread_handler()
475 * timerlat_aa_stack_handler - Handles timerlat IRQ stack trace
483 struct timerlat_aa_data *taa_data = timerlat_aa_get_data(taa_ctx, record->cpu); in timerlat_aa_stack_handler()
488 trace_seq_reset(taa_data->stack_seq); in timerlat_aa_stack_handler()
490 trace_seq_printf(taa_data->stack_seq, " Blocking thread stack trace\n"); in timerlat_aa_stack_handler()
494 function = tep_find_function(taa_ctx->tool->trace.tep, caller[i]); in timerlat_aa_stack_handler()
497 trace_seq_printf(taa_data->stack_seq, " %.*s -> %s\n", in timerlat_aa_stack_handler()
505 * timerlat_aa_sched_switch_handler - Tracks the current thread running on the CPU
515 struct timerlat_aa_data *taa_data = timerlat_aa_get_data(taa_ctx, record->cpu); in timerlat_aa_sched_switch_handler()
519 tep_get_field_val(s, event, "next_pid", record, &taa_data->current_pid, 1); in timerlat_aa_sched_switch_handler()
522 strncpy(taa_data->current_comm, comm, MAX_COMM); in timerlat_aa_sched_switch_handler()
527 taa_data->kworker = 0; in timerlat_aa_sched_switch_handler()
528 taa_data->kworker_func = 0; in timerlat_aa_sched_switch_handler()
534 * timerlat_aa_kworker_start_handler - Tracks a kworker running on the CPU
546 struct timerlat_aa_data *taa_data = timerlat_aa_get_data(taa_ctx, record->cpu); in timerlat_aa_kworker_start_handler()
548 tep_get_field_val(s, event, "work", record, &taa_data->kworker, 1); in timerlat_aa_kworker_start_handler()
549 tep_get_field_val(s, event, "function", record, &taa_data->kworker_func, 1); in timerlat_aa_kworker_start_handler()
554 * timerlat_thread_analysis - Prints the analysis of a CPU that hit a stop tracing
566 * IRQ latency or Thread latency? in timerlat_thread_analysis()
568 if (taa_data->tlat_irq_seqnum > taa_data->tlat_thread_seqnum) { in timerlat_thread_analysis()
570 total = taa_data->tlat_irq_latency; in timerlat_thread_analysis()
573 total = taa_data->tlat_thread_latency; in timerlat_thread_analysis()
581 exp_irq_ts = taa_data->timer_irq_start_time - taa_data->timer_irq_start_delay; in timerlat_thread_analysis()
582 if (exp_irq_ts < taa_data->prev_irq_timstamp + taa_data->prev_irq_duration) { in timerlat_thread_analysis()
583 if (taa_data->prev_irq_timstamp < taa_data->timer_irq_start_time) in timerlat_thread_analysis()
584 printf(" Previous IRQ interference: %.*s up to %9.2f us\n", in timerlat_thread_analysis()
586 ns_to_usf(taa_data->prev_irq_duration)); in timerlat_thread_analysis()
592 printf(" IRQ handler delay: %.*s %16s %9.2f us (%.2f %%)\n", 16, spaces, in timerlat_thread_analysis()
593 (ns_to_usf(taa_data->timer_exit_from_idle) > 10) ? "(exit from idle)" : "", in timerlat_thread_analysis()
594 ns_to_usf(taa_data->timer_irq_start_delay), in timerlat_thread_analysis()
595 ns_to_per(total, taa_data->timer_irq_start_delay)); in timerlat_thread_analysis()
600 printf(" IRQ latency: %.*s %9.2f us\n", 40, spaces, in timerlat_thread_analysis()
601 ns_to_usf(taa_data->tlat_irq_latency)); in timerlat_thread_analysis()
606 * because... the trace stopped :-). in timerlat_thread_analysis()
612 printf(" %.*s %24s:%-9llu\n", 6, spaces, taa_data->run_thread_comm, in timerlat_thread_analysis()
613 taa_data->run_thread_pid); in timerlat_thread_analysis()
618 printf(" Timerlat IRQ duration: %.*s %9.2f us (%.2f %%)\n", in timerlat_thread_analysis()
620 ns_to_usf(taa_data->timer_irq_duration), in timerlat_thread_analysis()
621 ns_to_per(total, taa_data->timer_irq_duration)); in timerlat_thread_analysis()
629 printf(" Blocking thread: %.*s %9.2f us (%.2f %%)\n", 36, spaces, in timerlat_thread_analysis()
630 ns_to_usf(taa_data->thread_blocking_duration), in timerlat_thread_analysis()
631 ns_to_per(total, taa_data->thread_blocking_duration)); in timerlat_thread_analysis()
633 printf(" %.*s %24s:%-9llu %.*s %9.2f us\n", 6, spaces, in timerlat_thread_analysis()
634 taa_data->run_thread_comm, taa_data->run_thread_pid, in timerlat_thread_analysis()
635 12, spaces, ns_to_usf(taa_data->thread_blocking_duration)); in timerlat_thread_analysis()
641 trace_seq_do_printf(taa_data->stack_seq); in timerlat_thread_analysis()
646 if (taa_data->thread_nmi_sum) in timerlat_thread_analysis()
647 printf(" NMI interference %.*s %9.2f us (%.2f %%)\n", 36, spaces, in timerlat_thread_analysis()
648 ns_to_usf(taa_data->thread_nmi_sum), in timerlat_thread_analysis()
649 ns_to_per(total, taa_data->thread_nmi_sum)); in timerlat_thread_analysis()
652 * If it is an IRQ latency, the other factors can be skipped. in timerlat_thread_analysis()
658 * Prints the interference caused by IRQs to the thread latency. in timerlat_thread_analysis()
660 if (taa_data->thread_irq_sum) { in timerlat_thread_analysis()
661 printf(" IRQ interference %.*s %9.2f us (%.2f %%)\n", 36, spaces, in timerlat_thread_analysis()
662 ns_to_usf(taa_data->thread_irq_sum), in timerlat_thread_analysis()
663 ns_to_per(total, taa_data->thread_irq_sum)); in timerlat_thread_analysis()
665 trace_seq_do_printf(taa_data->irqs_seq); in timerlat_thread_analysis()
669 * Prints the interference caused by Softirqs to the thread latency. in timerlat_thread_analysis()
671 if (taa_data->thread_softirq_sum) { in timerlat_thread_analysis()
672 printf(" Softirq interference %.*s %9.2f us (%.2f %%)\n", 32, spaces, in timerlat_thread_analysis()
673 ns_to_usf(taa_data->thread_softirq_sum), in timerlat_thread_analysis()
674 ns_to_per(total, taa_data->thread_softirq_sum)); in timerlat_thread_analysis()
676 trace_seq_do_printf(taa_data->softirqs_seq); in timerlat_thread_analysis()
680 * Prints the interference caused by other threads to the thread latency. in timerlat_thread_analysis()
684 * latency" only, and here is the difference from scheduling latency and in timerlat_thread_analysis()
685 * timer handling latency. in timerlat_thread_analysis()
687 if (taa_data->thread_thread_sum) { in timerlat_thread_analysis()
688 printf(" Thread interference %.*s %9.2f us (%.2f %%)\n", 33, spaces, in timerlat_thread_analysis()
689 ns_to_usf(taa_data->thread_thread_sum), in timerlat_thread_analysis()
690 ns_to_per(total, taa_data->thread_thread_sum)); in timerlat_thread_analysis()
692 trace_seq_do_printf(taa_data->threads_seq); in timerlat_thread_analysis()
699 printf("------------------------------------------------------------------------\n"); in timerlat_thread_analysis()
700 printf(" %s latency: %.*s %9.2f us (100%%)\n", irq ? " IRQ" : "Thread", in timerlat_thread_analysis()
706 struct trace_instance *trace = &taa_ctx->tool->trace; in timerlat_auto_analysis_collect_trace()
709 retval = tracefs_iterate_raw_events(trace->tep, in timerlat_auto_analysis_collect_trace()
710 trace->inst, in timerlat_auto_analysis_collect_trace()
724 * timerlat_auto_analysis - Analyze the collected data
741 for (cpu = 0; cpu < taa_ctx->nr_cpus; cpu++) { in timerlat_auto_analysis()
744 if (irq_thresh && taa_data->tlat_irq_latency >= irq_thresh) { in timerlat_auto_analysis()
747 } else if (thread_thresh && (taa_data->tlat_thread_latency) >= thread_thresh) { in timerlat_auto_analysis()
752 if (taa_data->max_exit_idle_latency > max_exit_from_idle) { in timerlat_auto_analysis()
753 max_exit_from_idle = taa_data->max_exit_idle_latency; in timerlat_auto_analysis()
761 printf("Max timerlat IRQ latency from idle: %.2f us in cpu %d\n", in timerlat_auto_analysis()
764 if (!taa_ctx->dump_tasks) in timerlat_auto_analysis()
769 for (cpu = 0; cpu < taa_ctx->nr_cpus; cpu++) { in timerlat_auto_analysis()
771 tep = taa_ctx->tool->trace.tep; in timerlat_auto_analysis()
773 printf(" [%.3d] %24s:%llu", cpu, taa_data->current_comm, taa_data->current_pid); in timerlat_auto_analysis()
775 if (taa_data->kworker_func) in timerlat_auto_analysis()
777 tep_find_function(tep, taa_data->kworker) ? : "<...>", in timerlat_auto_analysis()
778 tep_find_function(tep, taa_data->kworker_func)); in timerlat_auto_analysis()
785 * timerlat_aa_destroy_seqs - Destroy seq files used to store parsed data
792 if (!taa_ctx->taa_data) in timerlat_aa_destroy_seqs()
795 for (i = 0; i < taa_ctx->nr_cpus; i++) { in timerlat_aa_destroy_seqs()
798 if (taa_data->prev_irqs_seq) { in timerlat_aa_destroy_seqs()
799 trace_seq_destroy(taa_data->prev_irqs_seq); in timerlat_aa_destroy_seqs()
800 free(taa_data->prev_irqs_seq); in timerlat_aa_destroy_seqs()
803 if (taa_data->nmi_seq) { in timerlat_aa_destroy_seqs()
804 trace_seq_destroy(taa_data->nmi_seq); in timerlat_aa_destroy_seqs()
805 free(taa_data->nmi_seq); in timerlat_aa_destroy_seqs()
808 if (taa_data->irqs_seq) { in timerlat_aa_destroy_seqs()
809 trace_seq_destroy(taa_data->irqs_seq); in timerlat_aa_destroy_seqs()
810 free(taa_data->irqs_seq); in timerlat_aa_destroy_seqs()
813 if (taa_data->softirqs_seq) { in timerlat_aa_destroy_seqs()
814 trace_seq_destroy(taa_data->softirqs_seq); in timerlat_aa_destroy_seqs()
815 free(taa_data->softirqs_seq); in timerlat_aa_destroy_seqs()
818 if (taa_data->threads_seq) { in timerlat_aa_destroy_seqs()
819 trace_seq_destroy(taa_data->threads_seq); in timerlat_aa_destroy_seqs()
820 free(taa_data->threads_seq); in timerlat_aa_destroy_seqs()
823 if (taa_data->stack_seq) { in timerlat_aa_destroy_seqs()
824 trace_seq_destroy(taa_data->stack_seq); in timerlat_aa_destroy_seqs()
825 free(taa_data->stack_seq); in timerlat_aa_destroy_seqs()
831 * timerlat_aa_init_seqs - Init seq files used to store parsed information
838 * Returns 0 on success, -1 otherwise.
845 for (i = 0; i < taa_ctx->nr_cpus; i++) { in timerlat_aa_init_seqs()
849 taa_data->prev_irqs_seq = calloc(1, sizeof(*taa_data->prev_irqs_seq)); in timerlat_aa_init_seqs()
850 if (!taa_data->prev_irqs_seq) in timerlat_aa_init_seqs()
853 trace_seq_init(taa_data->prev_irqs_seq); in timerlat_aa_init_seqs()
855 taa_data->nmi_seq = calloc(1, sizeof(*taa_data->nmi_seq)); in timerlat_aa_init_seqs()
856 if (!taa_data->nmi_seq) in timerlat_aa_init_seqs()
859 trace_seq_init(taa_data->nmi_seq); in timerlat_aa_init_seqs()
861 taa_data->irqs_seq = calloc(1, sizeof(*taa_data->irqs_seq)); in timerlat_aa_init_seqs()
862 if (!taa_data->irqs_seq) in timerlat_aa_init_seqs()
865 trace_seq_init(taa_data->irqs_seq); in timerlat_aa_init_seqs()
867 taa_data->softirqs_seq = calloc(1, sizeof(*taa_data->softirqs_seq)); in timerlat_aa_init_seqs()
868 if (!taa_data->softirqs_seq) in timerlat_aa_init_seqs()
871 trace_seq_init(taa_data->softirqs_seq); in timerlat_aa_init_seqs()
873 taa_data->threads_seq = calloc(1, sizeof(*taa_data->threads_seq)); in timerlat_aa_init_seqs()
874 if (!taa_data->threads_seq) in timerlat_aa_init_seqs()
877 trace_seq_init(taa_data->threads_seq); in timerlat_aa_init_seqs()
879 taa_data->stack_seq = calloc(1, sizeof(*taa_data->stack_seq)); in timerlat_aa_init_seqs()
880 if (!taa_data->stack_seq) in timerlat_aa_init_seqs()
883 trace_seq_init(taa_data->stack_seq); in timerlat_aa_init_seqs()
890 return -1; in timerlat_aa_init_seqs()
894 * timerlat_aa_unregister_events - Unregister events used in the auto-analysis
899 tep_unregister_event_handler(tool->trace.tep, -1, "ftrace", "timerlat", in timerlat_aa_unregister_events()
902 tracefs_event_disable(tool->trace.inst, "osnoise", NULL); in timerlat_aa_unregister_events()
904 tep_unregister_event_handler(tool->trace.tep, -1, "osnoise", "nmi_noise", in timerlat_aa_unregister_events()
907 tep_unregister_event_handler(tool->trace.tep, -1, "osnoise", "irq_noise", in timerlat_aa_unregister_events()
910 tep_unregister_event_handler(tool->trace.tep, -1, "osnoise", "softirq_noise", in timerlat_aa_unregister_events()
913 tep_unregister_event_handler(tool->trace.tep, -1, "osnoise", "thread_noise", in timerlat_aa_unregister_events()
916 tep_unregister_event_handler(tool->trace.tep, -1, "ftrace", "kernel_stack", in timerlat_aa_unregister_events()
921 tracefs_event_disable(tool->trace.inst, "sched", "sched_switch"); in timerlat_aa_unregister_events()
922 tep_unregister_event_handler(tool->trace.tep, -1, "sched", "sched_switch", in timerlat_aa_unregister_events()
925 tracefs_event_disable(tool->trace.inst, "workqueue", "workqueue_execute_start"); in timerlat_aa_unregister_events()
926 tep_unregister_event_handler(tool->trace.tep, -1, "workqueue", "workqueue_execute_start", in timerlat_aa_unregister_events()
931 * timerlat_aa_register_events - Register events used in the auto-analysis
933 * Returns 0 on success, -1 otherwise.
939 tep_register_event_handler(tool->trace.tep, -1, "ftrace", "timerlat", in timerlat_aa_register_events()
944 * register auto-analysis handlers. in timerlat_aa_register_events()
946 retval = tracefs_event_enable(tool->trace.inst, "osnoise", NULL); in timerlat_aa_register_events()
952 tep_register_event_handler(tool->trace.tep, -1, "osnoise", "nmi_noise", in timerlat_aa_register_events()
955 tep_register_event_handler(tool->trace.tep, -1, "osnoise", "irq_noise", in timerlat_aa_register_events()
958 tep_register_event_handler(tool->trace.tep, -1, "osnoise", "softirq_noise", in timerlat_aa_register_events()
961 tep_register_event_handler(tool->trace.tep, -1, "osnoise", "thread_noise", in timerlat_aa_register_events()
964 tep_register_event_handler(tool->trace.tep, -1, "ftrace", "kernel_stack", in timerlat_aa_register_events()
973 retval = tracefs_event_enable(tool->trace.inst, "sched", "sched_switch"); in timerlat_aa_register_events()
979 tep_register_event_handler(tool->trace.tep, -1, "sched", "sched_switch", in timerlat_aa_register_events()
982 retval = tracefs_event_enable(tool->trace.inst, "workqueue", "workqueue_execute_start"); in timerlat_aa_register_events()
988 tep_register_event_handler(tool->trace.tep, -1, "workqueue", "workqueue_execute_start", in timerlat_aa_register_events()
995 return -1; in timerlat_aa_register_events()
999 * timerlat_aa_destroy - Destroy timerlat auto-analysis
1008 if (!taa_ctx->taa_data) in timerlat_aa_destroy()
1011 timerlat_aa_unregister_events(taa_ctx->tool, taa_ctx->dump_tasks); in timerlat_aa_destroy()
1013 free(taa_ctx->taa_data); in timerlat_aa_destroy()
1019 * timerlat_aa_init - Initialize timerlat auto-analysis
1021 * Returns 0 on success, -1 otherwise.
1031 return -1; in timerlat_aa_init()
1035 taa_ctx->nr_cpus = nr_cpus; in timerlat_aa_init()
1036 taa_ctx->tool = tool; in timerlat_aa_init()
1037 taa_ctx->dump_tasks = dump_tasks; in timerlat_aa_init()
1039 taa_ctx->taa_data = calloc(nr_cpus, sizeof(*taa_ctx->taa_data)); in timerlat_aa_init()
1040 if (!taa_ctx->taa_data) in timerlat_aa_init()
1055 return -1; in timerlat_aa_init()