vlib: fix potential crash in dispatch_node ELOG_DATA call 16/5516/2
authorSteven <sluong@cisco.com>
Fri, 24 Feb 2017 18:03:22 +0000 (10:03 -0800)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 17 Mar 2017 12:57:53 +0000 (12:57 +0000)
commit6aa75af2411a328caa23077778365ea8ba97dcc0
treeeaaa83d0ef481a1a564ed796b75a46156c0f55bd
parentb069a6910aa2b95316ccdb5d9e5b95143b9dc7c0
vlib: fix potential crash in dispatch_node ELOG_DATA call

dispatch_node may be invoked from vlib main or worker threads. The call to
ELOG_DATA in dispatch_node passes the parameter &vm->elog_main. It works fine
when dispatch_node is invoked from the main thread. It does bad thing when it
is invoked from the worker thread.

While we are at it, make two additional enhancements to the same area.
1. Use ELOG_TRACK_DATA instead of ELOG_DATA to enhance g2 viewer presentation.
2. Since ELOG_DATA is in the data path, it could get very chatty. Make the call
to ELOG_TRACK_DATA conditional compile.

Change-Id: I80ca0eea10bc1e5d0d5549f9844dd9a34dbb65a2
Signed-off-by: Steven <sluong@cisco.com>
src/vlib/main.c