Commit graph

145 commits

Author SHA1 Message Date
Tomasz Bursztyka
b4f9242a6a shell: kernel: Add a panic command
For testing purposes only. Testing the fatal error handler or
a coredump backend. Or just out of curiosity.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
2025-03-29 07:44:11 -04:00
Jeremy Bettis
e1cfd098a2 shell: Fix Kconfig dependencies
PR #84651 introduced new shell commands that don't compile if
CONFIG_THREAD_MONITOR=n

Add THREAD_MONITOR to new shell commands.

Signed-off-by: Jeremy Bettis <jbettis@google.com>
2025-02-06 21:14:01 +01:00
S Swetha
8f647ef46b [shell]: Add thread control features through shell
This commit extends the shell command functionality by
adding three new operations for thread management.
kernel thread suspend <thread_id>:
Suspends any thread based on its identifier.
kernel thread resume <thread_id>:
Resumes the thread that was previously suspended.
kernel thread kill <thread_id>:
Terminates any thread based on its identifier
These extended commands are useful for controlling
any threads through Zephyr Shell.

Signed-off-by: S Swetha <s.swetha@intel.com>
2025-02-04 11:56:22 +01:00
Krzysztof Chruściński
8207a05304 shell: modules: kernel_service: deprecate log_level
Log_level command is a duplicate of 'log enable' command from
the logging command set (enabled by CONFIG_LOG_CMDS=y). Adding
warning about deprecation as 'log enable' is recommended since
it has more features (e.g. autocompletion).

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-17 09:08:26 +01:00
Krzysztof Chruściński
f0cdaace22 shell: modules: kernel_service: Fix log_level command
Add missing return when input logging source argument is not valid.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-16 14:46:33 +01:00
Nicolas Pitre
46aa6717ff Revert "arch: deprecate _current"
Mostly a revert of commit b1def7145f ("arch: deprecate `_current`").

This commit was part of PR #80716 whose initial purpose was about providing
an architecture specific optimization for _current. The actual deprecation
was sneaked in later on without proper discussion.

The Zephyr core always used _current before and that was fine. It is quite
prevalent as well and the alternative is proving rather verbose.
Furthermore, as a concept, the "current thread" is not something that is
necessarily architecture specific. Therefore the primary abstraction
should not carry the arch_ prefix.

Hence this revert.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-01-10 07:49:08 +01:00
Pisit Sawangvonganan
b44250ae46 shell: modules: kernel: streamline code
This commit includes cleanups to `kernel_service`:
- `shell_tdata_dump()`:
  Adjust formatting to align with `.clang-format`.
- `shell_stack_dump()`:
  Update to pass `sh` directly instead of `user_data` since
  it is already assigned.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-12-13 11:35:28 +01:00
Pisit Sawangvonganan
8fedee30ee shell: modules: devmem: use shell_strtoul in cmd_dump
Switch from using direct `strtoul` calls to `shell_strtoul`.
This change leverages the extensive error handling provided
by `shell_strtoul`.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-12-13 11:35:28 +01:00
Pisit Sawangvonganan
27cbe0553c shell: modules: date: omit NULL initialization of endptr
As `strtol` guarantee to set `endptr`, the initial `NULL` can be omitted.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-12-13 11:35:28 +01:00
Yong Cong Sin
b1def7145f arch: deprecate _current
`_current` is now functionally equals to `arch_curr_thread()`, remove
its usage in-tree and deprecate it instead of removing it outright,
as it has been with us since forever.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-11-23 20:12:24 -05:00
Jakub Rzeszutko
1aaf08f7f1 lib: shell: replace strtol with strtoul in cmd_load for address parsing
Addresses in cmd_load() should always be unsigned. Previously, strtol()
was used, which is limited to signed long values, causing issues with
addresses >= 0x80000000. This commit replaces strtol() with strtoul(),
ensuring proper handling of the full 32-bit address space.

Fixes #81343

