Skip to content

Commit a224878

Browse files
committed
kernel: event_logger: remove kernel_event_logger
Move to more generic tracing hooks that can be implemented in different ways and do not interfere with the kernel. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1 parent 457fc79 commit a224878

File tree

39 files changed

+75
-1134
lines changed

39 files changed

+75
-1134
lines changed

arch/arc/core/cpu_idle.S

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ SECTION_VAR(BSS, k_cpu_sleep_mode)
3535

3636
SECTION_FUNC(TEXT, k_cpu_idle)
3737

38-
#ifdef CONFIG_KERNEL_EVENT_LOGGER_SLEEP
38+
#ifdef CONFIG_TRACING
3939
push_s blink
40-
jl _sys_k_event_logger_enter_sleep
40+
jl sys_trace_idle
4141
pop_s blink
4242
#endif
4343

@@ -56,9 +56,9 @@ SECTION_FUNC(TEXT, k_cpu_idle)
5656
*/
5757
SECTION_FUNC(TEXT, k_cpu_atomic_idle)
5858

59-
#ifdef CONFIG_KERNEL_EVENT_LOGGER_SLEEP
59+
#ifdef CONFIG_TRACING
6060
push_s blink
61-
jl _sys_k_event_logger_enter_sleep
61+
jl sys_trace_idle
6262
pop_s blink
6363
#endif
6464

arch/arc/core/isr_wrapper.S

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -332,29 +332,14 @@ rirq_path:
332332
j_s [r2]
333333
#endif
334334

335-
#ifdef CONFIG_KERNEL_EVENT_LOGGER_SLEEP
336-
GTEXT(_sys_k_event_logger_exit_sleep)
337-
338-
.macro log_sleep_k_event
339-
clri r0 /* do not interrupt event logger operations */
340-
push_s r0
341-
push_s blink
342-
jl _sys_k_event_logger_exit_sleep
343-
pop_s blink
344-
pop_s r0
345-
seti r0
346-
.endm
347-
#else
348-
#define log_sleep_k_event
349-
#endif
350-
#if defined(CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT)
351-
GTEXT(_sys_k_event_logger_interrupt)
335+
#if defined(CONFIG_TRACING)
336+
GTEXT(sys_trace_isr_enter)
352337

353338
.macro log_interrupt_k_event
354339
clri r0 /* do not interrupt event logger operations */
355340
push_s r0
356341
push_s blink
357-
jl _sys_k_event_logger_interrupt
342+
jl sys_trace_isr_enter
358343
pop_s blink
359344
pop_s r0
360345
seti r0
@@ -395,7 +380,6 @@ SECTION_FUNC(TEXT, _isr_demux)
395380
/* r0 is available to be stomped here, and exit_tickless_idle uses it */
396381
exit_tickless_idle
397382
log_interrupt_k_event
398-
log_sleep_k_event
399383

400384
lr r0, [_ARC_V2_ICAUSE]
401385
/* handle software triggered interrupt */

arch/arc/include/kernel_event_logger_arch.h renamed to arch/arc/include/tracing_arch.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* @brief Kernel event logger support for ARM
1010
*/
1111

12-
#ifndef __KERNEL_EVENT_LOGGER_ARCH_H__
13-
#define __KERNEL_EVENT_LOGGER_ARCH_H__
12+
#ifndef __KERNEL_TRACING_H__
13+
#define __KERNEL_TRACING_H__
1414

1515
#ifdef __cplusplus
1616
extern "C" {
@@ -33,4 +33,4 @@ int _sys_current_irq_key_get(void)
3333
}
3434
#endif
3535

36-
#endif /* __KERNEL_EVENT_LOGGER_ARCH_H__ */
36+
#endif /* __KERNEL_TRACING_H__ */

arch/arm/core/swap_helper.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ SECTION_FUNC(TEXT, __pendsv)
5353
#else
5454
pop {lr}
5555
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
56-
#endif /* CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH */
56+
#endif /* CONFIG_TRACING */
5757

5858
/* protect the kernel state while we play with the thread lists */
5959
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)

arch/arm/include/kernel_event_logger_arch.h renamed to arch/arm/include/tracing_arch.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* @brief Kernel event logger support for ARM
1010
*/
1111

12-
#ifndef __KERNEL_EVENT_LOGGER_ARCH_H__
13-
#define __KERNEL_EVENT_LOGGER_ARCH_H__
12+
#ifndef __KERNEL_TRACING_H__
13+
#define __KERNEL_TRACING_H__
1414

