remove dead code in rewrite.c
[vpp.git] / src / vlib / main.c
index c80aa5a..759c1d0 100644 (file)
@@ -680,13 +680,16 @@ vlib_node_runtime_update_stats (vlib_main_t * vm,
   return r;
 }
 
-static inline void
-vlib_node_runtime_perf_counter (vlib_main_t * vm, u64 * pmc0, u64 * pmc1)
+always_inline void
+vlib_node_runtime_perf_counter (vlib_main_t * vm, u64 * pmc0, u64 * pmc1,
+                               vlib_node_runtime_t * node,
+                               vlib_frame_t * frame, int before_or_after)
 {
   *pmc0 = 0;
   *pmc1 = 0;
   if (PREDICT_FALSE (vm->vlib_node_runtime_perf_counter_cb != 0))
-    (*vm->vlib_node_runtime_perf_counter_cb) (vm, pmc0, pmc1);
+    (*vm->vlib_node_runtime_perf_counter_cb) (vm, pmc0, pmc1, node,
+                                             frame, before_or_after);
 }
 
 always_inline void
@@ -1181,7 +1184,8 @@ dispatch_node (vlib_main_t * vm,
                             last_time_stamp, frame ? frame->n_vectors : 0,
                             /* is_after */ 0);
 
-  vlib_node_runtime_perf_counter (vm, &pmc_before[0], &pmc_before[1]);
+  vlib_node_runtime_perf_counter (vm, &pmc_before[0], &pmc_before[1],
+                                 node, frame, 0 /* before */ );
 
   /*
    * Turn this on if you run into
@@ -1215,7 +1219,8 @@ dispatch_node (vlib_main_t * vm,
    * To validate accounting: pmc_delta = t - pmc_before;
    * perf ticks should equal clocks/pkt...
    */
-  vlib_node_runtime_perf_counter (vm, &pmc_after[0], &pmc_after[1]);
+  vlib_node_runtime_perf_counter (vm, &pmc_after[0], &pmc_after[1], node,
+                                 frame, 1 /* after */ );
 
   pmc_delta[0] = pmc_after[0] - pmc_before[0];
   pmc_delta[1] = pmc_after[1] - pmc_before[1];
@@ -2083,6 +2088,17 @@ vlib_main (vlib_main_t * volatile vm, unformat_input_t * input)
   vec_validate (vm->processing_rpc_requests, 0);
   _vec_len (vm->processing_rpc_requests) = 0;
 
+  if ((error = vlib_call_all_config_functions (vm, input, 0 /* is_early */ )))
+    goto done;
+
+  /* Call all main loop enter functions. */
+  {
+    clib_error_t *sub_error;
+    sub_error = vlib_call_all_main_loop_enter_functions (vm);
+    if (sub_error)
+      clib_error_report (sub_error);
+  }
+
   switch (clib_setjmp (&vm->main_loop_exit, VLIB_MAIN_LOOP_EXIT_NONE))
     {
     case VLIB_MAIN_LOOP_EXIT_NONE:
@@ -2097,17 +2113,6 @@ vlib_main (vlib_main_t * volatile vm, unformat_input_t * input)
       goto done;
     }
 
-  if ((error = vlib_call_all_config_functions (vm, input, 0 /* is_early */ )))
-    goto done;
-
-  /* Call all main loop enter functions. */
-  {
-    clib_error_t *sub_error;
-    sub_error = vlib_call_all_main_loop_enter_functions (vm);
-    if (sub_error)
-      clib_error_report (sub_error);
-  }
-
   vlib_main_loop (vm);
 
 done: