mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #17319 from aabadie/pr/sys/trace_ztimer
sys/trace: migrate to ztimer
This commit is contained in:
commit
3ca1a10217
1
.murdock
1
.murdock
@ -76,6 +76,7 @@ tests/periph_*
|
||||
tests/pkg_elk
|
||||
tests/pkg_uzlib
|
||||
tests/prng_*
|
||||
tests/trace
|
||||
tests/xtimer_*
|
||||
tests/ztimer_*
|
||||
examples/hello-world
|
||||
|
@ -76,6 +76,7 @@ rsource "seq/Kconfig"
|
||||
rsource "shell/Kconfig"
|
||||
rsource "test_utils/Kconfig"
|
||||
rsource "timex/Kconfig"
|
||||
rsource "trace/Kconfig"
|
||||
rsource "tsrb/Kconfig"
|
||||
rsource "uri_parser/Kconfig"
|
||||
rsource "usb/Kconfig"
|
||||
|
@ -73,7 +73,8 @@ ifneq (,$(filter rtt_cmd,$(USEMODULE)))
|
||||
endif
|
||||
|
||||
ifneq (,$(filter trace,$(USEMODULE)))
|
||||
USEMODULE += xtimer
|
||||
USEMODULE += ztimer
|
||||
USEMODULE += ztimer_usec
|
||||
endif
|
||||
|
||||
ifneq (,$(filter ssp,$(USEMODULE)))
|
||||
|
13
sys/trace/Kconfig
Normal file
13
sys/trace/Kconfig
Normal file
@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2021 Inria
|
||||
#
|
||||
# This file is subject to the terms and conditions of the GNU Lesser
|
||||
# General Public License v2.1. See the file LICENSE in the top level
|
||||
# directory for more details.
|
||||
#
|
||||
|
||||
config MODULE_TRACE
|
||||
bool "Trace program flows"
|
||||
depends on TEST_KCONFIG
|
||||
select MODULE_ZTIMER
|
||||
select MODULE_ZTIMER_USEC
|
||||
select MODULE_ZTIMER_PERIPH_TIMER
|
@ -23,7 +23,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "irq.h"
|
||||
#include "xtimer.h"
|
||||
#include "ztimer.h"
|
||||
|
||||
#ifndef CONFIG_TRACE_BUFSIZE
|
||||
#define CONFIG_TRACE_BUFSIZE 512
|
||||
@ -42,7 +42,7 @@ void trace(uint32_t val)
|
||||
unsigned state = irq_disable();
|
||||
|
||||
tracebuf[tracebuf_pos % CONFIG_TRACE_BUFSIZE] =
|
||||
(tracebuf_entry_t){ .time = xtimer_now_usec(), .val = val };
|
||||
(tracebuf_entry_t){ .time = ztimer_now(ZTIMER_USEC), .val = val };
|
||||
tracebuf_pos++;
|
||||
irq_restore(state);
|
||||
}
|
||||
|
3
tests/trace/app.config.test
Normal file
3
tests/trace/app.config.test
Normal file
@ -0,0 +1,3 @@
|
||||
# this file enables modules defined in Kconfig. Do not use this file for
|
||||
# application configuration. This is only needed during migration.
|
||||
CONFIG_MODULE_TRACE=y
|
Loading…
Reference in New Issue
Block a user