1515
#ifdef __cplusplus
1616
extern "C" {
@@ -34,4 +34,4 @@ int _sys_current_irq_key_get(void)
3434
}
3535
#endif
3636

37-
#endif /* __KERNEL_EVENT_LOGGER_ARCH_H__ */
37+
#endif /* __KERNEL_TRACING_H__ */

arch/nios2/core/irq_manage.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
#include <irq.h>
1818
#include <misc/printk.h>
1919
#include <sw_isr_table.h>
20-
#include <logging/kernel_event_logger.h>
2120
#include <ksched.h>
2221
#include <kswap.h>
22+
#include <tracing.h>
2323

2424
void _irq_spurious(void *unused)
2525
{
@@ -86,9 +86,7 @@ void _enter_irq(u32_t ipending)
8686
while (ipending) {
8787
struct _isr_table_entry *ite;
8888

89-
#ifdef CONFIG_KERNEL_EVENT_LOGGER_INTERRUPT
90-
_sys_k_event_logger_interrupt();
91-
#endif
89+
sys_trace_isr_enter();
9290

9391
index = find_lsb_set(ipending) - 1;
9492
ipending &= ~(1 << index);
@@ -100,6 +98,7 @@ void _enter_irq(u32_t ipending)
10098
read_timer_end_of_isr();
10199
#endif
102100
ite->isr(ite->arg);
101+
sys_trace_isr_exit();
103102
}
104103

105104
_kernel.nested--;

arch/nios2/core/swap.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ GTEXT(__swap)
1313
GTEXT(_thread_entry_wrapper)
1414

1515
/* imports */
16-
GTEXT(_sys_k_event_logger_context_switch)
16+
GTEXT(sys_trace_thread_switched_in)
1717
GTEXT(_k_neg_eagain)
1818

1919
/* unsigned int __swap(unsigned int key)
@@ -84,8 +84,8 @@ SECTION_FUNC(exception.other, __swap)
8484
ldw r4, (r5)
8585
stw r4, _thread_offset_to_retval(r11)
8686

87-
#if CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH
88-
call _sys_k_event_logger_context_switch
87+
#if CONFIG_TRACING
88+
call sys_trace_thread_switched_in
8989
/* restore caller-saved r10 */
9090
movhi r10, %hi(_kernel)
9191
ori r10, r10, %lo(_kernel)

arch/nios2/include/kernel_event_logger_arch.h renamed to arch/nios2/include/tracing_arch.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* @brief Kernel event logger support for Nios II
1010
*/
1111

12-
#ifndef __KERNEL_EVENT_LOGGER_ARCH_H__
13-
#define __KERNEL_EVENT_LOGGER_ARCH_H__
12+
#ifndef __KERNEL_TRACING_H__
13+
#define __KERNEL_TRACING_H__
1414

1515
#include <arch/cpu.h>
1616

@@ -38,4 +38,4 @@ static inline int _sys_current_irq_key_get(void)
3838
}
3939
#endif
4040

41-
#endif /* __KERNEL_EVENT_LOGGER_ARCH_H__ */
41+
#endif /* __KERNEL_TRACING_H__ */

arch/posix/core/cpuhalt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include "posix_core.h"
2121
#include "posix_soc_if.h"
22-
#include "logging/kernel_event_logger.h"
22+
#include <tracing.h>
2323

2424
/**
2525
*
@@ -35,7 +35,7 @@
3535
*/
3636
void k_cpu_idle(void)
3737
{
38-
_sys_k_event_logger_enter_sleep();
38+
sys_trace_idle();
3939
posix_irq_full_unlock();
4040
posix_halt_cpu();
4141
}
@@ -62,6 +62,6 @@ void k_cpu_idle(void)
6262

6363
void k_cpu_atomic_idle(unsigned int imask)
6464
{
65-
_sys_k_event_logger_enter_sleep();
65+
sys_trace_idle();
6666
posix_atomic_halt_cpu(imask);
6767
}

arch/posix/core/swap.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ unsigned int __swap(unsigned int key)
5050
_kernel.current->callee_saved.retval = -EAGAIN;
5151
/* retval may be modified with a call to _set_thread_return_value() */
5252

53-
#if CONFIG_KERNEL_EVENT_LOGGER_CONTEXT_SWITCH
54-
_sys_k_event_logger_context_switch();
55-
#endif
53+
sys_trace_thread_switched_in();
5654

5755
posix_thread_status_t *ready_thread_ptr =
5856
(posix_thread_status_t *)

0 commit comments

Comments
 (0)