Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing header in subsys/shell/modules/kernel_service/heap.c #78668

Closed
gminn opened this issue Sep 18, 2024 · 3 comments · Fixed by #78670
Closed

Missing header in subsys/shell/modules/kernel_service/heap.c #78668

gminn opened this issue Sep 18, 2024 · 3 comments · Fixed by #78670
Labels
bug The issue is a bug, or the PR is fixing a bug Regression Something, which was working, does not anymore

Comments

@gminn
Copy link

gminn commented Sep 18, 2024

Describe the bug

The new file subsys/shell/modules/kernel_service/heap.c added in #77668 is missing #include "kernel_shell.h", resulting in a build failure when this file is included:

/Users/gminnehan/projects/zephyr-rtos-workspace/zephyr/subsys/shell/modules/kernel_service/heap.c:13:41: warning: 'struct shell' declared inside parameter list will not be visible outside of this definition or declaration
   13 | static int cmd_kernel_heap(const struct shell *sh, size_t argc, char **argv)
      |                                         ^~~~~
/Users/gminnehan/projects/zephyr-rtos-workspace/zephyr/subsys/shell/modules/kernel_service/heap.c: In function 'cmd_kernel_heap':
/Users/gminnehan/projects/zephyr-rtos-workspace/zephyr/subsys/shell/modules/kernel_service/heap.c:23:17: warning: implicit declaration of function 'shell_error' [-Wimplicit-function-declaration]
   23 |                 shell_error(sh, "Failed to read kernel system heap statistics (err %d)", err);
      |                 ^~~~~~~~~~~
/Users/gminnehan/projects/zephyr-rtos-workspace/zephyr/subsys/shell/modules/kernel_service/heap.c:24:25: error: 'ENOEXEC' undeclared (first use in this function)
   24 |                 return -ENOEXEC;
      |                         ^~~~~~~
/Users/gminnehan/projects/zephyr-rtos-workspace/zephyr/subsys/shell/modules/kernel_service/heap.c:24:25: note: each undeclared identifier is reported only once for each function it appears in
/Users/gminnehan/projects/zephyr-rtos-workspace/zephyr/subsys/shell/modules/kernel_service/heap.c:27:9: warning: implicit declaration of function 'shell_print' [-Wimplicit-function-declaration]
   27 |         shell_print(sh, "free:           %zu", stats.free_bytes);
      |         ^~~~~~~~~~~
/Users/gminnehan/projects/zephyr-rtos-workspace/zephyr/subsys/shell/modules/kernel_service/heap.c: At top level:
/Users/gminnehan/projects/zephyr-rtos-workspace/zephyr/subsys/shell/modules/kernel_service/heap.c:34:21: error: expected ')' before '(' token
   34 | KERNEL_CMD_ADD(heap, NULL, "System heap usage statistics.", cmd_kernel_heap);
      |                     ^
      |                     )
/Users/gminnehan/projects/zephyr-rtos-workspace/zephyr/subsys/shell/modules/kernel_service/heap.c:13:12: warning: 'cmd_kernel_heap' defined but not used [-Wunused-function]
   13 | static int cmd_kernel_heap(const struct shell *sh, size_t argc, char **argv)
      |            ^~~~~~~~~~~~~~~

To Reproduce

Build a sample with shell enabled, heap > 0, and heap runtime stats enabled:

west build -b qemu_cortex_m3 zephyr/samples/hello_world -- -DCONFIG_SYS_HEAP_RUNTIME_STATS=y -DCONFIG_SHELL=y -DCONFIG_HEAP_MEM_POOL_SIZE=30000

Expected behavior

Successful build with the above settings. Additionally, this looks to be missing coverage in CI.

Impact

Annoyance, currently a similar sample app used in CI tests is failing to build.

Logs and console output

N/A

Environment (please complete the following information):

  • OS: MacOS
  • Toolchain: Zephyr SDK
  • Testing on Zephyr latest. At the time of writing, tests were run on 9d9089e

Additional context

N/A

@gminn gminn added the bug The issue is a bug, or the PR is fixing a bug label Sep 18, 2024
Copy link

Hi @gminn! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

@gminn
Copy link
Author

gminn commented Sep 18, 2024

cc @ycsin for your awareness!

@ycsin ycsin added the Regression Something, which was working, does not anymore label Sep 18, 2024
@ycsin
Copy link
Member

ycsin commented Sep 18, 2024

cc @ycsin for your awareness!

Thanks for the clear and concise report, fix is in #78670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug Regression Something, which was working, does not anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants