summaryrefslogtreecommitdiffstats
path: root/src/vlibapi/api_shared.c
diff options
context:
space:
mode:
authorezkexma <maqi.z.ke@ericsson.com>2019-03-21 07:38:19 -0400
committerDave Barach <openvpp@barachs.net>2019-03-25 14:43:37 +0000
commit75f9fb6c16a749d80a1ae020d6cf7f2b222f757c (patch)
treed418ff4992eea8253c6f35fbd5066f6fe146b14f /src/vlibapi/api_shared.c
parentef71ef0ac31895a66c678f84533c8699e4b0328d (diff)
add api trace print
/vpp/src/vlibapi/api_shared.c after "set api-trace debug on",api trace will be print ontime when clients send msg to vpp. Change-Id: Ib2e504afb9e674c5cdfa6dc5c522c7af0396d687 Signed-off-by: ezkexma <maqi.z.ke@ericsson.com>
Diffstat (limited to 'src/vlibapi/api_shared.c')
-rw-r--r--src/vlibapi/api_shared.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/vlibapi/api_shared.c b/src/vlibapi/api_shared.c
index 07abe3e2759..cee9cd54f5f 100644
--- a/src/vlibapi/api_shared.c
+++ b/src/vlibapi/api_shared.c
@@ -466,6 +466,7 @@ vl_msg_api_handler_with_vm_node (api_main_t * am,
{
u16 id = ntohs (*((u16 *) the_msg));
u8 *(*handler) (void *, void *, void *);
+ u8 *(*print_fp) (void *, void *);
if (PREDICT_FALSE (vm->elog_trace_api_messages))
{
@@ -491,9 +492,23 @@ vl_msg_api_handler_with_vm_node (api_main_t * am,
{
handler = (void *) am->msg_handlers[id];
- if (am->rx_trace && am->rx_trace->enabled)
+ if (PREDICT_FALSE (am->rx_trace && am->rx_trace->enabled))
vl_msg_api_trace (am, am->rx_trace, the_msg);
+ if (PREDICT_FALSE (am->msg_print_flag))
+ {
+ fformat (stdout, "[%d]: %s\n", id, am->msg_names[id]);
+ print_fp = (void *) am->msg_print_handlers[id];
+ if (print_fp == 0)
+ {
+ fformat (stdout, " [no registered print fn for msg %d]\n", id);
+ }
+ else
+ {
+ (*print_fp) (the_msg, vm);
+ }
+ }
+
if (!am->is_mp_safe[id])
{
vl_msg_api_barrier_trace_context (am->msg_names[id]);