From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 56F0CA0A0A; Mon, 5 Apr 2021 12:03:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 475AA140E41; Mon, 5 Apr 2021 12:03:10 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 56263140E29 for ; Mon, 5 Apr 2021 12:03:08 +0200 (CEST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id D66A55C003D; Mon, 5 Apr 2021 06:03:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Mon, 05 Apr 2021 06:03:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=bZfcGAjqoVUKa f4MSRSxyPXnE5egTetUolMBzyzAROc=; b=1uz3NQJw9uL9f3K87C7LuymO2Wygd PsUFwJ6Sfztrbb9cWkdw4EwANio9FnN7xLqyQACIQjv3phj/nThF1pmqbqT0ygG3 S2WQ2PU61ZjCz1FL14ONSO7DBFDTPaOoCi3cMRXmyEZbWJvW0FPCPw4cNtcctCve gTKBVZcD34NNs5KqitAiE65RQ4AYVH0Cn7UYNWfPwlzQiQMStQLjHEkoc+WCIUR1 U2ELsfLWkb6Iez8Iv+pcZrrHD142YuFN6dqdYJQPpghwNdoavcA635f3Dr2DgZgA jq5c5Ex8fchdKaheHXtKdwsJ0ifXPxR6ErsegGORdw3bkvphsXLHl26og== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=bZfcGAjqoVUKaf4MSRSxyPXnE5egTetUolMBzyzAROc=; b=FTpCU4fS Kf2h2BPPH4r+Xh/qGmXvK4cWEgNMH8McYWFnWaEmjNKnVXq0utmDnt//bMO9S83n 0Hht5CsZm4PzSGmOM1x2md6zl41+RufJLQFk0jJ5kXL6pPP4k3L9yzrFgQKGQPgZ lL/W/R76xZCYaryAX2Wa0q1hZi/FXmbrjLDrke9UDcdh9av+rfGH5y0aK3IHe7aM YQQ9T0Q085qkNZDrmQEnoIxa2aQH/V4DFSm0ek18oXEi8+Jj3wLGmHqR22aP6r89 /QqfM196epWVadu9ZL4RoaK5tIg/lgTv4sePhSj4F0uF2gVNaq2BED4IDjwud99C 8JCTxd7YghFlEQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejvddgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfhhohhmrghsucfoohhnjhgrlhhonhcuoehthhhomhgrshes mhhonhhjrghlohhnrdhnvghtqeenucggtffrrghtthgvrhhnpedvhefgiedvjeegtdevhe efhfetleefgfeivefgffevfeejgedtgfeutdehtdegveenucfkphepjeejrddufeegrddv tdefrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 457E6108005F for ; Mon, 5 Apr 2021 06:03:07 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Date: Mon, 5 Apr 2021 12:02:59 +0200 Message-Id: <20210405100301.657768-2-thomas@monjalon.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405100301.657768-1-thomas@monjalon.net> References: <20210310140107.2730088-1-thomas@monjalon.net> <20210405100301.657768-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 1/3] log: choose EAL log type on registration failure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" In the unlikely case where something goes wrong while registering a log type, the fallback is to use the log type 0, assigned to EAL. Signed-off-by: Thomas Monjalon --- lib/librte_eal/include/rte_log.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h index 173004fd71..21a7d16340 100644 --- a/lib/librte_eal/include/rte_log.h +++ b/lib/librte_eal/include/rte_log.h @@ -380,6 +380,8 @@ RTE_INIT(__##type) \ { \ type = rte_log_register_type_and_pick_level(RTE_STR(name), \ RTE_LOG_##level); \ + if (type < 0) \ + type = RTE_LOGTYPE_EAL; \ } #ifdef __cplusplus -- 2.31.1