Using semihosting on supported architectures (arm, xtensa, riscv) it now
possible to generate tracing giles easily and without being restricted
by size.
Using qemu for example, it is now possible to generate the tracing file
simply by running:
west build -p -b mps2/an385 tests/kernel/msgq/msgq_api/ \
-t run --snippet semihost-tracing
This will generate a tracing file in the build/ directory which can be
viewed with babeltrace.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Due to the k_pipe rework, references to k_pipe in the SYSVIEW configuration
are now obsolete. This commit removes these references.
Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
Zephyr's socklen_t was changed in
c546c1cad1
to be uint32_t instea of size_t.
Let's fix accordingly the prototypes which expect it.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
With the UART transport test (sample.tracing.transport.uart),
it would fail on qemu_x86_64 complaining about missing
k_event tracing functions. So add them to fix the compilation
error.
Fixes#96818
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
If the process does an exec() (or fork, or..) all descriptors are kept
open by default, unless O_CLOEXEC is set when opening them.
This is usefull for stdin/out/err so that new process is connected to
them, but it is very rare for it to be usefull for any other descriptor.
In general this leads to descriptors being kept open unnecessarily,
which either will block other process from getting them (for example
if the child survives the parent but it does something else).
Or for a "leak" which unnecessarily uses descriptors and memory in the
child process.
Let's ensure we do not leak it for this component as we do not need it.
Note glibc fopen supports the "e" modifier as an extension to pass
O_CLOEXEC to the open syscall.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Do not directly include and use APIs from ksched.h outside of the
kernel. For now do this using more suitable (ipi.h and
kernel_internal.h) internal APIs until more cleanup is done.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
CTF tracing relies on all packet timestamps being increasing- if a
timestamp of a later packet is less than the prior packet, the CTF
parser assumes the timestamp field has overflowed and adds to the
overall timestamp to account for this.
When taking a timestamp for a CTF packet, it was possible for an interrupt
to occur before the packet was submitted to the tracing core framework
but after the timestamp was generated. The interrupt itself would
generate a tracing event with a later timestamp then the packet in
question, leading to the packets being recorded out of order.
To resolve this, take an IRQ lock before generating the timestamp and
release it after submitting the packet to the tracing core.
Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
In the metadata, found that timer_status_sync_pending was missing the
timeout parameter. Noticed when tracing tests/kernel/common.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
In a096b34835 which introduced tracing of k_sleep, the events in the
metadata file were missed causing issues when running with babeltrace.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit adds the tracing macros and functions related
specifically to the k_msgq_put_front API.
Signed-off-by: Alexander Paschoaletto <axelpinheiro@gmail.com>
It is not possible to build anymore in that mode, so we do not
need to support it in this driver cmake files.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This change allows for enabling/disabling the idle traces by setting the
CONFIG_TRACING_IDLE config.
Signed-off-by: Krzysztof Sychla <ksychla@antmicro.com>
Tracing using Segger's SystemView works fine without enabling RTT_CONSOLE
(or CONSOLE, in general).
SEGGER_SYSTEMVIEW was automatically selecting RTT_CONSOLE, which prevents
applications from using another console backend (e.g. UART_CONSOLE).
Signed-off-by: Koen Van Herck <koen.v.herck@gmail.com>
This commit adds names to Kconfig choice sysmbols. This allows for their
selection from Kconfig, e.g.:
choice TRACING_FORMAT_CHOICE
default TRACING_TEST if CONFIG_FOO
default TRACING_CTF if CONFIG_BAR
endchoice
Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
When k_heap_alloc() is expressed in terms of k_heap_aligned_alloc()
it invokes a longer aligned allocation code path with an extra runtime
overhead even though no alignment is necessary.
Let's reference and invoke the aligned allocation code path only when an
actual aligned allocation is requested. This opens the possibility for
the linker to garbage-collect the aligning code otherwise.
Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Add new tracing API which is called when core is exiting from idle.
Current implementation is using it to track CPU load. Implementation
in tracing_none is now weak so it can be used if given backend does
not support new API call.
When CONFIG_CPU_LOAD is enabled then sys_trace_idle also calls a
hook which stores the timing information when CPU entered idle.
Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
Implement a sample app to perform basic GPIO tracing.
Signed-off-by: Alexander Lay <alexanderlay@tenstorrent.com>
Signed-off-by: Yang Xu <yangxu@tenstorrent.com>
If GPIO tracing is enabled, then the system will track
various GPIO pin events.
Signed-off-by: Alexander Lay <alexanderlay@tenstorrent.com>
Signed-off-by: Yang Xu <yangxu@tenstorrent.com>
Add support for a "named event" trace. This trace is intentionally not
used by the system. The purpose of this trace is to allow driver or
application developers to quickly add tracing for events for debug
purposes, and to provide an example of how tracing subsystems can be
extended with additional trace identifiers.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
k_pipe_put_* functions should take const void* data
instead of void* data. This can lead to warnings at the
the -Werror=discarded-qualifiers compiler flag, because the
the input will be const void* and the parameter will be void*.
Fix it by replacing void* data with “const void* data”.
Signed-off-by: Bruce Rosier <brucerosier9@gmail.com>
Move the implementation of zsock_poll to zvfs_poll. This allows
other types of file descriptors to also make use of poll()
functionality even when the network subsystem is not enabled.
Additionally, it partially removes a dependency cycle between
posix and networking by moving functionality into a mutual
dependency.
Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Fixes the systemview tracing backend for soc families, such as max32,
that don't subdivide into soc series and therefore don't define
CONFIG_SOC_SERIES. Use CONFIG_SOC_FAMILY instead in the system
description since it should always be defined.
Signed-off-by: Maureen Helm <maureen.helm@analog.com>