Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
f5d69067
Commit
f5d69067
authored
Apr 07, 2021
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add simple statistics of packet errors and servo restarts
parent
dc1c7d26
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
0 deletions
+16
-0
wrc_ptp_ppsi.c
arch-wrpc/wrc_ptp_ppsi.c
+4
-0
pp-instance.h
include/ppsi/pp-instance.h
+7
-0
wr-servo.c
proto-ext-whiterabbit/wr-servo.c
+2
-0
common-fun.c
proto-standard/common-fun.c
+3
-0
No files found.
arch-wrpc/wrc_ptp_ppsi.c
View file @
f5d69067
...
...
@@ -217,6 +217,10 @@ int wrc_ptp_start()
pp_printf
(
"PTP Start!
\n
"
);
ppi
->
stats
.
sync_errors
=
0
;
ppi
->
stats
.
followup_errors
=
0
;
ppi
->
stats
.
servo_restarts
=
0
;
pp_init_globals
(
&
ppg_static
,
&
__pp_default_rt_opts
);
/* Call the state machine. Being it in "Initializing" state, make
...
...
include/ppsi/pp-instance.h
View file @
f5d69067
...
...
@@ -178,6 +178,13 @@ struct pp_instance {
unsigned
long
ptp_tx_count
;
unsigned
long
ptp_rx_count
;
struct
{
int
sync_errors
;
int
followup_errors
;
int
servo_restarts
;
}
stats
;
};
/* The following things used to be bit fields. Other flags are now enums */
#define PPI_FLAG_FROM_CURRENT_PARENT 0x01
...
...
proto-ext-whiterabbit/wr-servo.c
View file @
f5d69067
...
...
@@ -163,6 +163,8 @@ void wr_servo_reset(struct pp_instance *ppi)
/* shmem unlock */
wrs_shm_write
(
ppsi_head
,
WRS_SHM_WRITE_END
);
ppi
->
stats
.
servo_restarts
++
;
}
static
inline
int32_t
delta_to_ps
(
struct
FixedDelta
d
)
...
...
proto-standard/common-fun.c
View file @
f5d69067
...
...
@@ -252,18 +252,21 @@ int st_com_slave_handle_followup(struct pp_instance *ppi, unsigned char *buf,
if
(
!
(
ppi
->
flags
&
PPI_FLAG_FROM_CURRENT_PARENT
))
{
pp_error
(
"%s: Follow up message is not from current parent
\n
"
,
__func__
);
ppi
->
stats
.
followup_errors
++
;
return
0
;
}
if
(
!
(
ppi
->
flags
&
PPI_FLAG_WAITING_FOR_F_UP
))
{
pp_error
(
"%s: Slave was not waiting a follow up message
\n
"
,
__func__
);
ppi
->
stats
.
followup_errors
++
;
return
0
;
}
if
(
ppi
->
recv_sync_sequence_id
!=
hdr
->
sequenceId
)
{
pp_error
(
"%s: SequenceID %d doesn't match last Sync message %d
\n
"
,
__func__
,
hdr
->
sequenceId
,
ppi
->
recv_sync_sequence_id
);
ppi
->
stats
.
followup_errors
++
;
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