api: API trace improvements
[vpp.git] / src / vlibmemory / memory_client.c
index bd89526..f0b05b7 100644 (file)
@@ -63,7 +63,7 @@ rx_thread_fn (void *arg)
 
   vlibapi_set_main (a->am);
   vlibapi_set_memory_client_main (a->mm);
-  clib_mem_free (a);
+  free (a);
 
   mm = vlibapi_get_memory_client_main ();
   q = vlibapi_get_main ()->vl_input_queue;
@@ -362,14 +362,14 @@ _(MEMCLNT_KEEPALIVE, memclnt_keepalive)
 void
 vl_client_install_client_message_handlers (void)
 {
-
-#define _(N,n)                                                  \
-    vl_msg_api_set_handlers(VL_API_##N, #n,                     \
-                            vl_api_##n##_t_handler,             \
-                            noop_handler,                       \
-                            vl_api_##n##_t_endian,              \
-                            vl_api_##n##_t_print,               \
-                            sizeof(vl_api_##n##_t), 1);
+  api_main_t *am = vlibapi_get_main ();
+#define _(N, n)                                                               \
+  vl_msg_api_set_handlers (VL_API_##N, #n, vl_api_##n##_t_handler,            \
+                          noop_handler, vl_api_##n##_t_endian,               \
+                          vl_api_##n##_t_print, sizeof (vl_api_##n##_t), 0,  \
+                          vl_api_##n##_t_print_json, vl_api_##n##_t_tojson,  \
+                          vl_api_##n##_t_fromjson);                          \
+  am->api_trace_cfg[VL_API_##N].replay_enable = 0;
   foreach_api_msg;
 #undef _
 }
@@ -395,7 +395,7 @@ vl_client_api_unmap (void)
 u8
 vl_mem_client_is_connected (void)
 {
-  return (memory_client_main.connected_to_vlib != 0);
+  return (my_memory_client_main->connected_to_vlib != 0);
 }
 
 static int
@@ -428,7 +428,7 @@ connect_to_vlib_internal (const char *svm_name,
       if (thread_fn == rx_thread_fn)
        {
          rx_thread_fn_arg_t *arg;
-         arg = clib_mem_alloc (sizeof (*arg));
+         arg = malloc (sizeof (*arg));
          arg->am = vlibapi_get_main ();
          arg->mm = vlibapi_get_memory_client_main ();
          thread_fn_arg = (void *) arg;