Commit graph

36 commits

Author SHA1 Message Date
Anas Nashif
ec405a8632 doc: doxygen: group debugging APIs
Create new group for debugging and move all debugging APIs under this
group.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-18 17:46:50 +02:00
Tomasz Bursztyka
e8185990ac include: debug: Fix indentation in coredump.h
A nano fix in the header.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-03-29 07:44:11 -04:00
Tom Hughes
6f6d6d0f76 toolchain: Replace TOOLCHAIN_IGNORE_WSHADOW_BEGIN/END
The TOOLCHAIN_IGNORE_WSHADOW_BEGIN and TOOLCHAIN_IGNORE_WSHADOW_END
macros can be replaced with the more generic
TOOLCHAIN_DISABLE_WARNING(TOOLCHAIN_WARNING_SHADOW) and
TOOLCHAIN_ENABLE_WARNING(TOOLCHAIN_WARNING_SHADOW) macros.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-03-20 21:57:47 +01:00
Krzysztof Chruściński
c7d7aac2bd debug: Add cpu_load module
Add module which can measure CPU idle time. Idle time is measured in
the pre/post CPU idle hooks but they are not provided by this module.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-03-12 14:03:48 +00:00
Ryan McClelland
952daca695 debug: symtab: fix ignored type qualifiers on func return type
const is ignored on the function return type. A warning is reported with
-Wignored-qualifers. Remove the ignored const.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-11-06 09:52:36 -08:00
Krzysztof Chruściński
fc162f74c0 debug: mipi_stp_decoder: Align naming to 2.4 standard
Align naming to STP v2.4. Changing Master to Major.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-06 11:31:27 -04:00
Daniel Leung
d26b7d4ed1 debug: thread_analyzer: display privileged stack usage
This adds the bits to display privileged stack usage for
architectures that support obtaining this information.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-08-28 06:50:30 -04:00
Krzysztof Chruściński
530b8ccbed debug: coresight: Add coresight_trace_deformatter
Add module which decodes data encoded using Coresight Trace
Formatter.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-08-12 19:23:19 -04:00
Mark Holden
45684a598d coredump: Add config for capturing thread data in core dump
Update core dump file format to support a new section which contains
metadata about threads necessary for debugging.

Define configs to capture that metadata and include it in the dumps
when enabled.

Update documentation to reflect the changes.

Signed-off-by: Mark Holden <mholden@meta.com>
2024-08-02 03:32:09 -04:00
Jyri Sarha
1b6e0f6479 debug: thread_analyzer: Option to analyze threads on each core separately
Add implementation to analyze threads on each cpu separately. This
feature can be enabled with THREAD_ANALYZER_AUTO_SEPARATE_CORES Kconfig
option. If enabled, an analyzer thread is started for each cpu, and
the threads will only analyze thread on the cpu its running on.

This feature is needed for Intel ADSP platform, where cpu specific
caches are not synchronized between the cpu. It is also probably
needed by other platforms having CONFIG_KERNEL_COHERENCE=y, so default
to THREAD_ANALYZER_AUTO_SEPARATE_CORES=y for those platform.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-07-30 18:25:40 +01:00
Gerard Marull-Paretas
bd921a1ca9 debug: symtab: move to os_services doxygen group
Instead of being a top-level group.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-18 09:23:33 -04:00
Gerard Marull-Paretas
b792e63b0f debug: mipi_stp_decoder: move to os_services doxygen group
The API was placed under a non-existing group: coresight_apis. Place it
under os_services, as other debug/ APIs.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-07-18 09:23:33 -04:00
Yong Cong Sin
0103c56dd6 zephyr: remove deprecated headers
These headers have been deprecated for > 2 full releases,
let's remove them to keep them out of v3.7.0 LTS.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-14 19:12:00 +02:00
Yong Cong Sin
e54b27b967 arch: define struct arch_esf and deprecate z_arch_esf_t
Make `struct arch_esf` compulsory for all architectures by
declaring it in the `arch_interface.h` header.

After this commit, the named struct `z_arch_esf_t` is only used
internally to generate offsets, and is slated to be removed
from the `arch_interface.h` header in the future.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-04 14:02:51 -05:00
Yong Cong Sin
db2f74555d doc: services: debugging: add documentation for symtab
Add a simple documentation for symbol table.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-30 16:52:01 -05:00
Yong Cong Sin
043f595279 debug: symtab: rename start_addr to first_addr
`start_addr` is the address of the first symbol, rename it to
`first_addr` instead as it seems more intuitive and relatable
to the comments.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-30 16:52:01 -05:00
Younghyun Park
ea29ef36bb debug: coredump: Move COREDUMP_*_STR strings to the public header
This allows a customized coredump_backend_other API to re-use the
COREDUMP_*_STR without re-defining the same strings.

Signed-off-by: Younghyun Park <younghyunpark@google.com>
2024-05-25 14:39:18 -04:00
Marco Widmer
ef8a5b7275 debug: coredump: fix multiple definitions
When compiling with CONFIG_DEBUG_COREDUMP=n and including
<zephyr/debug/coredump.h> from any file, linking fails with a multiple
definitions error. Define the functions in the header file as static
inline.

Signed-off-by: Marco Widmer <marco.widmer@bytesatwork.ch>
2024-05-25 14:38:51 -04:00
Yong Cong Sin
e1ce0aefff debug: implement symtab generation
Use pyelftools to extract the symbol table from the
link stage executable. Then, filter out the function names
and sort them based on their offsets before writing into the
`symtab.c`, this is similar to how the `isr_tables` works.