Signed-off-by: Aaron Fontaine <aaron.fontaine@dojofive.com>
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2024-11-21 09:17:08 +01:00
Chris Friedt
f4e07d15d6 sys: util: define bits per byte, nibble, and nibbles per byte
Collect some common bit-widths redefined in various locations
and put them under sys/util.h .

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-10-15 19:05:06 +01:00
Yong Cong Sin
ae20c08822 shell: kernel_service: heap: add required header
Add the "kernel_shell.h" header which is required but missing,
causing build error.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-19 03:52:59 -04:00
Yong Cong Sin
aa9446ca6b shell: modules: kernel: cleanup thread list subcmd
Parts related to the thread runtime stats are somewhat
standalone, refactor it out instead of having two #ifdef
and two places.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-17 20:12:33 -04:00
Yong Cong Sin
83212147b2 shell: kernel_service: reorg the commands
Split the `kernel_service.c` into multiple subcommand files,
each file would register with the main `kernel` cmd based on
the dependencies in Kconfig/CMakeLists.txt.

This greatly reduces the number of precompiler directives.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-09-17 20:12:33 -04:00
Keith Packard
94043dbefe subsys/shell: cmd_date_set uses gmtime_r, a POSIX function
Define _POSIX_C_SOURCE for this file to make sure gmtime_r is visible.

Signed-off-by: Keith Packard <keithp@keithp.com>
2024-09-16 20:17:35 +02:00
Fin Maaß
fae1fe8c1f shell: kernel: do a cold reboot by standard
do a cold reboot by default if no option is provided
for `kernel reboot`, instead of requiring to
type `kernel reboot cold`.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-09-05 11:33:22 -05:00
Yong Cong Sin
f81d178b23 shell: modules: kernel: fix typo in cmd_kernel_uptime()
Caught by CI in another PR, should be 'Unsupported' instead.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-28 14:01:55 -04:00
Yong Cong Sin
aca3b3602a shell: modules: kernel: add CPU mask affinity/pinning commands
Added commands to access the APIs in the kernel/cpu_mask.c

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-28 14:01:55 -04:00
Yong Cong Sin
475fc91746 shell: modules: kernel: add additional check in unwind cmd
Use `shell_strtoull()` to parse the thread ID argument for
error checking.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-28 14:01:55 -04:00
Yong Cong Sin
e3c2e8484f shell: modules: kernel: group thread-related cmds
`stacks` `threads` & `unwind` are commands related to kernel
thread, group them one level inside a main `thread` command,
and rename `threads` to `list`:

- `kernel threads` -> `kernel thread list`
- `kernel stacks` -> `kernel thread stacks`
- `kernel unwind` -> `kernel thread unwind`

Additionally, rename and mark the `thread_valid()` function
as `__maybe_unused` as it might be unused for architectures
without stackwalk implementation, and use the locked version
of the thread iterator (`k_thread_foreach()`)

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-28 14:01:55 -04:00
Yong Cong Sin
276ccd04e7 shell: devmem: minor optimizations
- Use `SHELL_CMD_ARG_REGISTER` for the main cmd to state the
  required number of arguments, this helps to remove the
  runtime check from the command, and also print the help
  message to the terminal when the argument count is
  unexpected.
- Some changes to the help text that hopefully makes the
  mandatory and optional arguments more obvious to the user

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-27 12:44:46 +02:00
Yong Cong Sin
6fae891c7e arch: reorg the dependencies around (exception) stack trace
This commit introduces a new ARCH_STACKWALK Kconfig which
determines if the `arch_stack_walk()` is available should the
arch supports it.

Starting from RISCV, this will be able to converge the exception
stack trace implementation & stack walking features. Existing
exception stack trace implementation will be updated later.
Eventually we will end up with the following:

1. If an arch implements `arch_stack_walk()`
   `ARCH_HAS_STACKWALK` should be selected.
2. If the above is enabled, `ARCH_SUPPORTS_STACKWALK` indicates
   if the dependencies are met for arch to enable stack walking.
   This Kconfig replaces `<arch>_EXCEPTION_STACK_TRACE`
2. If the above is enabled, then, `ARCH_STACKWALK` determines
   if `arch_stack_walk()` should be compiled.
3. `EXCEPTION_STACK_TRACE` should build on top of the
   `ARCH_STACKWALK`, stack traces will be printed when it
   is enabled.
4. `ARCH_STACKWALK_MAX_FRAMES` will be removed as it is
   replaced by `ARCH_STACKWALK_MAX_FRAMES`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-26 14:44:53 -04:00
