|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
26 struct timespec ts, tsrem;
28 int i, j, k, lost_connection = 0;
29 f64 heartbeat, prev_heartbeat = 0;
40 if (heartbeat > prev_heartbeat)
42 prev_heartbeat = heartbeat;
49 if (lost_connection > 10)
51 fformat (stderr,
"Lost connection to VPP...\n");
67 for (k = 0; k <
vec_len (res[
i].simple_counter_vec); k++)
68 for (j = 0; j <
vec_len (res[
i].simple_counter_vec[k]); j++)
69 fformat (stdout,
"[%d]: %llu packets %s\n",
70 j, res[
i].simple_counter_vec[k][j], res[
i].
name);
74 for (k = 0; k <
vec_len (res[
i].simple_counter_vec); k++)
75 for (j = 0; j <
vec_len (res[
i].combined_counter_vec[k]); j++)
76 fformat (stdout,
"[%d]: %llu packets, %llu bytes %s\n",
77 j, res[
i].combined_counter_vec[k][j].
packets,
78 res[
i].combined_counter_vec[k][j].bytes,
83 for (j = 0; j <
vec_len (res[
i].error_vector); j++)
84 fformat (stdout,
"%llu %s\n", res[
i].error_vector[j],
89 fformat (stdout,
"%.2f %s\n", res[
i].scalar_value, res[
i].
name);
96 printf (
"Unknown value\n");
104 while (nanosleep (&ts, &tsrem) < 0)
123 u8 *stat_segment_name, *pattern = 0, **patterns = 0;
136 if (
unformat (
a,
"socket-name %s", &stat_segment_name))
161 "%s: usage [socket-name <name>] [ls|dump|poll] <patterns> ...\n",
170 fformat (stderr,
"Couldn't connect to vpp, does %s exist?\n",
200 if (res[
i].simple_counter_vec == 0)
202 for (k = 0; k <
vec_len (res[
i].simple_counter_vec); k++)
203 for (j = 0; j <
vec_len (res[
i].simple_counter_vec[k]); j++)
204 fformat (stdout,
"[%d @ %d]: %llu packets %s\n",
205 j, k, res[
i].simple_counter_vec[k][j],
210 if (res[
i].combined_counter_vec == 0)
212 for (k = 0; k <
vec_len (res[
i].combined_counter_vec); k++)
213 for (j = 0; j <
vec_len (res[
i].combined_counter_vec[k]); j++)
214 fformat (stdout,
"[%d @ %d]: %llu packets, %llu bytes %s\n",
215 j, k, res[
i].combined_counter_vec[k][j].
packets,
216 res[
i].combined_counter_vec[k][j].bytes,
221 for (j = 0; j <
vec_len (res[
i].error_vector); j++)
222 fformat (stdout,
"[@%d] %llu %s\n", j, res[
i].error_vector[j],
227 fformat (stdout,
"%.2f %s\n", res[
i].scalar_value, res[
i].
name);
231 if (res[
i].name_vector == 0)
233 for (k = 0; k <
vec_len (res[
i].name_vector); k++)
234 if (res[
i].name_vector[k])
235 fformat (stdout,
"[%d]: %s %s\n", k, res[
i].name_vector[k],
273 "%s: usage [socket-name <name>] [ls|dump|poll] <patterns> ...\n",
@ STAT_DIR_TYPE_COUNTER_VECTOR_COMBINED
static int stat_poll_loop(u8 **patterns)
@ STAT_DIR_TYPE_NAME_VECTOR
#define STAT_SEGMENT_SOCKET_FILE
@ STAT_DIR_TYPE_COUNTER_VECTOR_SIMPLE
char * stat_segment_index_to_name(uint32_t index)
vl_api_ikev2_sa_stats_t stats
uint32_t * stat_segment_ls(uint8_t **patterns)
void stat_segment_disconnect(void)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
void stat_segment_data_free(stat_segment_data_t *res)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
int stat_segment_connect(const char *socket_name)
sll srl srl sll sra u16x4 i
#define vec_free(V)
Free vector's memory (no header).
@ STAT_DIR_TYPE_SCALAR_INDEX
void * clib_mem_init(void *base, uword size)
@ STAT_CLIENT_CMD_TIGHTPOLL
double stat_segment_heartbeat(void)
stat_segment_data_t * stat_segment_dump(uint32_t *stats)
int main(int argc, char **argv)
@ STAT_CLIENT_CMD_UNKNOWN
@ STAT_DIR_TYPE_ERROR_INDEX
vl_api_fib_path_type_t type