zephyr/subsys/shell/modules/kernel_service/cycles.c
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

21 lines
453 B
C

/*
* Copyright (c) 2018 Nordic Semiconductor ASA
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "kernel_shell.h"
#include <zephyr/kernel.h>
static int cmd_kernel_cycles(const struct shell *sh, size_t argc, char **argv)
{
ARG_UNUSED(argc);
ARG_UNUSED(argv);
shell_print(sh, "cycles: %u hw cycles", k_cycle_get_32());
return 0;
}
KERNEL_CMD_ADD(cycles, NULL, "Kernel cycles.", cmd_kernel_cycles);