Yong Cong Sin
143b14bb4f shell: modules: kernel: print cpu_mask when available
Dump the `cpu_mask` of threads when available.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-08-23 15:51:01 +01:00
Jan Peters
b8bef42add device_dt_metadata: handle dt_meta being NULL
Using  DEVICE_DEFINE, a device without a corresponding DT node can be
defined (for example CRYPTO_MTLS), Z_DEVICE_INIT() does not initialize
dt_meta for such devices, leaving the field as NULL.
device_get_dt_nodelabels() and functions calling it have to handle
dev->dt_meta == NULL to prevent fatal errors.

Signed-off-by: Jan Peters <peters@kt-elektronik.de>
2024-08-12 15:54:22 +02:00
Yong Cong Sin
b98a60773b shell: kernel: add command to unwind a thread
Add a shell command to unwind a thread using its thread id.

uart:~$ kernel threads
Scheduler: 11 since last call
Threads:
*0x80017138 shell_uart
        options: 0x0, priority: 14 timeout: 0
        state: queued, entry: 0x800029ac
        stack size 3072, unused 1316, usage 1756 / 3072 (57 %)

 0x80017ca8 sysworkq
        options: 0x1, priority: -1 timeout: 0
        state: pending, entry: 0x80006842
        stack size 1024, unused 644, usage 380 / 1024 (37 %)

 0x800177e0 idle
        options: 0x1, priority: 15 timeout: 0
        state: , entry: 0x800065ae
        stack size 512, unused 180, usage 332 / 512 (64 %)

 0x80017950 main
        options: 0x1, priority: 0 timeout: 13
        state: suspended, entry: 0x80006326
        stack size 4096, unused 3604, usage 492 / 4096 (12 %)

uart:~$ kernel unwind 0x80017ca8
Unwinding 0x80017ca8 sysworkq
ra: 0x80007114 [z_swap+0x58]
ra: 0x80007ae8 [z_sched_wait+0x10]
ra: 0x8000689a [work_queue_main+0x58]
ra: 0x800006de [z_thread_entry+0x2e]

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-13 16:46:48 -04:00
Martí Bolívar
b93fe6ad2d shell: device_service: print DT metadata
Example output on qemu_cortex_m3:

  devices:
  - uart@4000e000 (READY)
    DT node labels: uart2
  - uart@4000d000 (READY)
    DT node labels: uart1
  - uart@4000c000 (READY)
    DT node labels: uart0
  - gpio@40026000 (READY)
    DT node labels: gpio6
  - gpio@40025000 (READY)
    DT node labels: gpio5
  - gpio@40024000 (READY)
    DT node labels: gpio4
  - gpio@40007000 (READY)
    DT node labels: gpio3
  - gpio@40006000 (READY)
    DT node labels: gpio2
  - gpio@40005000 (READY)
    DT node labels: gpio1
  - gpio@40004000 (READY)
    DT node labels: gpio0

Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
2024-06-12 18:49:54 +02:00
Chris Friedt
2bc722a97e posix: deprecate POSIX_FNMATCH GETOPT GETENTROPY
The functions fnmatch(), getopt(), getentropy()
and others are grouped into the standard Option Group
POSIX_C_LIB_EXT.

The getentropy() function is currently in-draft for
Issue 8 as of 2021.

https://www.opengroup.org/austin/docs/austin_1110.pdf

Not surprisingly, the POSIX_C_LIB_EXT Option Group
also includes the highly debated strnlen() function.

Moving that function will be deferred until later.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Chris Friedt
4a5c4e5f73 posix: timers: deprecate CONFIG_POSIX_CLOCK and TIMER
The POSIX_CLOCK option does not correspond to any standard
option. It was used to active features of several distinct
POSIX Options and Option Groups, which complicated API and
application configuration as a result.

POSIX_CLOCK is being deprecated in order to ensure that Zephyr's
POSIX Kconfig variables correspond to those defined in the
specification, as of IEEE 1003.1-2017.

Additionally, CONFIG_TIMER is being deprecated because it does
not match the corresponding POSIX Option (_POSIX_TIMERS).

With this deprecation, we introduce the following Kconfig
options that map directly to standard POSIX Option Groups by
simply removing "CONFIG_":

* CONFIG_POSIX_TIMERS

Similarly, we introduce the following Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":

* CONFIG_POSIX_CLOCK_SELECTION
* CONFIG_POSIX_CPUTIME
* CONFIG_POSIX_DELAYTIMER_MAX
* CONFIG_POSIX_MONOTONIC_CLOCK
* CONFIG_POSIX_TIMEOUTS
* CONFIG_POSIX_TIMER_MAX

In order to maintain parity with the current feature set, we
introduce the following Kconfig options that map directly to
standard POSIX Option Groups by simply removing "CONFIG_":

* CONFIG_POSIX_MULTI_PROCESS - sleep()

Similarly, in order to maintain parity with the current feature
set, we introduce the following additional Kconfig options that
map directly to standard POSIX Options by simply removing
"CONFIG":

* CONFIG_XSI_SINGLE_PROCESS - gettimeofday()

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2024-06-04 16:27:12 -05:00
Yong Cong Sin
bbe5e1e6eb build: namespace the generated headers with zephyr/
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Pisit Sawangvonganan
557ad8e45c shell: devmem: address cmd_dump multiple call problem
Call `getopt_init()` to reset `state->optind` instead of directly setting
`optind = 1`. The `getopt()` function uses `getopt_state` from
`getopt_state_get` for state handling, so `getopt_init()` should be called
to correctly run the command again.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-05-15 10:13:23 +02:00
Pisit Sawangvonganan
93ee60fe87 shell: devmem: correct number of mand and opt of cmd_dump
According to the `SHELL_CMD_ARG` macro, the `mand` argument of `cmd_dump`
should be 5, including the command name itself, `dump`.
Meanwhile, the `opt` should be 2, as this value describes the optional
field, which is [-w <width>].

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-05-15 10:13:23 +02:00
Fabio Baltieri
4257fb6a3d shell: device_service: show the usage conter when pm runtime is enabled
Add an extra "usage=%d" to the device status to show the current usage
counter when PM runtime is enabled.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-05-01 10:31:03 +02:00
Daniel Leung
b69d2486fe kernel: rename Z_KERNEL_STACK_BUFFER to K_KERNEL_STACK_BUFFER
Simple rename to align the kernel naming scheme. This is being
used throughout the tree, especially in the architecture code.
As this is not a private API internal to kernel, prefix it
appropriately with K_.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-27 19:27:10 -04:00
Daniel Leung
3664ed64c3 arch: move arch_interface.h under zephyr/arch
arch_interface.h is for architecture and should not be
under sys/. So move it under include/zephyr/arch/.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-03-25 09:58:35 +00:00
Henrik Brix Andersen
14fa9f3e21 shell: modules: kernel: include EXTRAVERSION when printing version
Include the full version in the output of the "kernel version" shell
subcommand. Previously, EXTRAVERSION was not included, causing
e.g. "3.6.0-rc1" to be printed as "3.6.0".

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-02-05 23:06:19 +01:00
Alberto Escolar Piedras
06f15fcc36 subsys shell devmem_service: Fix includes
* The include for the host libC should be guarded with
  using the host libC instead of the POSIX arch, as this
  supports other C libraries.
* This code uses getopt, which is an extension to the
  C library. Let's explicity select one of the extensions
  which includes it instead of relaying on somebody having
  set it for this file somewhere else.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-26 07:48:55 -05:00
Jonathan Hamberg
9c1a45cc00 posix: Fix name collision with __bswap
__bswap_ in zephyr/sys/byteorder.h conflicts with __bswap_ in host's
byteswap.h. byteswap.h from host compiler used in posix_native_64 boards
causes a compilation issue.

This commit renames __bswap_ to BSWAP_ to prevent collision.

Before this commit a compilation error can be created by adding #include
<byteswap.h> to samples/net/sockets/echo/src/socket_echo.c

This does not change external API to byteorder.h, but does change
internal implementation which some other source files depend on.

Replaced manual byteswap operations in devmem_service.c with APIs from
byteorder.h which automatically converts to CPU endianess when necessary.

Fixes #44324

Signed-off-by: Jonathan Hamberg <jonathanhamberg@gmail.com>
2024-01-10 18:13:44 +00:00
Benedikt Schmidt
4c731f27c6 shell: modules: do not use k_thread_foreach with shell callbacks
Always use k_thread_foreach_unlocked with callbacks which print
something out to the shell, as they might call arch_irq_unlock.
Fixes #66660.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-12-21 10:01:08 +00:00
Johan Hedberg
3fbf12487c kernel: Introduce a way to specify minimum system heap size
There are several subsystems and boards which require a relatively large
system heap (used by k_malloc()) to function properly. This became even
more notable with the recent introduction of the ACPICA library, which
causes ACPI-using boards to require a system heap of up to several
megabytes in size.

