Changes CTF events to use 64bit timestamp. This enables tracing of
longer
execution as 32bit timestamps overflows after ~4s.
Signed-off-by: Mikolaj Klikowicz <mklikowicz@antmicro.com>
Currently, TRACING_BACKEND_UART depends on UART_CONSOLE. This is overly
restrictive because the UART tracing backend relies entirely on the
generic UART driver APIs and does not utilize console subsystem.
Signed-off-by: Jedrzej Czykier <jczykier@antmicro.com>
Segger Systemview calls k_current_get() in sys_trace_k_thread_switched_in.
During early boot, this hook is triggered while k_is_pre_kernel() is true.
This triggers an assertion failure when CONFIG_ASSERT is enabled.
Add a guard to ignore the thread switch event if it is called pre-kernel.
Signed-off-by: Igor Knippenberg <knippenberg@filics.eu>
Currently all drivers which uses a slot from the debug window have fragile
hardwired slot 'mapping', they are locked to use specific slots even if
there are free slots available for them to take.
The new API hides the management of the slots and descriptors and users
can ask, release or even seize slots that they want to use.
Add a new debug slot manager API and a new default no config option to
allow selection between the hardwired or dynamic debug slot management.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Add tracing support for timer expiry and stop function callbacks,
enabling measurement of callback execution duration and facilitating
debugging of cases where callbacks take longer than expected.
Signed-off-by: Vijay Sharma <vijshar@qti.qualcomm.com>
We are hitting the limit of 256 events possible with event id right now
defined as uint8_t.
The bandwidth increase is minimal (2 bytes per event) compared to the
payload data, and the scalability benefits far outweigh the costs.
Existing CTF traces with 8-bit IDs won't be compatible.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
k_current_get is not valid pre-kernel. It will return an invalid dummy
thread or invalid memory. The invalid memory case can occur when
CURRENT_THREAD_USE_TLS is enabled.
Assert in k_current_get when called pre-kernel so offending code may be
identified.
k_is_pre_kernel is moved up in kernel.h to avoid needing a prototype for
k_is_pre_kernel.
Signed-off-by: Rob Barnes <robbarnes@google.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.
Note this was already fixed in
37ff1b254f
But it was reverted in
d849ab1263
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
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>