aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/unix
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/unix')
-rw-r--r--src/vnet/unix/gdb_funcs.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/vnet/unix/gdb_funcs.c b/src/vnet/unix/gdb_funcs.c
index cca2e420..32e22d92 100644
--- a/src/vnet/unix/gdb_funcs.c
+++ b/src/vnet/unix/gdb_funcs.c
@@ -21,7 +21,7 @@
#include <vlib/threads.h>
#include <vnet/vnet.h>
-
+#include <vppinfra/format.h>
/**
* @brief GDB callable function: vl - Return vector length of vector
@@ -135,6 +135,47 @@ void vlib_runtime_index_to_node_name (u32 index)
fformat(stderr, "node runtime index %d name %s\n", index, nm->nodes[index]->name);
}
+void gdb_show_errors (int verbose)
+{
+ extern vlib_cli_command_t vlib_cli_show_errors;
+ unformat_input_t input;
+ vlib_main_t * vm = vlib_get_main();
+
+ if (verbose == 0)
+ unformat_init_string (&input, "verbose 0", 9);
+ else if (verbose == 1)
+ unformat_init_string (&input, "verbose 1", 9);
+ else
+ {
+ fformat(stderr, "verbose not 0 or 1\n");
+ return;
+ }
+
+ vlib_cli_show_errors.function (vm, &input, 0 /* cmd */);
+ unformat_free (&input);
+}
+
+void gdb_show_session (int verbose)
+{
+ extern vlib_cli_command_t vlib_cli_show_session_command;
+ unformat_input_t input;
+ vlib_main_t * vm = vlib_get_main();
+
+ if (verbose == 0)
+ unformat_init_string (&input, "verbose 0", 9);
+ else if (verbose == 1)
+ unformat_init_string (&input, "verbose 1", 9);
+ else if (verbose == 2)
+ unformat_init_string (&input, "verbose 2", 9);
+ else
+ {
+ fformat(stderr, "verbose not 0 - 2\n");
+ return;
+ }
+
+ vlib_cli_show_session_command.function (vm, &input, 0 /* cmd */);
+ unformat_free (&input);
+}
/**
* @brief GDB callable function: show_gdb_command_fn - show gdb
@@ -151,6 +192,8 @@ show_gdb_command_fn (vlib_main_t * vm,
vlib_cli_output (vm, "vl(p) returns vec_len(p)");
vlib_cli_output (vm, "pe(p) returns pool_elts(p)");
vlib_cli_output (vm, "pifi(p, i) returns pool_is_free_index(p, i)");
+ vlib_cli_output (vm, "gdb_show_errors(0|1) dumps error counters");
+ vlib_cli_output (vm, "gdb_show_session dumps session counters");
vlib_cli_output (vm, "debug_hex_bytes (ptr, n_bytes) dumps n_bytes in hex");
vlib_cli_output (vm, "vlib_dump_frame_ownership() does what it says");
vlib_cli_output (vm, "vlib_runtime_index_to_node_name (index) prints NN");
n195'>195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330