diff options
author | Ole Troan <ot@cisco.com> | 2019-07-30 15:38:13 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2019-08-12 12:37:37 +0000 |
commit | af8075529fd660a487d1c2b8069da1b4a3714ec3 (patch) | |
tree | 782606eebdf728caf6d6568f907f3d3c594a26a5 /src/vlibmemory/socket_api.c | |
parent | 3d674e86b719a876be15f05b7ef9cb635717016e (diff) |
api: vppapitrace JSON/API trace converter
Usage: vppapitrace.py [-h] [--debug] [--apidir APIDIR] {convert,replay} ...
optional arguments:
-h, --help show this help message and exit
--debug enable debug mode
--apidir APIDIR Location of JSON API definitions
subcommands:
valid subcommands
{convert,replay} additional help
convert Convert API trace to JSON or Python and back
replay Replay messages to running VPP instance
To convert an API trace file to JSON:
vppapitrace convert /tmp/api.trace trace.json
To convert an (edited) JSON file back to API trace for replay:
vppapitrace convert trace.json api-edited.trace
To generate a Python file that can be replayed:
vppapitrace convert /tmp/api.trace trace.py
vppapitrace convert trace.json trace.py
Replay it to a running VPP instance:
vppapitrace replay --socket /tmp/api.trace
In VPP that file can be replayed with:
vpp# api trace replay api-edited.trace
This patch also modifies the API binary trace format, to include the
message id to message name table.
Ticket: VPP-1733
Change-Id: Ie6441efb53c1c93c9f778f6ae9c1758bccc8dd87
Type: refactor
Signed-off-by: Ole Troan <ot@cisco.com>
(cherry picked from commit edfe2c0079a756f5fb1108037c39450e3521c8bd)
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Diffstat (limited to 'src/vlibmemory/socket_api.c')
-rw-r--r-- | src/vlibmemory/socket_api.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/vlibmemory/socket_api.c b/src/vlibmemory/socket_api.c index d3beafb3345..c423c526625 100644 --- a/src/vlibmemory/socket_api.c +++ b/src/vlibmemory/socket_api.c @@ -692,9 +692,9 @@ reply: } #define foreach_vlib_api_msg \ -_(SOCKCLNT_CREATE, sockclnt_create) \ -_(SOCKCLNT_DELETE, sockclnt_delete) \ -_(SOCK_INIT_SHM, sock_init_shm) + _(SOCKCLNT_CREATE, sockclnt_create, 1) \ + _(SOCKCLNT_DELETE, sockclnt_delete, 1) \ + _(SOCK_INIT_SHM, sock_init_shm, 1) clib_error_t * vl_sock_api_init (vlib_main_t * vm) @@ -710,13 +710,13 @@ vl_sock_api_init (vlib_main_t * vm) if (sm->socket_name == 0) return 0; -#define _(N,n) \ +#define _(N,n,t) \ vl_msg_api_set_handlers(VL_API_##N, #n, \ vl_api_##n##_t_handler, \ vl_noop_handler, \ vl_api_##n##_t_endian, \ vl_api_##n##_t_print, \ - sizeof(vl_api_##n##_t), 1); + sizeof(vl_api_##n##_t), t); foreach_vlib_api_msg; #undef _ |