Skip to content

Commit 6e27478

Browse files
nashifMaureenHelm
authored andcommitted
benchmarking: remove execution benchmarking code
This code had one purpose only, feed timing information into a test and was not used by anything else. The custom trace points unfortunatly were not accurate and this test was delivering informatin that conflicted with other tests we have due to placement of such trace points in the architecture and kernel code. For such measurements we are planning to use the tracing functionality in a special mode that would be used for metrics without polluting the architecture and kernel code with additional tracing and timing code. Furthermore, much of the assembly code used had issues. Signed-off-by: Anas Nashif <[email protected]> Signed-off-by: Daniel Leung <[email protected]>
1 parent 150c82c commit 6e27478

File tree

29 files changed

+6
-550
lines changed

29 files changed

+6
-550
lines changed

arch/arc/core/isr_wrapper.S

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,6 @@ SECTION_FUNC(TEXT, _isr_demux)
275275
push r59
276276
#endif
277277

278-
#ifdef CONFIG_EXECUTION_BENCHMARKING
279-
bl read_timer_start_of_isr
280-
#endif
281-
282278
#if defined(CONFIG_TRACING_ISR)
283279
bl sys_trace_isr_enter
284280
#endif
@@ -299,13 +295,6 @@ irq_hint_handled:
299295
add3 r0, r1, r0 /* table entries are 8-bytes wide */
300296

301297
ld_s r1, [r0, 4] /* ISR into r1 */
302-
#ifdef CONFIG_EXECUTION_BENCHMARKING
303-
push_s r0
304-
push_s r1
305-
bl read_timer_end_of_isr
306-
pop_s r1
307-
pop_s r0
308-
#endif
309298
jl_s.d [r1]
310299
ld_s r0, [r0] /* delay slot: ISR parameter into r0 */
311300

arch/arc/core/switch.S

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,6 @@ GTEXT(z_arc_switch)
5454

5555
SECTION_FUNC(TEXT, z_arc_switch)
5656

57-
#ifdef CONFIG_EXECUTION_BENCHMARKING
58-
push_s r0
59-
push_s r1
60-
push_s blink
61-
62-
bl read_timer_start_of_swap
63-
64-
pop_s blink
65-
pop_s r1
66-
pop_s r0
67-
#endif
6857
/*
6958
* r0 = new_thread->switch_handle = switch_to thread,
7059
* r1 = &old_thread->switch_handle
@@ -125,13 +114,6 @@ _switch_return_from_coop:
125114
pop_s r3 /* status32 into r3 */
126115
kflag r3 /* write status32 */
127116

128-
#ifdef CONFIG_EXECUTION_BENCHMARKING
129-
push_s blink
130-
131-
bl read_timer_end_of_swap
132-
133-
pop_s blink
134-
#endif /* CONFIG_EXECUTION_BENCHMARKING */
135117
#ifdef CONFIG_TRACING
136118
push_s blink
137119

arch/arc/core/userspace.S

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ _arc_go_to_user_space:
179179
mov r30, 0
180180
mov blink, 0
181181

182-
#ifdef CONFIG_EXECUTION_BENCHMARKING
183-
bl read_timer_end_of_userspace_enter
184-
#endif
185-
186182
rtie
187183

188184
/**

arch/arm/core/aarch32/isr_wrapper.S

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,6 @@ SECTION_FUNC(TEXT, _isr_wrapper)
8080
str r0, [r2, #_kernel_offset_to_nested]
8181
#endif /* CONFIG_CPU_CORTEX_M */
8282

83-
#ifdef CONFIG_EXECUTION_BENCHMARKING
84-
bl read_timer_start_of_isr
85-
#endif
86-
8783
#ifdef CONFIG_TRACING_ISR
8884
bl sys_trace_isr_enter
8985
#endif
@@ -187,11 +183,6 @@ _idle_state_cleared:
187183
* in thumb mode */
188184

189185
ldm r1!,{r0,r3} /* arg in r0, ISR in r3 */
190-
#ifdef CONFIG_EXECUTION_BENCHMARKING
191-
push {r0, r3} /* Save r0 and r3 into stack */
192-
bl read_timer_end_of_isr
193-
pop {r0, r3} /* Restore r0 and r3 regs */
194-
#endif /* CONFIG_EXECUTION_BENCHMARKING */
195186
blx r3 /* call ISR */
196187

197188
#if defined(CONFIG_CPU_CORTEX_R)

arch/arm/core/aarch32/swap.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
#include <kernel.h>
88
#include <kernel_internal.h>
99

10-
#ifdef CONFIG_EXECUTION_BENCHMARKING
11-
extern void read_timer_start_of_swap(void);
12-
#endif
1310
extern const int _k_neg_eagain;
1411

1512
/* The 'key' actually represents the BASEPRI register
@@ -35,10 +32,6 @@ extern const int _k_neg_eagain;
3532
*/
3633
int arch_swap(unsigned int key)
3734
{
38-
#ifdef CONFIG_EXECUTION_BENCHMARKING
39-
read_timer_start_of_swap();
40-
#endif
41-
4235
/* store off key and return value */
4336
_current->arch.basepri = key;
4437
_current->arch.swap_return_value = _k_neg_eagain;

arch/arm/core/aarch32/swap_helper.S

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -337,18 +337,6 @@ _thread_irq_disabled:
337337
pop {r2, lr}
338338
#endif /* CONFIG_BUILTIN_STACK_GUARD */
339339

340-
#ifdef CONFIG_EXECUTION_BENCHMARKING
341-
push {r0, lr}
342-
bl read_timer_end_of_swap
343-
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
344-
pop {r0, r1}
345-
mov lr,r1
346-
#else
347-
pop {r0, lr}
348-
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
349-
350-
#endif /* CONFIG_EXECUTION_BENCHMARKING */
351-
352340
#ifdef CONFIG_TRACING
353341
/* Register the context switch */
354342
push {r0, lr}

arch/arm/core/aarch32/userspace.S

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -216,20 +216,6 @@ SECTION_FUNC(TEXT,z_arm_userspace_enter)
216216
/* restore r0 */
217217
mov r0, lr
218218

219-
#ifdef CONFIG_EXECUTION_BENCHMARKING
220-
stm sp!,{r0-r3} /* Save regs r0 to r4 on stack */
221-
push {r0, lr}
222-
bl read_timer_end_of_userspace_enter
223-
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
224-
pop {r0, r3}
225-
mov lr,r3
226-
#else
227-
pop {r0, lr}
228-
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
229-
ldm sp!,{r0-r3} /* Restore r0 to r3 regs */
230-
231-
#endif /* CONFIG_EXECUTION_BENCHMARKING */
232-
233219
/* change processor mode to unprivileged */
234220
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
235221
push {r0, r1, r2, r3}

arch/common/CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
if(CONFIG_GEN_ISR_TABLES OR CONFIG_EXECUTION_BENCHMARKING)
3+
if(CONFIG_GEN_ISR_TABLES)
44
zephyr_library()
55

66
zephyr_library_sources_ifdef(
77
CONFIG_GEN_ISR_TABLES
88
sw_isr_common.c
99
)
10-
11-
zephyr_library_sources_ifdef(
12-
CONFIG_EXECUTION_BENCHMARKING
13-
timing_info_bench.c
14-
)
1510
endif()
1611

1712
if(NOT CONFIG_ARCH_HAS_TIMING_FUNCTIONS AND

arch/common/timing_info_bench.c

Lines changed: 0 additions & 135 deletions
This file was deleted.

arch/nios2/core/irq_manage.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ void _enter_irq(uint32_t ipending)
8080
{
8181
int index;
8282

83-
#ifdef CONFIG_EXECUTION_BENCHMARKING
84-
extern void read_timer_start_of_isr(void);
85-
read_timer_start_of_isr();
86-
#endif
87-
8883
_kernel.cpus[0].nested++;
8984

9085
#ifdef CONFIG_IRQ_OFFLOAD
@@ -103,10 +98,6 @@ void _enter_irq(uint32_t ipending)
10398

10499
ite = &_sw_isr_table[index];
105100

106-
#ifdef CONFIG_EXECUTION_BENCHMARKING
107-
extern void read_timer_end_of_isr(void);
108-
read_timer_end_of_isr();
109-
#endif
110101
ite->isr(ite->arg);
111102
#ifdef CONFIG_TRACING_ISR
112103
sys_trace_isr_exit();

0 commit comments

Comments
 (0)