}
int
-eal_trace_args_save(const char *optarg)
+eal_trace_args_save(const char *val)
{
struct trace *trace = trace_obj_get();
char *trace_args;
nb_args = trace->args.nb_args;
if (nb_args >= TRACE_MAX_ARGS) {
- trace_err("ignoring trace %s as limit exceeds", optarg);
+ trace_err("ignoring trace %s as limit exceeds", val);
return 0;
}
- trace_args = calloc(1, (strlen(optarg) + 1));
+ trace_args = calloc(1, (strlen(val) + 1));
if (trace_args == NULL) {
- trace_err("fail to allocate memory for %s", optarg);
+ trace_err("fail to allocate memory for %s", val);
return -ENOMEM;
}
- memcpy(trace_args, optarg, strlen(optarg));
+ memcpy(trace_args, val, strlen(val));
trace->args.args[nb_args++] = trace_args;
trace->args.nb_args = nb_args;
return 0;
}
int
-eal_trace_bufsz_args_save(char const *optarg)
+eal_trace_bufsz_args_save(char const *val)
{
struct trace *trace = trace_obj_get();
uint64_t bufsz;
- if (optarg == NULL) {
+ if (val == NULL) {
trace_err("no optarg is passed");
return -EINVAL;
}
- bufsz = rte_str_to_size(optarg);
+ bufsz = rte_str_to_size(val);
if (bufsz == 0) {
trace_err("buffer size cannot be zero");
return -EINVAL;
}
int
-eal_trace_mode_args_save(const char *optarg)
+eal_trace_mode_args_save(const char *val)
{
struct trace *trace = trace_obj_get();
- size_t len = strlen(optarg);
+ size_t len = strlen(val);
unsigned long tmp;
char *pattern;
- if (optarg == NULL) {
+ if (val == NULL) {
trace_err("no optarg is passed");
return -EINVAL;
}
return -ENOMEM;
}
- sprintf(pattern, "%s*", optarg);
+ sprintf(pattern, "%s*", val);
if (fnmatch(pattern, "overwrite", 0) == 0)
tmp = RTE_TRACE_MODE_OVERWRITE;
}
int
-eal_trace_dir_args_save(char const *optarg)
+eal_trace_dir_args_save(char const *val)
{
struct trace *trace = trace_obj_get();
uint32_t size = sizeof(trace->dir);
char *dir_path = NULL;
int rc;
- if (optarg == NULL) {
+ if (val == NULL) {
trace_err("no optarg is passed");
return -EINVAL;
}
- if (strlen(optarg) >= size) {
+ if (strlen(val) >= size) {
trace_err("input string is too big");
return -ENAMETOOLONG;
}
return -ENOMEM;
}
- sprintf(dir_path, "%s/", optarg);
+ sprintf(dir_path, "%s/", val);
rc = trace_dir_update(dir_path);
free(dir_path);
/* EAL interface */
int eal_trace_init(void);
void eal_trace_fini(void);
-int eal_trace_args_save(const char *optarg);
+int eal_trace_args_save(const char *val);
void eal_trace_args_free(void);
-int eal_trace_dir_args_save(const char *optarg);
-int eal_trace_mode_args_save(const char *optarg);
-int eal_trace_bufsz_args_save(const char *optarg);
+int eal_trace_dir_args_save(const char *val);
+int eal_trace_mode_args_save(const char *val);
+int eal_trace_bufsz_args_save(const char *val);
#endif /* __EAL_TRACE_H */