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
28
Issues
28
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
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
e7c84b82
Commit
e7c84b82
authored
Jul 11, 2012
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell: add \stat cont\ command to enter debugging mode and print statistics every second
parent
2148903b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
monitor.c
monitor/monitor.c
+6
-1
cmd_stat.c
shell/cmd_stat.c
+8
-2
wrc_main.c
wrc_main.c
+9
-0
No files found.
monitor/monitor.c
View file @
e7c84b82
...
...
@@ -114,7 +114,7 @@ int wrc_mon_gui(void)
return
0
;
}
int
wrc_log_stats
(
void
)
int
wrc_log_stats
(
uint8_t
onetime
)
{
static
char
*
slave_states
[]
=
{
"Uninitialized"
,
"SYNC_SEC"
,
"SYNC_NSEC"
,
"SYNC_PHASE"
,
"TRACK_PHASE"
};
static
uint32_t
last
=
0
;
...
...
@@ -126,6 +126,11 @@ int wrc_log_stats(void)
int16_t
brd_temp
=
0
;
int16_t
brd_temp_frac
=
0
;
if
(
!
onetime
&&
timer_get_tics
()
-
last
<
UI_REFRESH_PERIOD
)
return
0
;
last
=
timer_get_tics
();
pps_gen_get_time
(
&
sec
,
&
nsec
);
halexp_get_port_state
(
&
ps
,
NULL
);
minic_get_stats
(
&
tx
,
&
rx
);
...
...
shell/cmd_stat.c
View file @
e7c84b82
...
...
@@ -2,6 +2,12 @@
int
cmd_stat
(
const
char
*
args
[])
{
wrc_log_stats
();
if
(
!
strcasecmp
(
args
[
0
],
"cont"
)
)
{
wrc_ui_mode
=
UI_STAT_MODE
;
}
else
wrc_log_stats
(
1
);
return
0
;
}
\ No newline at end of file
}
wrc_main.c
View file @
e7c84b82
...
...
@@ -133,6 +133,15 @@ static void ui_update()
wrc_ui_mode
=
UI_SHELL_MODE
;
}
}
else
if
(
wrc_ui_mode
==
UI_STAT_MODE
)
{
wrc_log_stats
(
0
);
if
(
uart_read_byte
()
==
27
)
{
shell_init
();
wrc_ui_mode
=
UI_SHELL_MODE
;
}
}
else
shell_interactive
();
...
...
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