arch/x86/kernel/trace.c

Source file repositories/reference/linux-study-clean/arch/x86/kernel/trace.c

File Facts

System
Linux kernel
Corpus path
arch/x86/kernel/trace.c
Extension
.c
Size
7573 bytes
Lines
235
Domain
Architecture Layer
Bucket
arch/x86
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <asm/trace/irq_vectors.h>
#include <linux/trace.h>

#if defined(CONFIG_OSNOISE_TRACER) && defined(CONFIG_X86_LOCAL_APIC)
/*
 * trace_intel_irq_entry - record intel specific IRQ entry
 */
static void trace_intel_irq_entry(void *data, int vector)
{
	osnoise_trace_irq_entry(vector);
}

/*
 * trace_intel_irq_exit - record intel specific IRQ exit
 */
static void trace_intel_irq_exit(void *data, int vector)
{
	char *vector_desc = (char *) data;

	osnoise_trace_irq_exit(vector, vector_desc);
}

/*
 * register_intel_irq_tp - Register intel specific IRQ entry tracepoints
 */
int osnoise_arch_register(void)
{
	int ret;

	ret = register_trace_local_timer_entry(trace_intel_irq_entry, NULL);
	if (ret)
		goto out_err;

	ret = register_trace_local_timer_exit(trace_intel_irq_exit, "local_timer");
	if (ret)
		goto out_timer_entry;

#ifdef CONFIG_X86_THERMAL_VECTOR
	ret = register_trace_thermal_apic_entry(trace_intel_irq_entry, NULL);
	if (ret)
		goto out_timer_exit;

	ret = register_trace_thermal_apic_exit(trace_intel_irq_exit, "thermal_apic");
	if (ret)
		goto out_thermal_entry;
#endif /* CONFIG_X86_THERMAL_VECTOR */

#ifdef CONFIG_X86_MCE_AMD
	ret = register_trace_deferred_error_apic_entry(trace_intel_irq_entry, NULL);
	if (ret)
		goto out_thermal_exit;

	ret = register_trace_deferred_error_apic_exit(trace_intel_irq_exit, "deferred_error");
	if (ret)
		goto out_deferred_entry;
#endif

#ifdef CONFIG_X86_MCE_THRESHOLD
	ret = register_trace_threshold_apic_entry(trace_intel_irq_entry, NULL);
	if (ret)
		goto out_deferred_exit;

	ret = register_trace_threshold_apic_exit(trace_intel_irq_exit, "threshold_apic");
	if (ret)
		goto out_threshold_entry;
#endif /* CONFIG_X86_MCE_THRESHOLD */

#ifdef CONFIG_SMP
	ret = register_trace_call_function_single_entry(trace_intel_irq_entry, NULL);
	if (ret)
		goto out_threshold_exit;

	ret = register_trace_call_function_single_exit(trace_intel_irq_exit,
						       "call_function_single");
	if (ret)
		goto out_call_function_single_entry;

	ret = register_trace_call_function_entry(trace_intel_irq_entry, NULL);
	if (ret)
		goto out_call_function_single_exit;

	ret = register_trace_call_function_exit(trace_intel_irq_exit, "call_function");
	if (ret)
		goto out_call_function_entry;

	ret = register_trace_reschedule_entry(trace_intel_irq_entry, NULL);
	if (ret)
		goto out_call_function_exit;

	ret = register_trace_reschedule_exit(trace_intel_irq_exit, "reschedule");

Annotation

Implementation Notes