Commit b6304e66 authored by Anas Nashif's avatar Anas Nashif
Browse files

tracing: support generic tracing hooks



Define generic interface and hooks for tracing to replace
kernel_event_logger and existing tracing facilities with something more
common.

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent 9038416b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -113,9 +113,9 @@ SECTION_FUNC(TEXT, _NanoIdleValClear)
 */

SECTION_FUNC(TEXT, k_cpu_idle)
#ifdef CONFIG_KERNEL_EVENT_LOGGER_SLEEP
#ifdef CONFIG_TRACING
	push {lr}
	bl    _sys_k_event_logger_enter_sleep
	bl    sys_trace_idle
	pop {r0}
	mov lr, r0
#endif
@@ -157,9 +157,9 @@ SECTION_FUNC(TEXT, k_cpu_idle)
 */

SECTION_FUNC(TEXT, k_cpu_atomic_idle)
#ifdef CONFIG_KERNEL_EVENT_LOGGER_SLEEP
#ifdef CONFIG_TRACING
	push {lr}
	bl    _sys_k_event_logger_enter_sleep
	bl    sys_trace_idle
	pop {r1}
	mov lr, r1
#endif
+2 −7
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#include <sw_isr_table.h>
#include <irq.h>
#include <kernel_structs.h>
#include <logging/kernel_event_logger.h>
#include <tracing.h>

extern void __reserved(void);

@@ -137,7 +137,6 @@ void _irq_spurious(void *unused)
 * arch/cpu.h and kernel_structs.h; the inline functions typically need to
 * perform operations on _kernel.  For now, leave as regular functions, a
 * future iteration will resolve this.
 * We have a similar issue with the k_event_logger functions.
 *
 * See https://github.com/zephyrproject-rtos/zephyr/issues/3056
 */
@@ -178,14 +177,10 @@ void _arch_isr_direct_pm(void)
}
#endif

#if defined(CONFIG_KERNEL_EVENT_LOGGER_SLEEP) || \
	defined(CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT)
void _arch_isr_direct_header(void)
{
	_sys_k_event_logger_interrupt();
	_sys_k_event_logger_exit_sleep();
	sys_trace_isr_enter();
}
#endif

#if defined(CONFIG_ARM_SECURE_FIRMWARE)
/**
+2 −6
Original line number Diff line number Diff line
@@ -47,12 +47,8 @@ SECTION_FUNC(TEXT, _isr_wrapper)
	bl read_timer_start_of_isr
#endif

#ifdef CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT
	bl _sys_k_event_logger_interrupt
#endif

#ifdef CONFIG_KERNEL_EVENT_LOGGER_SLEEP
	bl _sys_k_event_logger_exit_sleep
#ifdef CONFIG_TRACING
	bl sys_trace_isr_enter
#endif

#ifdef CONFIG_SYS_POWER_MANAGEMENT
+2 −2
Original line number Diff line number Diff line
@@ -43,10 +43,10 @@ GDATA(_kernel)

SECTION_FUNC(TEXT, __pendsv)

#ifdef CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH
#ifdef CONFIG_TRACING
    /* Register the context switch */
    push {lr}
    bl _sys_k_event_logger_context_switch
    bl sys_trace_thread_switched_in
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
    pop {r0}
    mov lr, r0
+2 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ void _arch_irq_direct_pm(void)
void _arch_isr_direct_header(void)
{
	_int_latency_start();
	sys_trace_isr_enter();
	_sys_k_event_logger_interrupt();
	_sys_k_event_logger_exit_sleep();

@@ -76,6 +77,7 @@ void _arch_isr_direct_footer(int swap)
{
	_irq_controller_eoi();
	_int_latency_stop();
	sys_trace_isr_exit();
	--_kernel.nested;

	/* Call swap if all the following is true:
Loading