Until now, subsystems and boards have tried to solve this by having
Kconfig overlays which modify the default value of HEAP_MEM_POOL_SIZE.
This works ok, except when applications start explicitly setting values
in their prj.conf files:

$ git grep CONFIG_HEAP_MEM_POOL_SIZE= tests samples|wc -l
     157

The vast majority of values set by current sample or test applications
is much too small for subsystems like ACPI, which results in the
application not being able to run on such boards.

To solve this situation, we introduce support for subsystems to specify
their own custom system heap size requirement. Subsystems do
this by defining Kconfig options with the prefix HEAP_MEM_POOL_ADD_SIZE_.
The final value of the system heap is the sum of the custom
minimum requirements, or the value existing HEAP_MEM_POOL_SIZE option,
whichever is greater.

We also introduce a new HEAP_MEM_POOL_IGNORE_MIN Kconfig option which
applications can use to force a lower value than what subsystems have
specficied, however this behavior is disabled by default.

Whenever the minimum is greater than the requested value a CMake warning
will be issued in the build output.

This patch ends up modifying several places outside of kernel code,
since the presence of the system heap is no longer detected using a
non-zero CONFIG_HEAP_MEM_POOL_SIZE value, rather it's now detected using
a new K_HEAP_MEM_POOL_SIZE value that's evaluated at build.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-12-20 11:01:42 +01:00
Jakub Rzeszutko
c631bc7757 shell: modules: kernel: add human readable uptime
Added options: -p and --pretty to the kernel updtime command.

Fixes: #62543

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
2023-09-28 09:34:00 +02:00
Christopher Friedt
e6c6d82a00 shell: date_service: conditionally include posix/time.h
When compiling for ARCH_POSIX, include `time.h` rather than
`posix/time.h`.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-08-23 10:06:00 +02:00
Daniel Leung
565c5d476e shell: rename shadow variables
This renames shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Gerard Marull-Paretas
48b201cc53 device: make device dependencies optional
Device dependencies are not always required, so make them optional via
CONFIG_DEVICE_DEPS. When enabled, the gen_device_deps script will run so
that dependencies are collected and part of the final image. Related
APIs will be also made available. Since device dependencies are used in
just a few places (power domains), disable the feature by default. When
not enabled, a second linking pass will not be required.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-21 09:32:05 +02:00
Maxim Adelman
ecf2cb5932 kernel shell, stacks shell commands: iterate unlocked on SMP
call k_thread_foreach_unlocked to avoid assertions caused
by calling shell_print while holding a global lock

Signed-off-by: Maxim Adelman <imax@meta.com>
2023-06-15 05:55:56 -04:00
Gerard Marull-Paretas
13f87494bb shell: device_service: remove levels command
While it may be useful in some contexts, this information can be
obtained at compile time. Removing this command allows to migrate the
device infrastructure code to standard iterable sections, done later.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-12 12:01:10 +02:00
Gerard Marull-Paretas
b2d442ee87 shell: fix MISRA 5.7 violations on struct tm
s/struct tm *tm/struct tm *t/ to fix MISRA 5.7 rule violation
(uniqueness of tag identifiers).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-14 12:21:08 +02:00
Gerard Marull-Paretas
667eeb11fb shell: fix MISRA 5.7 violations on struct shell
MISRA Rule 5.7 requires uniqueness of tag identifiers. Shell is
frequently problematic because many code uses `const struct shell
*shell`. This causes CI noise every time one of these shell files is
edited, so let's update all of them with `const struct shell *sh`
instead.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-04-14 12:21:08 +02:00
Tom Burdick
f09685e1ac shell: Provide runtime power management toggling
Adds a device pm_toggle shell command which calls pm_runtime_device
functions put and get to toggle the runtime power state.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-03-30 17:33:22 -04:00
Tommi Kangas
a25bcfdc59 shell: modules: kernel: add shell command for system heap stats
Added a shell command to print kernel system heap usage statistics.

Signed-off-by: Tommi Kangas <tommi.kangas@nordicsemi.no>
2023-02-19 20:40:48 -05:00