To access the structure, simply include the new header:
```c
#include <zephyr/debug/symtab.h>
```

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-23 11:52:08 -04:00
Krzysztof Chruściński
299b52d1a7 debug: Add MIPI STPv2 data stream decoder
Add a decoder of STPv2 stream.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-05-21 16:48:28 -04:00
frei tycho
045a11fad1 debug: stack: coding guidelines: cast unused arguments to void
- added missing ARG_UNUSED

Signed-off-by: frei tycho <tfrei@baumer.com>
2024-05-07 18:03:31 -04:00
Robert Zieba
e410e2b740 gdbstub: Make loop enum public
Make the current gdb loop enum public under the name `gdb_loop_state`.
This will allow for extending the current stub with further
functionality in the future as new features will require control over
the loop state.

Signed-off-by: Robert Zieba <robertzieba@google.com>
2024-04-03 15:39:28 +01:00
Alberto Escolar Piedras
9eeb78d86d COVERAGE: Fix COVERAGE_GCOV dependencies
CONFIG_COVERAGE has been incorrectly used to
change other kconfig options (stack sizes, etc)
code defaults, as well as some samples behaviour,
which should not have dependend on it.

Instead those should have depended on COVERAGE_GCOV,
which, being the one which adds special code and
temporary RAM storage for embedded targets,
require changes to many features.

When building for the native targets, all this was
unnecessary.

=> Fix the dependency.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-08-24 15:36:31 +02:00
Benjamin Cabé
b4fe506779 debug: coredump: Doxygen cleanup
Ensure coredump.h is properly documented, in particular add missing docs
for coredump_query_id and coredump_cmd_id enums that are part of the
API.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-23 10:03:36 +02:00
Benjamin Cabé
66877cfced debug: coredump: Fix unused-parameter warnings
Added missing ARG_UNUSED()

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-08-23 10:03:36 +02:00
Daniel Leung
7c4e641f84 debug: rename shadow variables
This renames the shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Benedikt Schmidt
a5f8c775d7 debug: add missing include to thread_analyzer
Including thread_analyzer.h implicitly requires a previous include of
thread.h. This adds this include directly to thread_analyzer to remove
this implicit dependency.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-07-18 11:07:54 +00:00
Roberto Medina
6622735ea8 arch: arm64: add support for coredump
* Add support for coredump on ARM64 architectures.
* Add the script used for post-processing coredump output.

Signed-off-by: Marcelo Ruaro <marcelo.ruaro@huawei.com>
Signed-off-by: Rodrigo Cataldo <rodrigo.cataldo@huawei.com>
Signed-off-by: Roberto Medina <roberto.medina@huawei.com>
2023-07-03 09:32:26 +02:00
Gerard Marull-Paretas
721f829e01 doc: doxygen: add some OS services to os_services group
- Crypto
- Retention
- Settings
- Storage
- Memory management
- Heap management
- Flash access
- Coredump
- Timing
- Thread analyzer

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-05 20:21:09 -04:00
Kumar Gala
b0ea0c8ec6 debug: coredump: Fix build issue with armclang
Building tests/drivers/coredump/coredump_api with armclang gets:

include/zephyr/debug/coredump.h:98:2: error: unknown type name 'uint8_t'
        uint8_t *buffer;
        ^

Fix simply be including <stdint.h> to get uint8_t typedef.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2023-03-16 16:42:41 -04:00
Gerard Marull-Paretas
a7c3e7e84a doxygen: remove redundant usages of def
The def command Indicates that a comment block contains documentation
for a #define macro. This is useful if the comment block documents a
macro not adjacent to it, e.g.

```c
/**
 * @def MAX(x,y)
 * @brief Computes the maximum of @a x and @a y.
 */
 #ifdef XXX
 #define MAX(x,y) ...
 #endif
```

However, it is not necessary if the comment is adjacent to the
definition, e.g.

```c
/**
 * @brief Computes the maximum of @a x and @a y.
 */
 #define MAX(x,y) ...
```

This patch removes all unnecessary def entries in-tree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-09 12:29:28 +02:00
Pieter De Gendt
a727b8aaac debug: coredump: flash backend: add query/command to get raw data
Add a new coredump query and command type to retrieve the raw data
stored to the flash backend

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-11 18:04:05 +00:00
Krzysztof Chruscinski
041f0e5379 all: logging: Remove log_strdup function
Logging v1 has been removed and log_strdup wrapper function is no
longer needed. Removing the function and its use in the tree.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00
Gerard Marull-Paretas
fb9b3bcd93 include: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all includes within
include directory to the new prefix <zephyr/...>. Note that the
conversion has been scripted, refer to zephyrproject-rtos#45388 for more
details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:03:00 +02:00
Guennadi Liakhovetski
17eb313a1b sparse: add an address space and a __sparse_force annotation
We want to use a sparse address space to identify invalid conversions
between cached and uncached address aliases. This patch adds a
__sparse_cache sparse annotation for that. Where those conversions
must be done that has to be supported by using the __sparse_force
sparse attribute. To avoid compiler complains about unknown
attributes we add a -Wno-attributes flag when building with sparse
support.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-05-03 09:37:08 +02:00
Yuval Peress
53ef68d459 include: Prefix includes to use a scope
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
  example: <irq.h> -> <zephyr/irq.h>

Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00