Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Software for White Rabbit PTP Core
Manage
Activity
Members
Labels
Plan
Issues
39
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Projects
Software for White Rabbit PTP Core
Commits
f97b598d
Commit
f97b598d
authored
9 years ago
by
Grzegorz Daniluk
Browse files
Options
Downloads
Patches
Plain Diff
monitor_ppsi: print stats for master mode as well
parent
67a039a9
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
monitor/monitor_ppsi.c
+47
-24
47 additions, 24 deletions
monitor/monitor_ppsi.c
with
47 additions
and
24 deletions
monitor/monitor_ppsi.c
+
47
−
24
View file @
f97b598d
...
...
@@ -28,6 +28,7 @@ extern int wrc_man_phase;
extern
struct
pp_servo
servo
;
extern
struct
pp_instance
ppi_static
;
struct
pp_instance
*
ppi
=
&
ppi_static
;
const
char
*
ptp_unknown_str
=
"unknown"
;
static
void
wrc_mon_std_servo
(
void
);
...
...
@@ -47,18 +48,26 @@ static char* print64(uint64_t x)
}
static
int
wrc_
mon
_stat
us
(
void
)
static
char
*
wrc_
ptp
_stat
e
(
void
)
{
struct
wr_servo_state
*
s
=
&
((
struct
wr_data
*
)
ppi
->
ext_data
)
->
servo_state
;
struct
pp_state_table_item
*
ip
=
NULL
;
for
(
ip
=
pp_state_table
;
ip
->
state
!=
PPS_END_OF_TABLE
;
ip
++
)
{
if
(
ip
->
state
==
ppi
->
state
)
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_WHITE
,
"%s"
,
ip
?
ip
->
name
:
"unknown"
);
cprintf
(
C_WHITE
,
"%s"
,
wrc_ptp_state
()
);
if
((
!
s
->
flags
&
WR_FLAG_VALID
)
||
(
ppi
->
state
!=
PPS_SLAVE
))
{
cprintf
(
C_RED
,
...
...
@@ -281,9 +290,18 @@ int wrc_log_stats(void)
uint32_t
nsec
;
struct
wr_servo_state
*
s
=
&
((
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
;
/* 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
;
shw_pps_gen_get_time
(
&
sec
,
&
nsec
);
...
...
@@ -291,31 +309,36 @@ int wrc_log_stats(void)
minic_get_stats
(
&
tx
,
&
rx
);
pp_printf
(
"lnk:%d rx:%d tx:%d "
,
state
.
state
,
rx
,
tx
);
pp_printf
(
"lock:%d "
,
state
.
locked
?
1
:
0
);
pp_printf
(
"sv:%d "
,
(
s
->
flags
&
WR_FLAG_VALID
)
?
1
:
0
);
pp_printf
(
"ss:'%s' "
,
s
->
servo_state_name
);
pp_printf
(
"ptp:%s "
,
wrc_ptp_state
());
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
);
pp_printf
(
"aux:%x "
,
aux_stat
);
/* fixme: clock is not always 125 MHz */
pp_printf
(
"sec:%d nsec:%d "
,
(
uint32_t
)
sec
,
nsec
);
pp_printf
(
"mu:%s "
,
print64
(
s
->
picos_mu
));
pp_printf
(
"dms:%s "
,
print64
(
s
->
delta_ms
));
pp_printf
(
"dtxm:%d drxm:%d "
,
(
int32_t
)
s
->
delta_tx_m
,
(
int32_t
)
s
->
delta_rx_m
);
pp_printf
(
"dtxs:%d drxs:%d "
,
(
int32_t
)
s
->
delta_tx_s
,
(
int32_t
)
s
->
delta_rx_s
);
int64_t
total_asymmetry
=
s
->
picos_mu
-
2LL
*
s
->
delta_ms
;
pp_printf
(
"asym:%d "
,
(
int32_t
)
(
total_asymmetry
));
pp_printf
(
"crtt:%s "
,
print64
(
s
->
picos_mu
-
s
->
delta_tx_m
-
s
->
delta_rx_m
-
s
->
delta_tx_s
-
s
->
delta_rx_s
));
pp_printf
(
"cko:%d "
,
(
int32_t
)
(
s
->
offset
));
pp_printf
(
"setp:%d "
,
(
int32_t
)
(
s
->
cur_setpoint
));
if
(
ptp_mode
==
WRC_MODE_SLAVE
)
{
pp_printf
(
"mu:%s "
,
print64
(
s
->
picos_mu
));
pp_printf
(
"dms:%s "
,
print64
(
s
->
delta_ms
));
pp_printf
(
"dtxm:%d drxm:%d "
,
(
int32_t
)
s
->
delta_tx_m
,
(
int32_t
)
s
->
delta_rx_m
);
pp_printf
(
"dtxs:%d drxs:%d "
,
(
int32_t
)
s
->
delta_tx_s
,
(
int32_t
)
s
->
delta_rx_s
);
int64_t
total_asymmetry
=
s
->
picos_mu
-
2LL
*
s
->
delta_ms
;
pp_printf
(
"asym:%d "
,
(
int32_t
)
(
total_asymmetry
));
pp_printf
(
"crtt:%s "
,
print64
(
s
->
picos_mu
-
s
->
delta_tx_m
-
s
->
delta_rx_m
-
s
->
delta_tx_s
-
s
->
delta_rx_s
));
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
),
spll_get_dac
(
1
));
pp_printf
(
"ucnt:%d "
,
(
int32_t
)
s
->
update_count
);
if
(
1
)
{
int32_t
temp
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment