• Alessandro Rubini's avatar
    stat: always print one line when turning stats on · 684fa5cd
    Alessandro Rubini authored
    With the new "only print if sth happens" way, sometimes stats is
    just silent forever. This happens if we are master or if no slave
    is active (well, and during initial setting up the wr link).
    
    So now typing "stat" or "stat on" will turn on stats and print a line
    of statistics, every time -- or the line "statistics now off".
    This happens by changing the internal status of monitor_ppsi.c,
    now exported to the cmd_stat.c.
    
    This is the result on a master system:
    
       wrc# stat
       lnk:1 rx:0 tx:3 lock:1 sv:0 ss:'' aux:1 sec:5 [...]
       wrc#
       wrc#
       wrc# stat
       statistics now off
       wrc#
       wrc#
       wrc# stat
       lnk:1 rx:0 tx:11 lock:1 sv:0 ss:'' aux:1 sec:8 [...]
       wrc#
       wrc#
    
    And this is what happens when we become slave:
    
       wrc# mode slave
       Locking PLL
       wrc# ptp start
       Slave Only, clock class set to 255
       wrc# lnk:1 rx:57 tx:60 lock:1 sv:1 ss:'SYNC_SEC' aux:1 sec:49 [...]
       lnk:1 rx:70 tx:64 lock:1 sv:1 ss:'SYNC_NSEC' aux:1 sec:1444901411 [...]
       lnk:1 rx:77 tx:66 lock:1 sv:1 ss:'SYNC_PHASE' aux:1 sec:1444901414 [...]
       lnk:1 rx:83 tx:68 lock:1 sv:1 ss:'WAIT_OFFSET_STABLE' aux:1 sec:1444901416 [...]
       lnk:1 rx:87 tx:69 lock:1 sv:1 ss:'WAIT_OFFSET_STABLE' aux:1 sec:1444901417 [...]
       lnk:1 rx:90 tx:70 lock:1 sv:1 ss:'TRACK_PHASE' aux:1 sec:1444901418 [...]
       lnk:1 rx:94 tx:71 lock:1 sv:1 ss:'TRACK_PHASE' aux:1 sec:1444901419 [...]
    Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
    684fa5cd
Name
Last commit
Last update
arch/lm32 Loading commit data...
boards/arria Loading commit data...
configs Loading commit data...
dev Loading commit data...
doc Loading commit data...
include Loading commit data...
ipc Loading commit data...
lib Loading commit data...
monitor Loading commit data...
pp_printf Loading commit data...
ppsi @ a28d309b
scripts Loading commit data...
sdb-lib Loading commit data...
shell Loading commit data...
softpll Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
COPYING Loading commit data...
Kconfig Loading commit data...
MAKEALL Loading commit data...
Makefile Loading commit data...
Makefile.kconfig Loading commit data...
bigobj.lds Loading commit data...
check-error.c Loading commit data...
revision.c Loading commit data...
system_checks.c Loading commit data...
wrc_main.c Loading commit data...
wrc_ptp.h Loading commit data...
wrs_main.c Loading commit data...