21 #define foreach_state_string_code \ 22 _(STATE_DONE, "done") \ 23 _(STATE_DISABLED, "disabled") \ 24 _(STATE_TIME_WAIT, "time wait") \ 25 _(STATE_EVENT_WAIT, "event wait") \ 26 _(STATE_ANY_WAIT, "any wait") \ 27 _(STATE_POLLING, "polling") \ 28 _(STATE_INTERRUPT_WAIT, "interrupt wait") \ 29 _(STATE_INTERNAL, "internal") 63 _vec_len (nodes_by_thread) = 0;
65 for (i = 0; i < nstat_vms; i++)
73 for (j = 0; j < nnodes; j++)
87 for (k = 0; k < nnexts; k++)
114 return nodes_by_thread;
131 u32 max_threads = (
u32) ~ 0;
132 int include_nexts = 0;
133 int include_stats = 0;
137 if (
unformat (input,
"max-threads %d", &max_threads))
156 include_nexts, include_stats);
164 for (i = 0; i <
vec_len (nodes_by_thread); i++)
166 nodes = nodes_by_thread[
i];
170 for (j = 0; j <
vec_len (nodes); j++)
178 (vm,
" clocks %lld calls %lld suspends" 179 " %lld vectors %lld",
195 for (j = 0; j <
vec_len (nodes_by_thread); j++)
197 nodes = nodes_by_thread[j];
199 for (i = 0; i <
vec_len (nodes); i++)
214 .path =
"test node serialize",
215 .short_help =
"test node serialize [max-threads NN] nexts stats",
216 .function = test_node_serialize_command_fn,
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
sll srl srl sll sra u16x4 i
static u64 unserialize_likely_small_unsigned_integer(serialize_main_t *m)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
u8 * vlib_node_serialize(vlib_node_main_t *nm, u8 *vector, u32 max_threads, int include_nexts, int include_stats)
vlib_node_t *** vlib_node_unserialize(u8 *vector)
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
vlib_node_stats_t stats_last_clear
#define foreach_state_string_code
vlib_node_stats_t stats_total
void unserialize_cstring(serialize_main_t *m, char **s)
void serialize_open_vector(serialize_main_t *m, u8 *vector)
#define vec_free(V)
Free vector's memory (no header).
static void unserialize_integer(serialize_main_t *m, void *x, u32 n_bytes)
#define VLIB_CLI_COMMAND(x,...)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_node_main_t node_main
static char * state_strings[]
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)