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 1CED6A052E; Mon, 9 Mar 2020 07:17:35 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 841901BFF6; Mon, 9 Mar 2020 07:17:34 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id E9122FEB; Mon, 9 Mar 2020 07:17:32 +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 0296BCCi022212; Sun, 8 Mar 2020 23:17:32 -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=oGlO1LdbDDLjT8J3miXJ3vKILpAfwChzfX0qj0zb8nc=; b=K8yk1HvSt7bPDV9/2KLesGBkeGA43BA4OO0jrD9g9a4Vds0xAJCeP+qaIHMHLOFtIMBv yKZxayMHkkWG8PeU5o/OtG1ARq1OQQohMANQ1p9DFaO2fCs1YOwojhKn/5FPynygTb5S LNu0a8c0IPpSvp9zbzdGmYikJAT4hAYfhHJKgWrLLd3Re/GC+HGANCoDW3zzgoMwkWV0 j1SHZcdTOj5N7YuHcThQGak2cjRfre4ayBSINC3Y8IxsdCiSdzDfBCQvQmgljpBGkMQ1 u/DWOaLZyJ1RDZhjTAwFwUeappb5mT9Us1VSAV0H7Q+8oHoM4cFo/hQ7SUARxrX6KzN6 cQ== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0b-0016f401.pphosted.com with ESMTP id 2ymc0snet9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sun, 08 Mar 2020 23:17:32 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Sun, 8 Mar 2020 23:17:29 -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:17:29 -0700 Received: from localhost.localdomain (unknown [10.28.34.200]) by maili.marvell.com (Postfix) with ESMTP id DF90A3F7040; Sun, 8 Mar 2020 23:17:27 -0700 (PDT) From: Sunil Kumar Kori To: , , CC: , , Sunil Kumar Kori Date: Mon, 9 Mar 2020 11:47:23 +0530 Message-ID: <20200309061723.19732-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 --- v2: - Updated Cc: stable@dpdk.org in commit message 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