+ /* Register counter indices in the stat segment directory */
+ {
+ int i;
+ u8 *error_name;
+
+ for (i = 0; i < n_errors; i++)
+ {
+ error_name = format (0, "/err/%v/%s%c", n->name, error_strings[i], 0);
+ /* Note: error_name consumed by the following call */
+ vlib_stats_register_error_index (error_name, em->counters,
+ n->error_heap_index + i);
+ }
+ }
+
+ /* (re)register the em->counters base address, switch back to main heap */
+ vlib_stats_pop_heap2 (em->counters, vm->thread_index, oldheap);
+