@@ -974,6 +974,8 @@ main(int argc, char **argv)
char mp_flag[] = "--proc-type=secondary";
char *argp[argc + 2];
+ rte_set_application_usage_hook(pdump_usage);
+
/* catch ctrl-c so we can print on exit */
signal(SIGINT, signal_handler);
@@ -1361,6 +1361,8 @@ main(int argc, char **argv)
char *argp[argc + 4];
uint16_t nb_ports;
+ rte_set_application_usage_hook(proc_info_usage);
+
/* preparse app arguments */
ret = proc_info_preparse_args(argc, argv);
if (ret < 0) {
@@ -1080,6 +1080,8 @@ main(int argc, char **argv)
int ret;
uint32_t lcore;
+ rte_set_application_usage_hook(print_usage);
+
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_panic("Cannot init EAL\n");
@@ -340,7 +340,8 @@ main(int argc, char **argv)
{
int ret;
- /* Init EAL */
+ rte_set_application_usage_hook(print_usage);
+
ret = rte_eal_init(argc, argv);
if (ret < 0)
return 1;
@@ -73,6 +73,8 @@ struct comp_test_data {
uint32_t cyclecount_delay;
};
+void comp_perf_usage(const char *progname);
+
int
comp_perf_options_parse(struct comp_test_data *test_data, int argc,
char **argv);
@@ -38,8 +38,8 @@ struct name_id_map {
uint32_t id;
};
-static void
-usage(char *progname)
+void
+comp_perf_usage(const char *progname)
{
printf("%s [EAL options] --\n"
" --ptest throughput / verify / pmd-cyclecount\n"
@@ -619,7 +619,7 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
while ((opt = getopt_long(argc, argv, "h", lgopts, &opt_idx)) != EOF) {
switch (opt) {
case 'h':
- usage(argv[0]);
+ comp_perf_usage(argv[0]);
exit(EXIT_SUCCESS);
break;
/* long options */
@@ -631,7 +631,7 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv)
break;
default:
- usage(argv[0]);
+ comp_perf_usage(argv[0]);
return -EINVAL;
}
}
@@ -323,7 +323,8 @@ main(int argc, char **argv)
uint8_t cdev_id;
uint32_t lcore_id;
- /* Initialise DPDK EAL */
+ rte_set_application_usage_hook(comp_perf_usage);
+
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid EAL arguments!\n");
@@ -153,6 +153,8 @@ struct cperf_options {
uint8_t imix_distribution_count;
};
+void cperf_usage(const char *progname);
+
void
cperf_options_default(struct cperf_options *options);
@@ -19,8 +19,8 @@ struct name_id_map {
uint32_t id;
};
-static void
-usage(char *progname)
+void
+cperf_usage(const char *progname)
{
printf("%s [EAL options] --\n"
" --silent: disable options dump\n"
@@ -982,7 +982,7 @@ cperf_options_parse(struct cperf_options *options, int argc, char **argv)
while ((opt = getopt_long(argc, argv, "h", lgopts, &opt_idx)) != EOF) {
switch (opt) {
case 'h':
- usage(argv[0]);
+ cperf_usage(argv[0]);
exit(EXIT_SUCCESS);
break;
/* long options */
@@ -994,7 +994,7 @@ cperf_options_parse(struct cperf_options *options, int argc, char **argv)
break;
default:
- usage(argv[0]);
+ cperf_usage(argv[0]);
return -EINVAL;
}
}
@@ -519,7 +519,8 @@ main(int argc, char **argv)
int ret;
uint32_t lcore_id;
- /* Initialise DPDK EAL */
+ rte_set_application_usage_hook(cperf_usage);
+
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid EAL arguments!\n");
@@ -648,6 +648,12 @@ print_usage(void)
config.prgname);
}
+static void
+usage_hook(const char *prgname __rte_unused)
+{
+ print_usage();
+}
+
static int
check_config(void)
{
@@ -1209,6 +1215,8 @@ main(int argc, char **argv)
FILE *fl = NULL;
uint8_t depth_lim;
+ rte_set_application_usage_hook(usage_hook);
+
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_panic("Cannot init EAL\n");
@@ -115,7 +115,7 @@ static struct multi_cores_pool mc_pool = {
};
static void
-usage(char *progname)
+usage(const char *progname)
{
printf("\nusage: %s\n", progname);
printf("\nControl configurations:\n");
@@ -1849,6 +1849,8 @@ main(int argc, char **argv)
uint16_t port;
struct rte_flow_error error;
+ rte_set_application_usage_hook(usage);
+
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_exit(EXIT_FAILURE, "EAL init failed\n");
@@ -46,8 +46,8 @@
#include "testpmd.h"
-static void
-usage(char* progname)
+void
+usage(const char *progname)
{
printf("usage: %s [EAL options] -- "
#ifdef RTE_LIB_CMDLINE
@@ -3771,6 +3771,8 @@ main(int argc, char** argv)
rte_exit(EXIT_FAILURE, "Cannot register log type");
rte_log_set_level(testpmd_logtype, RTE_LOG_DEBUG);
+ rte_set_application_usage_hook(usage);
+
diag = rte_eal_init(argc, argv);
if (diag < 0)
rte_exit(EXIT_FAILURE, "Cannot init EAL: %s\n",
@@ -763,6 +763,7 @@ inc_tx_burst_stats(struct fwd_stream *fs, uint16_t nb_tx)
unsigned int parse_item_list(char* str, const char* item_name,
unsigned int max_items,
unsigned int *parsed_items, int check_unique_values);
+void usage(const char *progname);
void launch_args_parse(int argc, char** argv);
void cmdline_read_from_file(const char *filename);
void prompt(void);
@@ -616,7 +616,8 @@ main(int argc, char **argv)
uint32_t i;
struct qps_per_lcore *qps_per_lcore;
- /* Init EAL. */
+ rte_set_application_usage_hook(usage);
+
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_exit(EXIT_FAILURE, "EAL init failed\n");
@@ -149,7 +149,12 @@ print_usage(void)
"[-p <parallel lookup on all available cores>]\n"
"[-c <init sad supporting read/write concurrency>]\n",
config.prgname);
+}
+static void
+usage_hook(const char *prgname __rte_unused)
+{
+ print_usage();
}
static int
@@ -620,6 +625,8 @@ main(int argc, char **argv)
struct rte_ipsec_sad_conf conf = {0};
unsigned int lcore_id;
+ rte_set_application_usage_hook(usage_hook);
+
ret = rte_eal_init(argc, argv);
if (ret < 0)
rte_panic("Cannot init EAL\n");