From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 7DDB6A0350;
	Wed,  1 Jul 2020 08:50:59 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 0C5481C11A;
	Wed,  1 Jul 2020 08:50:08 +0200 (CEST)
Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com
 [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 534F51C0B0
 for <dev@dpdk.org>; Wed,  1 Jul 2020 08:50:07 +0200 (CEST)
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
 0616eZtB000850; Tue, 30 Jun 2020 23:50:05 -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-transfer-encoding : content-type; s=pfpt0818;
 bh=EtlVXDzFPPky1q3VN+51v8Zofg9499ReIUCA0DmEvek=;
 b=C+YJi6rkfBXwz44K0DwRYaokn8xfmSStHsopQILwUn77X/tDYbe9Rzjo3PgM6QaMdEo8
 pTho4VEuepL7rHWgXG5XkxUkCmasww1BdYxqCyKxxtcBpqKfWSrOSoMONeEjmVQ7tLCh
 HhlaKQjU2chFtbObrhT2RUMY90125ao8YrfP558Wx/Me0TDZsHPaAhz1nAPHDwVHLnPg
 C6YEGONct8SPUehoCB9k5vaZhhCzMVuVmRTkFE8WQBfN5TH0giFhNLhdUXbKUgmtAdY5
 4dXCF86TeXq7WNHi8rDPGHVlUU4TQAYECXiGMnp5keJ4Zr5Knc7U5BRxdoBQ47N+ZXV3 fA== 
Received: from sc-exch03.marvell.com ([199.233.58.183])
 by mx0b-0016f401.pphosted.com with ESMTP id 31x5mnq89j-4
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);
 Tue, 30 Jun 2020 23:50:05 -0700
Received: from DC5-EXCH01.marvell.com (10.69.176.38) by SC-EXCH03.marvell.com
 (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2;
 Tue, 30 Jun 2020 23:50:03 -0700
Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com
 (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;
 Tue, 30 Jun 2020 23:50:03 -0700
Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com
 (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend
 Transport; Tue, 30 Jun 2020 23:50:03 -0700
Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])
 by maili.marvell.com (Postfix) with ESMTP id 7096C3F703F;
 Tue, 30 Jun 2020 23:49:59 -0700 (PDT)
From: <jerinj@marvell.com>
To: <dev@dpdk.org>, Byron Marohn <byron.marohn@intel.com>, Yipeng Wang
 <yipeng1.wang@intel.com>, Sameh Gobriel <sameh.gobriel@intel.com>, "Bruce
 Richardson" <bruce.richardson@intel.com>, Robert Sanford
 <rsanford@akamai.com>, Erik Gabriel Carrillo <erik.g.carrillo@intel.com>
CC: <thomas@monjalon.net>, <olivier.matz@6wind.com>,
 <david.marchand@redhat.com>, <sachin.saxena@oss.nxp.com>,
 <adamx.dybkowski@intel.com>, Jerin Jacob <jerinj@marvell.com>
Date: Wed, 1 Jul 2020 12:18:28 +0530
Message-ID: <20200701064828.4097247-14-jerinj@marvell.com>
X-Mailer: git-send-email 2.27.0
In-Reply-To: <20200701064828.4097247-1-jerinj@marvell.com>
References: <20200701035840.4028056-1-jerinj@marvell.com>
 <20200701064828.4097247-1-jerinj@marvell.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687
 definitions=2020-07-01_03:2020-07-01,
 2020-07-01 signatures=0
Subject: [dpdk-dev]  [PATCH v3 13/13] app/test: use log register macro
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

From: Jerin Jacob <jerinj@marvell.com>

Use log register macro to avoid the code duplication
in the log registration process.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Adam Dybkowski <adamx.dybkowski@intel.com>
---
 app/test/test_efd.c            | 6 +-----
 app/test/test_hash.c           | 7 +------
 app/test/test_timer_racecond.c | 7 +------
 3 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/app/test/test_efd.c b/app/test/test_efd.c
index e3e5e30ea..3d9aa8a57 100644
--- a/app/test/test_efd.c
+++ b/app/test/test_efd.c
@@ -32,12 +32,8 @@ struct flow_key {
 	uint8_t proto;
 } __rte_packed;
 
-int efd_logtype_test;
 
-RTE_INIT(test_efd_init_log)
-{
-	efd_logtype_test = rte_log_register("test.efd");
-}
+RTE_LOG_REGISTER(efd_logtype_test, test.efd, INFO);
 
 /*
  * Print out result of unit test efd operation.
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index afa3a1a3c..990a1815f 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -69,8 +69,6 @@ struct flow_key {
 	uint8_t proto;
 } __rte_packed;
 
-int hash_logtype_test;
-
 /*
  * Hash function that always returns the same value, to easily test what
  * happens when a bucket is full.
@@ -82,10 +80,7 @@ static uint32_t pseudo_hash(__rte_unused const void *keys,
 	return 3;
 }
 
-RTE_INIT(test_hash_init_log)
-{
-	hash_logtype_test = rte_log_register("test.hash");
-}
+RTE_LOG_REGISTER(hash_logtype_test, test.hash, INFO);
 
 /*
  * Print out result of unit test hash operation.
diff --git a/app/test/test_timer_racecond.c b/app/test/test_timer_racecond.c
index 4fc917995..28af9ca76 100644
--- a/app/test/test_timer_racecond.c
+++ b/app/test/test_timer_racecond.c
@@ -61,12 +61,7 @@ static volatile unsigned stop_slaves;
 
 static int reload_timer(struct rte_timer *tim);
 
-int timer_logtype_test;
-
-RTE_INIT(test_timer_init_log)
-{
-	timer_logtype_test = rte_log_register("test.timer");
-}
+RTE_LOG_REGISTER(timer_logtype_test, test.timer, INFO);
 
 static void
 timer_cb(struct rte_timer *tim, void *arg __rte_unused)
-- 
2.27.0