aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/hs_apps/sapi/vpp_echo.c
diff options
context:
space:
mode:
authorDave Wallace <dwallacelf@gmail.com>2019-10-21 03:28:17 +0000
committerFlorin Coras <florin.coras@gmail.com>2019-10-22 16:31:03 +0000
commit91af1859da0313d48fb152999a74a34cf384b490 (patch)
treee51cfaffb4787de8fab8a6ba2197df70388e4d9f /src/plugins/hs_apps/sapi/vpp_echo.c
parent2456433df46ae99dfbcec6260d14e592b5823c83 (diff)
tests: enable vpp_echo to run in gdb
- Enable vpp_echo to be run in gdb when running 'make test DEBUG=gdb-all' Type: test Signed-off-by: Dave Wallace <dwallacelf@gmail.com> Change-Id: I79a69b0573c01900535078d7493d52b417350815
Diffstat (limited to 'src/plugins/hs_apps/sapi/vpp_echo.c')
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo.c b/src/plugins/hs_apps/sapi/vpp_echo.c
index feb39f8db5e..e460aa2bf25 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo.c
+++ b/src/plugins/hs_apps/sapi/vpp_echo.c
@@ -394,6 +394,8 @@ echo_handle_data (echo_main_t * em, echo_session_t * s, u8 * rx_buf)
clib_atomic_fetch_add (&em->stats.clean_count.s, 1);
}
}
+ ECHO_LOG (2, "%U: %U", echo_format_session, s,
+ echo_format_session_state, s->session_state);
return;
}
@@ -989,6 +991,8 @@ echo_process_opts (int argc, char **argv)
em->tx_results_diff = 1;
else if (unformat (a, "json"))
em->output_json = 1;
+ else if (unformat (a, "wait-for-gdb"))
+ em->wait_for_gdb = 1;
else if (unformat (a, "log=%d", &em->log_lvl))
;
else if (unformat (a, "sclose=%U",
@@ -1029,6 +1033,16 @@ echo_process_opts (int argc, char **argv)
em->bytes_to_receive == 0 ? ECHO_CLOSE_F_PASSIVE : ECHO_CLOSE_F_ACTIVE;
if (em->send_stream_disconnects == ECHO_CLOSE_F_INVALID)
em->send_stream_disconnects = default_f_active;
+
+ if (em->wait_for_gdb)
+ {
+ volatile u64 nop = 0;
+
+ clib_warning ("Waiting for gdb...");
+ while (em->wait_for_gdb)
+ nop++;
+ clib_warning ("Resuming execution (%llu)!", nop);
+ }
}
void