Commit 9983a058 authored by Alessandro Rubini's avatar Alessandro Rubini

shell: new command 'ps'

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 120e952a
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2016 GSI (www.gsi.de)
* Author: Alessandro Rubini <a.rubini@gsi.de>
*
* Released according to the GNU GPL, version 2 or any later version.
*/
#include <wrc.h>
#include <string.h>
#include <shell.h>
extern struct wrc_task wrc_tasks[];
extern int wrc_n_tasks;
static int cmd_ps(const char *args[])
{
int i, ena;
if (args[0] && !strcasecmp(args[0], "reset")) {
for (i = 0; i < wrc_n_tasks; i++) {
wrc_tasks[i].nrun = 0;
}
return 0;
}
pp_printf("iterations ena name\n");
for (i = 0; i < wrc_n_tasks; i++) {
ena = 1;
if (wrc_tasks[i].enable) ena = (*wrc_tasks[i].enable != 0);
pp_printf(" %8i %i %s\n",
wrc_tasks[i].nrun, ena, wrc_tasks[i].name);
}
return 0;
}
DEFINE_WRC_COMMAND(ps) = {
.name = "ps",
.exec = cmd_ps,
};
......@@ -14,6 +14,7 @@ obj-$(CONFIG_WR_NODE) += \
shell/cmd_init.o \
shell/cmd_ptrack.o \
shell/cmd_help.o \
shell/cmd_ps.o \
shell/cmd_refresh.o
obj-$(CONFIG_IP) += shell/cmd_ip.o
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment