21 #include <vpp/app/version.h> 51 main (
int argc,
char *argv[])
56 uword main_heap_size = (1ULL << 30);
62 =
"ERROR: This binary requires CPU with %s extensions.\n";
64 if (!clib_cpu_supports_ ## a ()) \ 66 fprintf(stderr, msg, b); \ 94 if ((argc == 3) && !strncmp (argv[1],
"-c", 2))
103 fp = fopen (argv[2],
"r");
106 fprintf (stderr,
"open configuration file '%s' failed\n", argv[2]);
109 argv_ = calloc (1,
sizeof (
char *));
112 arg = strndup (argv[0], 1024);
119 if (fgets (inbuf, 4096, fp) == 0)
121 p = strtok (inbuf,
" \t\n");
127 char **tmp = realloc (argv_, argc_ *
sizeof (
char *));
131 arg = strndup (p, 1024);
134 argv_[argc_ - 1] = arg;
135 p = strtok (
NULL,
" \t\n");
141 char **tmp = realloc (argv_, (argc_ + 1) *
sizeof (
char *));
158 for (i = 1; i < (argc - 1); i++)
160 if (!strncmp (argv[i],
"plugin_path", 11))
165 else if (!strncmp (argv[i],
"heapsize", 8))
167 sizep = (
u8 *) argv[i + 1];
169 while (*sizep >=
'0' && *sizep <=
'9')
172 size += *sizep++ -
'0';
178 "warning: heapsize parse error '%s', use default %lld\n",
179 argv[i], (
long long int) main_heap_size);
183 main_heap_size =
size;
185 if (*sizep ==
'g' || *sizep ==
'G')
186 main_heap_size <<= 30;
187 else if (*sizep ==
'm' || *sizep ==
'M')
188 main_heap_size <<= 20;
207 int rv __attribute__ ((unused)) =
208 write (2,
"Main heap allocation failure!\r\n", 31);
275 static int recursion_block;
324 u64 *p = (
u64 *) 0xdefec8ed;
328 .format =
"deliberate crash: touching %x",.format_args =
"i4",};
340 .path =
"test crash",
341 .short_help =
"crash the bus!",
sll srl srl sll sra u16x4 i
void vl_msg_api_barrier_sync(void)
int main(int argc, char *argv[])
void vlib_unix_cli_set_prompt(char *prompt)
Set the CLI prompt.
#define vlib_mark_init_function_complete(vm, x)
char * vlib_plugin_app_version
void vl_msg_api_barrier_release(void)
#define clib_error_return(e, args...)
static void vpe_main_init(vlib_main_t *vm)
static clib_error_t * srp_init(vlib_main_t *vm)
void vl_msg_api_set_first_available_msg_id(u16 first_avail)
void vl_msg_api_post_mortem_dump(void)
vlib_main_t vlib_global_main
static clib_error_t * plugin_path_config(vlib_main_t *vm, unformat_input_t *input)
#define VLIB_CONFIG_FUNCTION(x, n,...)
void vhost_user_unmap_all(void)
static void elog(elog_main_t *em, elog_event_type_t *type, u32 data)
Log a single-datum event.
uword * init_functions_called
void * clib_mem_init(void *heap, uword size)
#define vec_free(V)
Free vector's memory (no header).
void elog_post_mortem_dump(void)
void vlib_worker_thread_barrier_sync(vlib_main_t *vm)
#define ELOG_TYPE_DECLARE(f)
#define VLIB_CLI_COMMAND(x,...)
#define hash_create(elts, value_bytes)
void vat_plugin_hash_create(void)
u32 vlib_app_num_thread_stacks_needed(void)
static vlib_main_t * vlib_get_main(void)
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
static clib_error_t * heapsize_config(vlib_main_t *vm, unformat_input_t *input)
static clib_error_t * test_crash_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vlib_unix_main(int argc, char *argv[])