Add support for ethernet address in LISP API
[vpp.git] / vpp / stats / stats.c
index 3bebaf9..2d366fa 100644 (file)
@@ -22,23 +22,23 @@ stats_main_t stats_main;
 
 #include <vnet/ip/ip.h>
 
-#include <api/vpe_msg_enum.h>
+#include <vpp-api/vpe_msg_enum.h>
 
 #define f64_endian(a)
 #define f64_print(a,b)
 
 #define vl_typedefs             /* define message structures */
-#include <api/vpe_all_api_h.h> 
+#include <vpp-api/vpe_all_api_h.h> 
 #undef vl_typedefs
 
 #define vl_endianfun             /* define message structures */
-#include <api/vpe_all_api_h.h> 
+#include <vpp-api/vpe_all_api_h.h> 
 #undef vl_endianfun
 
 /* instantiate all the print functions we know about */
 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
 #define vl_printfun
-#include <api/vpe_all_api_h.h>
+#include <vpp-api/vpe_all_api_h.h>
 #undef vl_printfun
 
 #define foreach_stats_msg                               \
@@ -614,6 +614,7 @@ static void stats_thread_fn (void *arg)
 {
     stats_main_t *sm = &stats_main;
     vlib_worker_thread_t *w = (vlib_worker_thread_t *)arg;
+    vlib_thread_main_t *tm = vlib_get_thread_main();
     
     /* stats thread wants no signals. */
     {
@@ -622,6 +623,10 @@ static void stats_thread_fn (void *arg)
         pthread_sigmask (SIG_SETMASK, &s, 0);
     }
 
+    if (vec_len(tm->thread_prefix))
+        vlib_set_thread_name((char *)
+               format(0, "%v_stats%c", tm->thread_prefix, '\0'));
+
     clib_mem_set_heap (w->thread_mheap);
 
     while (1) {
@@ -661,7 +666,7 @@ static void vl_api_vnet_interface_counters_t_handler (
         if (q) {
             if (q_prev && (q_prev->cursize < q_prev->maxsize)) {
                 mp_copy = vl_msg_api_alloc_as_if_client(mp_size);
-                memcpy(mp_copy, mp, mp_size);
+                clib_memcpy(mp_copy, mp, mp_size);
                 vl_msg_api_send_shmem (q_prev, (u8 *)&mp);
                 mp = mp_copy;
             }
@@ -771,7 +776,7 @@ static void vl_api_vnet_ip4_fib_counters_t_handler (
         if (q) {
             if (q_prev && (q_prev->cursize < q_prev->maxsize)) {
                 mp_copy = vl_msg_api_alloc_as_if_client(mp_size);
-                memcpy(mp_copy, mp, mp_size);
+                clib_memcpy(mp_copy, mp, mp_size);
                 vl_msg_api_send_shmem (q_prev, (u8 *)&mp);
                 mp = mp_copy;
             }
@@ -804,7 +809,7 @@ static void vl_api_vnet_ip6_fib_counters_t_handler (
         if (q) {
             if (q_prev && (q_prev->cursize < q_prev->maxsize)) {
                 mp_copy = vl_msg_api_alloc_as_if_client(mp_size);
-                memcpy(mp_copy, mp, mp_size);
+                clib_memcpy(mp_copy, mp, mp_size);
                 vl_msg_api_send_shmem (q_prev, (u8 *)&mp);
                 mp = mp_copy;
             }
@@ -939,5 +944,4 @@ VLIB_REGISTER_THREAD (stats_thread_reg, static) = {
     .count = 1,
     .no_data_structure_clone = 1,
     .use_pthreads = 1,
-    .mheap_size = 2<<20,
 };