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
3044b042
Commit
3044b042
authored
Sep 19, 2022
by
Omar Gabella
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some counters to test
parent
602a43af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
8 deletions
+47
-8
state-wr-present.c
proto-ext-whiterabbit/state-wr-present.c
+33
-5
wr-api.h
proto-ext-whiterabbit/wr-api.h
+14
-3
No files found.
proto-ext-whiterabbit/state-wr-present.c
View file @
3044b042
...
...
@@ -24,12 +24,24 @@ int wr_present(struct pp_instance *ppi, unsigned char *pkt, int plen)
MsgSignaling
wrsig_msg
;
if
(
ppi
->
is_new_state
)
{
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_0_1
++
;
#endif // BROADCAST_BASE
wrp
->
wrStateRetry
=
WR_STATE_RETRY
;
sendmsg
=
1
;
}
else
if
(
pp_timeout
(
ppi
,
PP_TO_EXT_0
))
{
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_0_2
++
;
#endif // BROADCAST_BASE
if
(
wr_handshake_retry
(
ppi
))
sendmsg
=
1
;
else
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_0_3
++
;
#endif // BROADCAST_BASE
return
0
;
/* non-wr already */
}
...
...
@@ -38,30 +50,37 @@ int wr_present(struct pp_instance *ppi, unsigned char *pkt, int plen)
ppi
->
next_state
=
WRS_S_LOCK
;
#else
if
(
sendmsg
)
{
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_0_4
++
;
#endif // BROADCAST_BASE
__pp_timeout_set
(
ppi
,
PP_TO_EXT_0
,
WR_WRS_PRESENT_TIMEOUT_MS
);
e
=
msg_issue_wrsig
(
ppi
,
SLAVE_PRESENT
);
}
if
(
ppi
->
received_ptp_header
.
messageType
==
PPM_SIGNALING
)
{
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_1
++
;
#endif // BROADCAST_BASE
msg_unpack_wrsig
(
ppi
,
pkt
,
&
wrsig_msg
,
&
(
wrp
->
msgTmpWrMessageID
));
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_
1
++
;
WR_DSPOR
(
ppi
)
->
ctr_wr_present_
2
++
;
#endif // BROADCAST_BASE
if
(
wrp
->
msgTmpWrMessageID
==
LOCK
)
{
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_
2
++
;
WR_DSPOR
(
ppi
)
->
ctr_wr_present_
3
++
;
if
(
memcmp
(
ppi
->
received_ptp_header
.
targetIdentity
.
clockIdentity
.
id
,
DSPOR
(
ppi
)
->
portIdentity
.
clockIdentity
.
id
,
PP_CLOCK_IDENTITY_LENGTH
)
!=
0
)
{
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_
3
++
;
WR_DSPOR
(
ppi
)
->
ctr_wr_present_
4
++
;
ppi
->
next_state
=
WRS_S_LOCK
;
}
#else
...
...
@@ -72,11 +91,20 @@ int wr_present(struct pp_instance *ppi, unsigned char *pkt, int plen)
#endif // BROADCAST_NODE
if
(
e
==
0
)
{
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_00_1
++
;
#endif // BROADCAST_BASE
st_com_execute_slave
(
ppi
);
}
else
{
/* nothing, just stay here again */
}
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
WR_DSPOR
(
ppi
)
->
ctr_wr_present_00_2
++
;
#endif // BROADCAST_BASE
ppi
->
next_delay
=
WR_DSPOR
(
ppi
)
->
wrStateTimeout
;
return
e
;
...
...
proto-ext-whiterabbit/wr-api.h
View file @
3044b042
...
...
@@ -62,9 +62,20 @@ struct wr_dsport {
#ifdef BROADCAST_BASE
/* ONLY FOR TESTS */
UInteger32
ctr_wr_present_1
;
UInteger32
ctr_wr_present_2
;
UInteger32
ctr_wr_present_3
;
UInteger32
ctr_wr_present_0_1
;
UInteger32
ctr_wr_present_0_2
;
UInteger32
ctr_wr_present_0_3
;
UInteger32
ctr_wr_present_0_4
;
UInteger32
ctr_wr_present_1
;
UInteger32
ctr_wr_present_2
;
UInteger32
ctr_wr_present_3
;
UInteger32
ctr_wr_present_4
;
UInteger32
ctr_wr_present_00_1
;
UInteger32
ctr_wr_present_00_2
;
UInteger32
ctr_wr_present_00_3
;
UInteger32
ctr_wr_present_00_4
;
#endif // BROADCAST_BASE
};
...
...
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