diff options
author | Dave Barach <dave@barachs.net> | 2017-03-02 18:24:10 -0500 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2017-03-03 18:02:24 +0000 |
commit | dfbee41b16541b51eb8f7f4d8a831ef9407fb419 (patch) | |
tree | 654a1681eff9c4ab3565e915964637b6fc2fde7a /src/vlibapi | |
parent | 87df12d5de67600414ae80b891e8a0f89e89ce5c (diff) |
Improve api trace replay consistency checking
Change-Id: I2c4b9646d53e4c008ccbe6d09c6a683c776c1f60
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlibapi')
-rw-r--r-- | src/vlibapi/api.h | 3 | ||||
-rw-r--r-- | src/vlibapi/api_shared.c | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/vlibapi/api.h b/src/vlibapi/api.h index b40ece158ff..2cbeb63c44c 100644 --- a/src/vlibapi/api.h +++ b/src/vlibapi/api.h @@ -189,6 +189,9 @@ typedef struct char *region_name; char *root_path; + + /* Replay in progress? */ + int replay_in_progress; } api_main_t; extern api_main_t api_main; diff --git a/src/vlibapi/api_shared.c b/src/vlibapi/api_shared.c index 79921afe2d7..69ba10c1c08 100644 --- a/src/vlibapi/api_shared.c +++ b/src/vlibapi/api_shared.c @@ -890,6 +890,9 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename, msg += size; } + if (which == REPLAY) + am->replay_in_progress = 1; + for (; i <= last_index; i++) { trace_cfg_t *cfgp; @@ -914,6 +917,7 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename, vlib_cli_output (vm, "Ugh: msg id %d no trace config\n", msg_id); munmap (hp, file_size); vec_free (tmpbuf); + am->replay_in_progress = 0; return; } @@ -937,6 +941,7 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename, vlib_cli_output (vm, "Ugh: msg id %d no endian swap\n", msg_id); munmap (hp, file_size); vec_free (tmpbuf); + am->replay_in_progress = 0; return; } endian_fp = am->msg_endian_handlers[msg_id]; @@ -1038,6 +1043,7 @@ vl_msg_api_process_file (vlib_main_t * vm, u8 * filename, munmap (hp, file_size); vec_free (tmpbuf); + am->replay_in_progress = 0; } u8 * |