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
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
cbe72cab
Commit
cbe72cab
authored
Feb 01, 2017
by
Adam Wujek
💬
Committed by
Grzegorz Daniluk
Feb 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUG: 1360] monitor: show IP before lock
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
6b3848b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
101 additions
and
106 deletions
+101
-106
monitor_ppsi.c
monitor/monitor_ppsi.c
+101
-106
No files found.
monitor/monitor_ppsi.c
View file @
cbe72cab
...
@@ -70,12 +70,12 @@ static int wrc_mon_status(void)
...
@@ -70,12 +70,12 @@ static int wrc_mon_status(void)
if
((
!
s
->
flags
&
WR_FLAG_VALID
)
||
(
ppi
->
state
!=
PPS_SLAVE
))
{
if
((
!
s
->
flags
&
WR_FLAG_VALID
)
||
(
ppi
->
state
!=
PPS_SLAVE
))
{
cprintf
(
C_RED
,
cprintf
(
C_RED
,
"
\n\n
Sync info not valid
\n
\n
"
);
"
\n\n
Sync info not valid
\n
"
);
return
0
;
return
0
;
}
}
/* show_servo */
/* show_servo */
cprintf
(
C_BLUE
,
"
\n\n
Synchronization status:
\n
\n
"
);
cprintf
(
C_BLUE
,
"
\n\n
Synchronization status:
\n
"
);
return
1
;
return
1
;
}
}
...
@@ -105,8 +105,8 @@ int wrc_mon_gui(void)
...
@@ -105,8 +105,8 @@ int wrc_mon_gui(void)
term_clear
();
term_clear
();
pcprintf
(
1
,
1
,
C_BLUE
,
"WR PTP Core Sync Monitor v 1.0"
);
cprintf
(
C_BLUE
,
"WR PTP Core Sync Monitor v 1.0"
);
pcprintf
(
2
,
1
,
C_GREY
,
"
Esc = exit"
);
cprintf
(
C_GREY
,
"
\n
Esc = exit"
);
shw_pps_gen_get_time
(
&
sec
,
&
nsec
);
shw_pps_gen_get_time
(
&
sec
,
&
nsec
);
...
@@ -115,133 +115,130 @@ int wrc_mon_gui(void)
...
@@ -115,133 +115,130 @@ int wrc_mon_gui(void)
/*show_ports */
/*show_ports */
wrpc_get_port_state
(
&
state
,
NULL
);
wrpc_get_port_state
(
&
state
,
NULL
);
pcprintf
(
4
,
1
,
C_BLUE
,
"
\n\n
Link status:"
);
cprintf
(
C_BLUE
,
"
\n\n
Link status:"
);
pcprintf
(
6
,
1
,
C_WHITE
,
"
%s: "
,
"wru1"
);
cprintf
(
C_WHITE
,
"
\n
%s: "
,
"wru1"
);
if
(
state
.
state
)
if
(
state
.
state
)
cprintf
(
C_GREEN
,
"Link up "
);
cprintf
(
C_GREEN
,
"Link up "
);
else
else
cprintf
(
C_RED
,
"Link down "
);
cprintf
(
C_RED
,
"Link down "
);
if
(
state
.
state
)
{
minic_get_stats
(
&
tx
,
&
rx
);
minic_get_stats
(
&
tx
,
&
rx
);
cprintf
(
C_GREY
,
"(RX: %d, TX: %d)"
,
rx
,
tx
);
cprintf
(
C_GREY
,
"(RX: %d, TX: %d), mode: "
,
rx
,
tx
);
if
(
!
WR_DSPOR
(
ppi
)
->
wrModeOn
)
{
if
(
!
state
.
state
)
{
wrc_mon_std_servo
();
return
1
;
return
1
;
}
}
switch
(
ptp_mode
)
{
if
(
HAS_IP
)
{
case
WRC_MODE_GM
:
uint8_t
ip
[
4
];
case
WRC_MODE_MASTER
:
cprintf
(
C_WHITE
,
"WR Master "
);
cprintf
(
C_WHITE
,
" IPv4: "
);
getIP
(
ip
);
format_ip
(
buf
,
ip
);
switch
(
ip_status
)
{
case
IP_TRAINING
:
cprintf
(
C_RED
,
"BOOTP running"
);
break
;
case
IP_OK_BOOTP
:
cprintf
(
C_GREEN
,
"%s (from bootp)"
,
buf
);
break
;
break
;
case
WRC_MODE_SLAVE
:
case
IP_OK_STATIC
:
cprintf
(
C_
WHITE
,
"WR Slave "
);
cprintf
(
C_
GREEN
,
"%s (static assignment)"
,
buf
);
break
;
break
;
default:
cprintf
(
C_RED
,
"WR Unknown "
);
}
}
}
if
(
state
.
locked
)
cprintf
(
C_GREY
,
"
\n
Mode: "
);
cprintf
(
C_GREEN
,
"Locked "
);
else
cprintf
(
C_RED
,
"NoLock "
);
if
(
state
.
calib
.
rx_calibrated
&&
state
.
calib
.
tx_calibrated
)
cprintf
(
C_GREEN
,
"Calibrated "
);
else
cprintf
(
C_RED
,
"Uncalibrated "
);
if
(
HAS_IP
)
{
uint8_t
ip
[
4
];
cprintf
(
C_WHITE
,
"
\n
IPv4: "
);
getIP
(
ip
);
format_ip
(
buf
,
ip
);
switch
(
ip_status
)
{
case
IP_TRAINING
:
cprintf
(
C_RED
,
"BOOTP running"
);
break
;
case
IP_OK_BOOTP
:
cprintf
(
C_GREEN
,
"%s (from bootp)"
,
buf
);
break
;
case
IP_OK_STATIC
:
cprintf
(
C_GREEN
,
"%s (static assignment)"
,
buf
);
break
;
}
}
if
(
wrc_mon_status
()
==
0
)
if
(
!
WR_DSPOR
(
ppi
)
->
wrModeOn
)
{
return
1
;
cprintf
(
C_RED
,
"WR Off"
);
wrc_mon_std_servo
();
return
1
;
}
cprintf
(
C_GREY
,
"Servo state: "
);
switch
(
ptp_mode
)
{
cprintf
(
C_WHITE
,
"%s
\n
"
,
s
->
servo_state_name
);
case
WRC_MODE_GM
:
cprintf
(
C_GREY
,
"Phase tracking: "
);
case
WRC_MODE_MASTER
:
if
(
s
->
tracking_enabled
)
cprintf
(
C_WHITE
,
"WR Master "
);
cprintf
(
C_GREEN
,
"ON
\n
"
)
;
break
;
else
case
WRC_MODE_SLAVE
:
cprintf
(
C_RED
,
"OFF
\n
"
);
cprintf
(
C_WHITE
,
"WR Slave
"
);
/* sync source not implemented */
break
;
/*cprintf(C_GREY, "Synchronization source: ");
default:
cprintf(C_
WHITE, "%s\n", cur_servo_state.sync_source);*/
cprintf
(
C_
RED
,
"WR Unknown "
);
cprintf
(
C_GREY
,
"Aux clock status: "
);
}
aux_stat
=
spll_get_aux_status
(
0
);
if
(
state
.
locked
)
cprintf
(
C_GREEN
,
"Locked "
);
else
cprintf
(
C_RED
,
"NoLock "
);
if
(
state
.
calib
.
rx_calibrated
&&
state
.
calib
.
tx_calibrated
)
cprintf
(
C_GREEN
,
"Calibrated"
);
else
cprintf
(
C_RED
,
"Uncalibrated"
);
if
(
aux_stat
&
SPLL_AUX_ENABLED
)
cprintf
(
C_GREEN
,
"enabled"
);
if
(
aux_stat
&
SPLL_AUX_LOCKED
)
if
(
wrc_mon_status
()
==
0
)
cprintf
(
C_GREEN
,
", locked"
);
return
1
;
pp_printf
(
"
\n
"
);
cprintf
(
C_BLUE
,
"
\n
Timing parameters:
\n\n
"
);
cprintf
(
C_GREY
,
"Servo state: "
);
cprintf
(
C_WHITE
,
"%s
\n
"
,
s
->
servo_state_name
);
cprintf
(
C_GREY
,
"Phase tracking: "
);
if
(
s
->
tracking_enabled
)
cprintf
(
C_GREEN
,
"ON
\n
"
);
else
cprintf
(
C_RED
,
"OFF
\n
"
);
/* sync source not implemented */
/*cprintf(C_GREY, "Synchronization source: ");
cprintf(C_WHITE, "%s\n", cur_servo_state.sync_source);*/
cprintf
(
C_GREY
,
"Aux clock status: "
);
cprintf
(
C_GREY
,
"Round-trip time (mu): "
);
aux_stat
=
spll_get_aux_status
(
0
);
cprintf
(
C_WHITE
,
"%s ps
\n
"
,
print64
(
s
->
picos_mu
));
cprintf
(
C_GREY
,
"Master-slave delay: "
);
cprintf
(
C_WHITE
,
"%s ps
\n
"
,
print64
(
s
->
delta_ms
));
cprintf
(
C_GREY
,
"Master PHY delays: "
);
if
(
aux_stat
&
SPLL_AUX_ENABLED
)
cprintf
(
C_WHITE
,
"TX: %d ps, RX: %d ps
\n
"
,
cprintf
(
C_GREEN
,
"enabled"
);
(
int32_t
)
s
->
delta_tx_m
,
(
int32_t
)
s
->
delta_rx_m
);
cprintf
(
C_GREY
,
"Slave PHY delays: "
);
if
(
aux_stat
&
SPLL_AUX_LOCKED
)
cprintf
(
C_WHITE
,
"TX: %d ps, RX: %d ps
\n
"
,
cprintf
(
C_GREEN
,
", locked"
);
(
int32_t
)
s
->
delta_tx_s
,
pp_printf
(
"
\n
"
);
(
int32_t
)
s
->
delta_rx_s
);
total_asymmetry
=
s
->
picos_mu
-
2LL
*
s
->
delta_ms
;
cprintf
(
C_GREY
,
"Total link asymmetry: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
total_asymmetry
));
crtt
=
s
->
picos_mu
-
s
->
delta_tx_m
-
s
->
delta_rx_m
cprintf
(
C_BLUE
,
"
\n
Timing parameters:
\n
"
);
-
s
->
delta_tx_s
-
s
->
delta_rx_s
;
cprintf
(
C_GREY
,
"Cable rtt delay: "
);
cprintf
(
C_WHITE
,
"%s ps
\n
"
,
print64
(
crtt
));
cprintf
(
C_GREY
,
"Clock offset: "
);
cprintf
(
C_GREY
,
"Round-trip time (mu): "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
cprintf
(
C_WHITE
,
"%s ps
\n
"
,
print64
(
s
->
picos_mu
));
(
int32_t
)
(
s
->
offset
));
cprintf
(
C_GREY
,
"Master-slave delay: "
);
cprintf
(
C_WHITE
,
"%s ps
\n
"
,
print64
(
s
->
delta_ms
));
cprintf
(
C_GREY
,
"Phase setpoint: "
);
cprintf
(
C_GREY
,
"Master PHY delays: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
cprintf
(
C_WHITE
,
"TX: %d ps, RX: %d ps
\n
"
,
(
s
->
cur_setpoint
));
(
int32_t
)
s
->
delta_tx_m
,
(
int32_t
)
s
->
delta_rx_m
);
cprintf
(
C_GREY
,
"Skew: "
);
cprintf
(
C_GREY
,
"Slave PHY delays: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
cprintf
(
C_WHITE
,
"TX: %d ps, RX: %d ps
\n
"
,
(
int32_t
)
(
s
->
skew
));
(
int32_t
)
s
->
delta_tx_s
,
(
int32_t
)
s
->
delta_rx_s
);
total_asymmetry
=
s
->
picos_mu
-
2LL
*
s
->
delta_ms
;
cprintf
(
C_GREY
,
"Total link asymmetry: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
total_asymmetry
));
cprintf
(
C_GREY
,
"Update counter: "
);
crtt
=
s
->
picos_mu
-
s
->
delta_tx_m
-
s
->
delta_rx_m
cprintf
(
C_WHITE
,
"%9d
\n
"
,
-
s
->
delta_tx_s
-
s
->
delta_rx_s
;
(
int32_t
)
(
s
->
update_count
));
cprintf
(
C_GREY
,
"Cable rtt delay: "
);
cprintf
(
C_WHITE
,
"%s ps
\n
"
,
print64
(
crtt
));
cprintf
(
C_GREY
,
"Clock offset: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
s
->
offset
));
}
cprintf
(
C_GREY
,
"Phase setpoint: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
s
->
cur_setpoint
));
pp_printf
(
"--"
);
cprintf
(
C_GREY
,
"Skew: "
);
cprintf
(
C_WHITE
,
"%9d ps
\n
"
,
(
int32_t
)
(
s
->
skew
));
cprintf
(
C_GREY
,
"Update counter: "
);
cprintf
(
C_WHITE
,
"%9d
\n
"
,
(
int32_t
)
(
s
->
update_count
));
return
1
;
return
1
;
}
}
...
@@ -264,12 +261,10 @@ static inline void cprintf_time(int color, struct pp_time *time)
...
@@ -264,12 +261,10 @@ static inline void cprintf_time(int color, struct pp_time *time)
static
void
wrc_mon_std_servo
(
void
)
static
void
wrc_mon_std_servo
(
void
)
{
{
cprintf
(
C_RED
,
"WR Off"
);
if
(
wrc_mon_status
()
==
0
)
if
(
wrc_mon_status
()
==
0
)
return
;
return
;
cprintf
(
C_GREY
,
"Clock offset: "
);
cprintf
(
C_GREY
,
"
\n
Clock offset: "
);
if
(
DSCUR
(
ppi
)
->
offsetFromMaster
.
secs
)
if
(
DSCUR
(
ppi
)
->
offsetFromMaster
.
secs
)
cprintf_time
(
C_WHITE
,
&
DSCUR
(
ppi
)
->
offsetFromMaster
);
cprintf_time
(
C_WHITE
,
&
DSCUR
(
ppi
)
->
offsetFromMaster
);
...
...
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