Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
9983a058
Commit
9983a058
authored
Feb 15, 2016
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell: new command 'ps'
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
120e952a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
cmd_ps.c
shell/cmd_ps.c
+39
-0
shell.mk
shell/shell.mk
+1
-0
No files found.
shell/cmd_ps.c
0 → 100644
View file @
9983a058
/*
* 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
,
};
shell/shell.mk
View file @
9983a058
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment