event/app: exit app before trace setting if no DEBUG macro

Change-Id: I7c3194996e2ab669601f5d43b72d100476fe1ade
Signed-off-by: Liang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/414739
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Liang Yan 2018-06-12 14:31:49 +08:00 committed by Jim Harris
parent 239e63be7d
commit e60e783262

View File

@ -749,6 +749,13 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
break;
}
case 't':
#ifndef DEBUG
fprintf(stderr, "%s must be built with CONFIG_DEBUG=y for -t flag\n",
argv[0]);
usage(app_usage);
rval = SPDK_APP_PARSE_ARGS_FAIL;
goto parse_done;
#else
rc = spdk_log_set_trace_flag(optarg);
if (rc < 0) {
fprintf(stderr, "unknown flag\n");
@ -757,13 +764,6 @@ spdk_app_parse_args(int argc, char **argv, struct spdk_app_opts *opts,
goto parse_done;
}
opts->print_level = SPDK_LOG_DEBUG;
#ifndef DEBUG
fprintf(stderr, "%s must be built with CONFIG_DEBUG=y for -t flag\n",
argv[0]);
usage(app_usage);
rval = SPDK_APP_PARSE_ARGS_FAIL;
goto parse_done;
#else
break;
#endif
case 'u':