From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3DB7AA052E; Mon, 9 Mar 2020 07:15:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D7D391BFF5; Mon, 9 Mar 2020 07:15:31 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 3DB072BE6; Mon, 9 Mar 2020 07:15:30 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0296BBuK022203; Sun, 8 Mar 2020 23:15:29 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=JRhJrWb3uJNX8A4e2hLGPgPh9zq6Gk+uM03R40PrhzU=; b=dVhd97Fsj0ZirJXFRsIEQbKxwxoI88JjyCb3MSh1hwvEs9T46xZ5dVgDFL681zWUKM7l l1d85p9u3aNgnpP44LxqL3UaBf1VWkHBhOoUg4zei1myLAoFNyoyZFpOCoLjgbf2GJuP U51y4mCwlODT9qOPcjgEt8EJyyRRn53Nw7yP7Pc5OStUikiyRIiw6CiYiwJkdrX6JkpE oq8OkWsxLGKa79z5CGfpmWxUi6R/Dc8cxkvAosBeXg+WJMTg7JkB7TitzPiuJFlmH+0S iCAWvfrfz77Nzl6OE53sNY7RKsaTLo48T5n3z1dw/yWamsq4S0fO4GKt9wOAIHbNTNHa sA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2ymc0snekk-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 08 Mar 2020 23:15:29 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 8 Mar 2020 23:15:27 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sun, 8 Mar 2020 23:15:26 -0700 Received: from localhost.localdomain (unknown [10.28.34.200]) by maili.marvell.com (Postfix) with ESMTP id 66F813F703F; Sun, 8 Mar 2020 23:15:25 -0700 (PDT) From: Sunil Kumar Kori To: , , CC: , , Sunil Kumar Kori Date: Mon, 9 Mar 2020 11:45:20 +0530 Message-ID: <20200309061520.19651-1-skori@marvell.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200227082506.25349-1-skori@marvell.com> References: <20200227082506.25349-1-skori@marvell.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-03-09_01:2020-03-06, 2020-03-09 signatures=0 Subject: [dpdk-dev] [PATCH v2 1/1] eal: fix log message print for regex X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" If user passes log-level eal parameter to enable log level based on regex then in case of error message is being printed for pattern match instead of regex. Following is the warning message thrown: Compiling C object 'lib/76b5a35@@rte_eal@sta/librte_eal_common_eal_common_options.c.o'. In function ‘eal_parse_log_level’, inlined from ‘eal_parse_common_option’ at ../lib/librte_eal/common/eal_common_options.c:1418:7: ../lib/librte_eal/common/eal_common_options.c:1053:4: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 1053 | fprintf(stderr, "cannot set log level %s,%d\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1054 | pattern, priority); | ~~~~~~~~~~~~~~~~~~ Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing") Cc: stable@dpdk.org Signed-off-by: Sunil Kumar Kori Acked-by: David Marchand --- lib/librte_eal/common/eal_common_options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 75974dd5b..525e51e7d 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -1046,7 +1046,7 @@ eal_parse_log_level(const char *arg) if (regex) { if (rte_log_set_level_regexp(regex, priority) < 0) { fprintf(stderr, "cannot set log level %s,%d\n", - pattern, priority); + regex, priority); goto fail; } if (rte_log_save_regexp(regex, priority) < 0) -- 2.17.1