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.

Dependency Surface

Detected Declarations

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

Implementation Notes