42 #include <px4_platform_common/px4_config.h> 53 #include <px4_platform_common/module.h> 63 PRINT_MODULE_DESCRIPTION(
"Monitor running processes and their CPU, stack usage, priority and state");
65 PRINT_MODULE_USAGE_NAME_SIMPLE(
"top",
"command");
66 PRINT_MODULE_USAGE_COMMAND_DESCR(
"once",
"print load only once");
78 dprintf(1,
"\033[2J\n");
81 if (!strcmp(argv[1],
"once")) {
97 for (
int k = 0; k < 5; k++) {
104 ret = poll(&fds, 1, 0);
108 ret =
read(0, &c, 1);
void init_print_load_s(uint64_t t, struct print_load_s *s)
High-resolution timer with callouts and timekeeping.
static void read(bootloader_app_shared_t *pshared)
Print the current system load.
static void print_usage(void)
__EXPORT int top_main(int argc, char *argv[])
Start the top application.
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
void print_load(uint64_t t, int fd, struct print_load_s *print_state)
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).