Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/bench_mutex_pingpong/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include ../Makefile.tests_common

USEMODULE += xtimer
USEMODULE += ztimer_usec

include $(RIOTBASE)/Makefile.include
8 changes: 5 additions & 3 deletions tests/bench_mutex_pingpong/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
#include "macros/units.h"
#include "clk.h"
#include "mutex.h"
#include "periph_conf.h" /* for CLOCK_CORECLOCK */
#include "thread.h"
#include "xtimer.h"
#include "timex.h"
#include "ztimer.h"

#ifndef TEST_DURATION
#define TEST_DURATION (1000000U)
Expand Down Expand Up @@ -68,12 +70,12 @@ int main(void)
mutex_lock(&_mutex);
thread_yield_higher();

xtimer_t timer;
ztimer_t timer;
timer.callback = _timer_callback;

uint32_t n = 0;

xtimer_set(&timer, TEST_DURATION);
ztimer_set(ZTIMER_USEC, &timer, TEST_DURATION);
while(!_flag) {
mutex_unlock(&_mutex);
n++;
Expand Down
2 changes: 1 addition & 1 deletion tests/bench_sched_nop/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include ../Makefile.tests_common

USEMODULE += xtimer
USEMODULE += ztimer_usec

include $(RIOTBASE)/Makefile.include
8 changes: 5 additions & 3 deletions tests/bench_sched_nop/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#include "clk.h"
#include "thread.h"

#include "xtimer.h"
#include "periph_conf.h"
#include "timex.h"
#include "ztimer.h"

#ifndef TEST_DURATION
#define TEST_DURATION (1000000U)
Expand All @@ -42,12 +44,12 @@ int main(void)
{
printf("main starting\n");

xtimer_t timer;
ztimer_t timer;
timer.callback = _timer_callback;

uint32_t n = 0;

xtimer_set(&timer, TEST_DURATION);
ztimer_set(ZTIMER_USEC, &timer, TEST_DURATION);
while(!_flag) {
thread_yield();
n++;
Expand Down
2 changes: 1 addition & 1 deletion tests/bench_sys_atomic_utils/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../Makefile.tests_common

USEMODULE += xtimer
USEMODULE += ztimer_usec
USEMODULE += atomic_utils
USEMODULE += test_utils_interactive_sync

Expand Down
3 changes: 2 additions & 1 deletion tests/bench_sys_atomic_utils/app.config.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# application configuration. This is only needed during migration.
CONFIG_MODULE_ATOMIC_UTILS=y
CONFIG_MODULE_TEST_UTILS_INTERACTIVE_SYNC=y
CONFIG_MODULE_XTIMER=y
CONFIG_MODULE_ZTIMER=y
CONFIG_ZTIMER_USEC=y
62 changes: 31 additions & 31 deletions tests/bench_sys_atomic_utils/main.c

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/bench_sys_base64/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ include ../Makefile.tests_common

USEMODULE += base64
USEMODULE += fmt
USEMODULE += xtimer
USEMODULE += ztimer_usec

include $(RIOTBASE)/Makefile.include
1 change: 1 addition & 0 deletions tests/bench_sys_base64/Makefile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ BOARD_INSUFFICIENT_MEMORY := \
arduino-uno \
atmega328p \
atmega328p-xplained-mini \
nucleo-l011k4 \
#
10 changes: 5 additions & 5 deletions tests/bench_sys_base64/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "base64.h"
#include "fmt.h"
#include "xtimer.h"
#include "ztimer.h"

#define MIN(a, b) (a < b) ? a : b

Expand Down Expand Up @@ -74,23 +74,23 @@ int main(void) {
print_str("OK\n");
}

start = xtimer_now_usec();
start = ztimer_now(ZTIMER_USEC);
for (unsigned i = 0; i < 1000; i++) {
size = sizeof(buf);
base64_encode(input, sizeof(input), buf, &size);
}
stop = xtimer_now_usec();
stop = ztimer_now(ZTIMER_USEC);

print_str("Encoding 1.000 x 96 bytes (128 bytes in base64): ");
print_u32_dec(stop - start);
print_str(" µs\n");

start = xtimer_now_usec();
start = ztimer_now(ZTIMER_USEC);
for (unsigned i = 0; i < 1000; i++) {
size = sizeof(buf);
base64_decode(base64, sizeof(base64), buf, &size);
}
stop = xtimer_now_usec();
stop = ztimer_now(ZTIMER_USEC);

print_str("Decoding 1.000 x 96 bytes (128 bytes in base64): ");
print_u32_dec(stop - start);
Expand Down
2 changes: 1 addition & 1 deletion tests/bench_thread_flags_pingpong/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include ../Makefile.tests_common

USEMODULE += core_thread_flags
USEMODULE += xtimer
USEMODULE += ztimer_usec

include $(RIOTBASE)/Makefile.include
8 changes: 5 additions & 3 deletions tests/bench_thread_flags_pingpong/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
#include "clk.h"
#include "thread.h"

#include "periph_conf.h"
#include "timex.h"
#include "thread_flags.h"
#include "xtimer.h"
#include "ztimer.h"

#ifndef TEST_DURATION
#define TEST_DURATION (1000000U)
Expand Down Expand Up @@ -65,12 +67,12 @@ int main(void)

thread_t *tcb = thread_get(other);

xtimer_t timer;
ztimer_t timer;
timer.callback = _timer_callback;

uint32_t n = 0;

xtimer_set(&timer, TEST_DURATION);
ztimer_set(ZTIMER_USEC, &timer, TEST_DURATION);
while(!_flag) {
thread_flags_set(tcb, 0x1);
n++;
Expand Down
2 changes: 1 addition & 1 deletion tests/bench_thread_yield_pingpong/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include ../Makefile.tests_common

USEMODULE += xtimer
USEMODULE += ztimer_usec

include $(RIOTBASE)/Makefile.include
8 changes: 5 additions & 3 deletions tests/bench_thread_yield_pingpong/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
#include <stdio.h>

#include "macros/units.h"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is still missing the includes for CLOCK_CORECLOCK

Suggested change
#include "macros/units.h"
#include "periph_conf.h"
#include "timex.h"
#include "macros/units.h"


#include "clk.h"
#include "timex.h"
#include "thread.h"
#include "xtimer.h"
#include "ztimer.h"

#ifndef TEST_DURATION
#define TEST_DURATION (1000000U)
Expand Down Expand Up @@ -62,12 +64,12 @@ int main(void)
NULL,
"second_thread");

xtimer_t timer;
ztimer_t timer;
timer.callback = _timer_callback;

uint32_t n = 0;

xtimer_set(&timer, TEST_DURATION);
ztimer_set(ZTIMER_USEC, &timer, TEST_DURATION);
while(!_flag) {
thread_yield();
n++;
Expand Down