Added scan time output.
authorFlorian Pose <fp@igh-essen.com>
Mon, 12 Mar 2007 13:59:23 +0000
changeset 652 15cff76b66c7
parent 651 8c11399cc911
child 653 33aa0e7e5a68
Added scan time output.
master/fsm_master.c
master/fsm_master.h
--- a/master/fsm_master.c	Mon Mar 12 13:59:06 2007 +0000
+++ b/master/fsm_master.c	Mon Mar 12 13:59:23 2007 +0000
@@ -227,6 +227,7 @@
         fsm->topology_change_pending = 0;
         fsm->tainted = 0;
         fsm->idle = 0;
+        fsm->scan_jiffies = jiffies;
 
         ec_master_eoe_stop(master);
         ec_master_destroy_slaves(master);
@@ -744,11 +745,13 @@
 /*****************************************************************************/
 
 /**
-   Master state: SCAN SLAVES.
-   Executes the sub-statemachine for the scanning of a slave.
-*/
-
-void ec_fsm_master_state_scan_slaves(ec_fsm_master_t *fsm /**< master state machine */)
+ * Master state: SCAN SLAVES.
+ * Executes the sub-statemachine for the scanning of a slave.
+ */
+
+void ec_fsm_master_state_scan_slaves(
+        ec_fsm_master_t *fsm /**< master state machine */
+        )
 {
     ec_master_t *master = fsm->master;
     ec_slave_t *slave = fsm->slave;
@@ -764,7 +767,8 @@
         return;
     }
 
-    EC_INFO("Bus scanning completed.\n");
+    EC_INFO("Bus scanning completed in %u ms.\n",
+            (u32) (jiffies - fsm->scan_jiffies) * 1000 / HZ);
 
     // set initial states of all slaves to PREOP to make mailbox
     // communication possible
--- a/master/fsm_master.h	Mon Mar 12 13:59:06 2007 +0000
+++ b/master/fsm_master.h	Mon Mar 12 13:59:23 2007 +0000
@@ -82,6 +82,7 @@
 
     void (*state)(ec_fsm_master_t *); /**< master state function */
     int idle; /**< state machine is in idle phase */
+    unsigned long scan_jiffies; /**< beginning of slave scanning */
     unsigned int slaves_responding; /**< number of responding slaves */
     unsigned int topology_change_pending; /**< bus topology changed */
     ec_slave_state_t slave_states; /**< states of responding slaves */