tools/tracing/rtla/src/timerlat_aa.c
Source file repositories/reference/linux-study-clean/tools/tracing/rtla/src/timerlat_aa.c
File Facts
- System
- Linux kernel
- Corpus path
tools/tracing/rtla/src/timerlat_aa.c- Extension
.c- Size
- 30766 bytes
- Lines
- 1076
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdlib.herrno.htimerlat.hunistd.h
Detected Declarations
struct timerlat_aa_datastruct timerlat_aa_contextenum timelat_statefunction timerlat_aa_irq_latencyfunction timerlat_aa_thread_latencyfunction timerlat_aa_handlerfunction timerlat_aa_nmi_handlerfunction timerlat_aa_irq_handlerfunction timerlat_aa_softirq_handlerfunction timerlat_aa_thread_handlerfunction timerlat_aa_stack_handlerfunction timerlat_aa_sched_switch_handlerfunction timerlat_aa_kworker_start_handlerfunction timerlat_thread_analysisfunction timerlat_auto_analysis_collect_tracefunction timerlat_auto_analysisfunction timerlat_aa_destroy_seqsfunction timerlat_aa_init_seqsfunction timerlat_aa_unregister_eventsfunction timerlat_aa_register_eventsfunction timerlat_aa_destroyfunction timerlat_aa_init
Annotated Snippet
struct timerlat_aa_data {
/* Current CPU state */
int curr_state;
/* timerlat IRQ latency */
unsigned long long tlat_irq_seqnum;
unsigned long long tlat_irq_latency;
unsigned long long tlat_irq_timstamp;
/* timerlat Thread latency */
unsigned long long tlat_thread_seqnum;
unsigned long long tlat_thread_latency;
unsigned long long tlat_thread_timstamp;
/*
* Information about the thread running when the IRQ
* arrived.
*
* This can be blocking or interference, depending on the
* priority of the thread. Assuming timerlat is the highest
* prio, it is blocking. If timerlat has a lower prio, it is
* interference.
* note: "unsigned long long" because they are fetch using tep_get_field_val();
*/
unsigned long long run_thread_pid;
char run_thread_comm[MAX_COMM];
unsigned long long thread_blocking_duration;
unsigned long long max_exit_idle_latency;
/* Information about the timerlat timer irq */
unsigned long long timer_irq_start_time;
unsigned long long timer_irq_start_delay;
unsigned long long timer_irq_duration;
unsigned long long timer_exit_from_idle;
/*
* Information about the last IRQ before the timerlat irq
* arrived.
*
* If now - timestamp is <= latency, it might have influenced
* in the timerlat irq latency. Otherwise, ignore it.
*/
unsigned long long prev_irq_duration;
unsigned long long prev_irq_timstamp;
/*
* Interference sum.
*/
unsigned long long thread_nmi_sum;
unsigned long long thread_irq_sum;
unsigned long long thread_softirq_sum;
unsigned long long thread_thread_sum;
/*
* Interference task information.
*/
struct trace_seq *prev_irqs_seq;
struct trace_seq *nmi_seq;
struct trace_seq *irqs_seq;
struct trace_seq *softirqs_seq;
struct trace_seq *threads_seq;
struct trace_seq *stack_seq;
/*
* Current thread.
*/
char current_comm[MAX_COMM];
unsigned long long current_pid;
/*
* Is the system running a kworker?
*/
unsigned long long kworker;
unsigned long long kworker_func;
};
/*
* The analysis context and system wide view
*/
struct timerlat_aa_context {
int dump_tasks;
enum stack_format stack_format;
/* per CPU data */
struct timerlat_aa_data *taa_data;
/*
* required to translate function names and register
* events.
*/
Annotation
- Immediate include surface: `stdlib.h`, `errno.h`, `timerlat.h`, `unistd.h`.
- Detected declarations: `struct timerlat_aa_data`, `struct timerlat_aa_context`, `enum timelat_state`, `function timerlat_aa_irq_latency`, `function timerlat_aa_thread_latency`, `function timerlat_aa_handler`, `function timerlat_aa_nmi_handler`, `function timerlat_aa_irq_handler`, `function timerlat_aa_softirq_handler`, `function timerlat_aa_thread_handler`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.