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
31
Issues
31
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
45c725c3
Commit
45c725c3
authored
Jul 29, 2019
by
Miguel Jimenez Lopez
Committed by
Benoit Rat
Oct 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stat: Add a special case to print only one time statistics.
parent
c0ffd31c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
monitor_ppsi.c
monitor/monitor_ppsi.c
+5
-0
cmd_stat.c
shell/cmd_stat.c
+3
-0
No files found.
monitor/monitor_ppsi.c
View file @
45c725c3
...
@@ -330,6 +330,11 @@ static int wrc_log_stats(void)
...
@@ -330,6 +330,11 @@ static int wrc_log_stats(void)
ptp_mode
!=
WRC_MODE_SLAVE
)
ptp_mode
!=
WRC_MODE_SLAVE
)
return
0
;
return
0
;
last_jiffies
=
timer_get_tics
();
last_jiffies
=
timer_get_tics
();
/* Print only one time */
if
(
wrc_stat_running
==
-
1
)
wrc_stat_running
=
0
;
wrc_stats_last
=
s
->
update_count
;
wrc_stats_last
=
s
->
update_count
;
shw_pps_gen_get_time
(
&
sec
,
&
nsec
);
shw_pps_gen_get_time
(
&
sec
,
&
nsec
);
...
...
shell/cmd_stat.c
View file @
45c725c3
...
@@ -35,6 +35,9 @@ static int cmd_stat(const char *args[])
...
@@ -35,6 +35,9 @@ static int cmd_stat(const char *args[])
}
else
if
(
!
strcasecmp
(
args
[
0
],
"off"
))
{
}
else
if
(
!
strcasecmp
(
args
[
0
],
"off"
))
{
wrc_stat_running
=
0
;
wrc_stat_running
=
0
;
pp_printf
(
"statistics now off
\n
"
);
pp_printf
(
"statistics now off
\n
"
);
}
else
if
(
!
strcasecmp
(
args
[
0
],
"1"
))
{
wrc_stat_running
=
-
1
;
/* Special meaning... (only one) */
wrc_stats_last
--
;
/* force a line to be printed */
}
else
}
else
return
-
EINVAL
;
return
-
EINVAL
;
return
0
;
return
0
;
...
...
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