From e60e78326283d2f79944b93157866806b9cb25bf Mon Sep 17 00:00:00 2001 From: Liang Yan Date: Tue, 12 Jun 2018 14:31:49 +0800 Subject: [PATCH] event/app: exit app before trace setting if no DEBUG macro Change-Id: I7c3194996e2ab669601f5d43b72d100476fe1ade Signed-off-by: Liang Yan Reviewed-on: https://review.gerrithub.io/414739 Tested-by: SPDK Automated Test System Reviewed-by: Shuhei Matsumoto Reviewed-by: Jim Harris --- lib/event/app.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/event/app.c b/lib/event/app.c index 6b174abb9..f324705cb 100644 --- a/lib/event/app.c +++ b/lib/event/app.c @@ -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':