diff options
author | Dave Barach <dave@barachs.net> | 2019-07-15 16:00:03 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-07-16 13:12:12 +0000 |
commit | b09f4d0adb8364b3516c3a64e8238715887ffec8 (patch) | |
tree | 95f9f29d3d5a9c17fcff3cd670623cc16ff2806b /src/vlibmemory | |
parent | 7b8a30d08bffcb8c6fe7faa8d7f7dc557e175770 (diff) |
api: enable binary API event logging in vat
Cleaned up a few instances of side-bet elog_string hash table
usage. Elog_string handles that problem itself.
Add cli commands to vat to initialize, enable/disable, and save an
event log.
Event logging at the same time in both vpp and vat yields a pair
of event logs which can be merged by the "test_elog" tool.
Type: refactor
Change-Id: I8d6a72206f2309c967ea1630077fba31aef47f93
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlibmemory')
-rw-r--r-- | src/vlibmemory/memory_shared.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/vlibmemory/memory_shared.c b/src/vlibmemory/memory_shared.c index fa9936982ee..f44ab7c4106 100644 --- a/src/vlibmemory/memory_shared.c +++ b/src/vlibmemory/memory_shared.c @@ -29,6 +29,7 @@ #include <vppinfra/format.h> #include <vppinfra/byte_order.h> #include <vppinfra/error.h> +#include <vppinfra/elog.h> #include <svm/queue.h> #include <vlib/vlib.h> #include <vlib/unix/unix.h> @@ -764,7 +765,27 @@ vl_msg_api_send_shmem (svm_queue_t * q, u8 * elem) */ if (PREDICT_FALSE (am->vl_clients /* vpp side */ && (q->cursize == q->maxsize))) - clib_warning ("WARNING: client input queue at %llx is stuffed...", q); + { + if (PREDICT_FALSE (am->elog_trace_api_messages)) + { + /* *INDENT-OFF* */ + ELOG_TYPE_DECLARE (e) = + { + .format = "api-client-queue-stuffed: %x%x", + .format_args = "i4i4", + }; + /* *INDENT-ON* */ + struct + { + u32 hi, low; + } *ed; + ed = ELOG_DATA (am->elog_main, e); + ed->hi = (uword) q >> 32; + ed->low = (uword) q & 0xFFFFFFFF; + clib_warning ("WARNING: client input queue at %llx is stuffed...", + q); + } + } (void) svm_queue_add (q, elem, 0 /* nowait */ ); } |