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
f97b598d
Commit
f97b598d
authored
Nov 10, 2015
by
Grzegorz Daniluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor_ppsi: print stats for master mode as well
parent
67a039a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
24 deletions
+47
-24
monitor_ppsi.c
monitor/monitor_ppsi.c
+47
-24
No files found.
monitor/monitor_ppsi.c
View file @
f97b598d
...
@@ -28,6 +28,7 @@ extern int wrc_man_phase;
...
@@ -28,6 +28,7 @@ extern int wrc_man_phase;
extern
struct
pp_servo
servo
;
extern
struct
pp_servo
servo
;
extern
struct
pp_instance
ppi_static
;
extern
struct
pp_instance
ppi_static
;
struct
pp_instance
*
ppi
=
&
ppi_static
;
struct
pp_instance
*
ppi
=
&
ppi_static
;
const
char
*
ptp_unknown_str
=
"unknown"
;
static
void
wrc_mon_std_servo
(
void
);
static
void
wrc_mon_std_servo
(
void
);
...
@@ -47,18 +48,26 @@ static char* print64(uint64_t x)
...
@@ -47,18 +48,26 @@ static char* print64(uint64_t x)
}
}
static
int
wrc_mon_status
(
void
)
static
char
*
wrc_ptp_state
(
void
)
{
{
struct
wr_servo_state
*
s
=
&
((
struct
wr_data
*
)
ppi
->
ext_data
)
->
servo_state
;
struct
pp_state_table_item
*
ip
=
NULL
;
struct
pp_state_table_item
*
ip
=
NULL
;
for
(
ip
=
pp_state_table
;
ip
->
state
!=
PPS_END_OF_TABLE
;
ip
++
)
{
for
(
ip
=
pp_state_table
;
ip
->
state
!=
PPS_END_OF_TABLE
;
ip
++
)
{
if
(
ip
->
state
==
ppi
->
state
)
if
(
ip
->
state
==
ppi
->
state
)
break
;
break
;
}
}
if
(
!
ip
)
return
ptp_unknown_str
;
return
ip
->
name
;
}
static
int
wrc_mon_status
(
void
)
{
struct
wr_servo_state
*
s
=
&
((
struct
wr_data
*
)
ppi
->
ext_data
)
->
servo_state
;
cprintf
(
C_BLUE
,
"
\n\n
PTP status: "
);
cprintf
(
C_BLUE
,
"
\n\n
PTP status: "
);
cprintf
(
C_WHITE
,
"%s"
,
ip
?
ip
->
name
:
"unknown"
);
cprintf
(
C_WHITE
,
"%s"
,
wrc_ptp_state
()
);
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
,
...
@@ -281,9 +290,18 @@ int wrc_log_stats(void)
...
@@ -281,9 +290,18 @@ int wrc_log_stats(void)
uint32_t
nsec
;
uint32_t
nsec
;
struct
wr_servo_state
*
s
=
struct
wr_servo_state
*
s
=
&
((
struct
wr_data
*
)
ppi
->
ext_data
)
->
servo_state
;
&
((
struct
wr_data
*
)
ppi
->
ext_data
)
->
servo_state
;
static
uint32_t
last_jiffies
;
if
(
wrc_stats_last
==
s
->
update_count
)
if
(
!
last_jiffies
)
last_jiffies
=
timer_get_tics
()
-
1
-
wrc_ui_refperiod
;
/* stats update condition for Slave mode */
if
(
wrc_stats_last
==
s
->
update_count
&&
ptp_mode
==
WRC_MODE_SLAVE
)
return
0
;
return
0
;
/* stats update condition for Master mode */
if
(
time_before
(
timer_get_tics
(),
last_jiffies
+
wrc_ui_refperiod
)
&&
ptp_mode
!=
WRC_MODE_SLAVE
)
return
0
;
last_jiffies
=
timer_get_tics
();
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
);
...
@@ -291,31 +309,36 @@ int wrc_log_stats(void)
...
@@ -291,31 +309,36 @@ int wrc_log_stats(void)
minic_get_stats
(
&
tx
,
&
rx
);
minic_get_stats
(
&
tx
,
&
rx
);
pp_printf
(
"lnk:%d rx:%d tx:%d "
,
state
.
state
,
rx
,
tx
);
pp_printf
(
"lnk:%d rx:%d tx:%d "
,
state
.
state
,
rx
,
tx
);
pp_printf
(
"lock:%d "
,
state
.
locked
?
1
:
0
);
pp_printf
(
"lock:%d "
,
state
.
locked
?
1
:
0
);
pp_printf
(
"sv:%d "
,
(
s
->
flags
&
WR_FLAG_VALID
)
?
1
:
0
);
pp_printf
(
"ptp:%s "
,
wrc_ptp_state
());
pp_printf
(
"ss:'%s' "
,
s
->
servo_state_name
);
if
(
ptp_mode
==
WRC_MODE_SLAVE
)
{
pp_printf
(
"sv:%d "
,
(
s
->
flags
&
WR_FLAG_VALID
)
?
1
:
0
);
pp_printf
(
"ss:'%s' "
,
s
->
servo_state_name
);
}
aux_stat
=
spll_get_aux_status
(
0
);
aux_stat
=
spll_get_aux_status
(
0
);
pp_printf
(
"aux:%x "
,
aux_stat
);
pp_printf
(
"aux:%x "
,
aux_stat
);
/* fixme: clock is not always 125 MHz */
/* fixme: clock is not always 125 MHz */
pp_printf
(
"sec:%d nsec:%d "
,
(
uint32_t
)
sec
,
nsec
);
pp_printf
(
"sec:%d nsec:%d "
,
(
uint32_t
)
sec
,
nsec
);
pp_printf
(
"mu:%s "
,
print64
(
s
->
picos_mu
));
if
(
ptp_mode
==
WRC_MODE_SLAVE
)
{
pp_printf
(
"dms:%s "
,
print64
(
s
->
delta_ms
));
pp_printf
(
"mu:%s "
,
print64
(
s
->
picos_mu
));
pp_printf
(
"dtxm:%d drxm:%d "
,
(
int32_t
)
s
->
delta_tx_m
,
pp_printf
(
"dms:%s "
,
print64
(
s
->
delta_ms
));
(
int32_t
)
s
->
delta_rx_m
);
pp_printf
(
"dtxm:%d drxm:%d "
,
(
int32_t
)
s
->
delta_tx_m
,
pp_printf
(
"dtxs:%d drxs:%d "
,
(
int32_t
)
s
->
delta_tx_s
,
(
int32_t
)
s
->
delta_rx_m
);
(
int32_t
)
s
->
delta_rx_s
);
pp_printf
(
"dtxs:%d drxs:%d "
,
(
int32_t
)
s
->
delta_tx_s
,
int64_t
total_asymmetry
=
s
->
picos_mu
-
(
int32_t
)
s
->
delta_rx_s
);
2LL
*
s
->
delta_ms
;
int64_t
total_asymmetry
=
s
->
picos_mu
-
pp_printf
(
"asym:%d "
,
(
int32_t
)
(
total_asymmetry
));
2LL
*
s
->
delta_ms
;
pp_printf
(
"crtt:%s "
,
print64
(
s
->
picos_mu
-
pp_printf
(
"asym:%d "
,
(
int32_t
)
(
total_asymmetry
));
s
->
delta_tx_m
-
pp_printf
(
"crtt:%s "
,
print64
(
s
->
picos_mu
-
s
->
delta_rx_m
-
s
->
delta_tx_m
-
s
->
delta_tx_s
-
s
->
delta_rx_m
-
s
->
delta_rx_s
));
s
->
delta_tx_s
-
pp_printf
(
"cko:%d "
,
(
int32_t
)
(
s
->
offset
));
s
->
delta_rx_s
));
pp_printf
(
"setp:%d "
,
(
int32_t
)
(
s
->
cur_setpoint
));
pp_printf
(
"cko:%d "
,
(
int32_t
)
(
s
->
offset
));
pp_printf
(
"setp:%d "
,
(
int32_t
)
(
s
->
cur_setpoint
));
pp_printf
(
"ucnt:%d "
,
(
int32_t
)
s
->
update_count
);
}
pp_printf
(
"hd:%d md:%d ad:%d "
,
spll_get_dac
(
-
1
),
spll_get_dac
(
0
),
pp_printf
(
"hd:%d md:%d ad:%d "
,
spll_get_dac
(
-
1
),
spll_get_dac
(
0
),
spll_get_dac
(
1
));
spll_get_dac
(
1
));
pp_printf
(
"ucnt:%d "
,
(
int32_t
)
s
->
update_count
);
if
(
1
)
{
if
(
1
)
{
int32_t
temp
;
int32_t
temp
;
...
...
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