Commit e60e7832 authored by Liang Yan's avatar Liang Yan Committed by Jim Harris
Browse files

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



Change-Id: I7c3194996e2ab669601f5d43b72d100476fe1ade
Signed-off-by: default avatarLiang Yan <liang.z.yan@intel.com>
Reviewed-on: https://review.gerrithub.io/414739


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 239e63be
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -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':