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 1358C43751; Thu, 21 Dec 2023 17:50:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 103B642ED7; Thu, 21 Dec 2023 17:49:21 +0100 (CET) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mails.dpdk.org (Postfix) with ESMTP id 5251642ECA for ; Thu, 21 Dec 2023 17:49:19 +0100 (CET) Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so773084a12.1 for ; Thu, 21 Dec 2023 08:49:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1703177358; x=1703782158; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IliaEP2TEKKFe31xugoOmaiAaNmKUbc7ILbkzWi/uR4=; b=HmBW1bcp48/vchcECt06uFTG+0C1/GhgfKMt3FEiSWsw1jH9R3bP4CFwaPFOBR+i0c MhBRCEK1V5E58QMUcPKFZqyzo3nPOUQwSV/EScgT5myPlcQcHDoplgDzC3J7Mpr0DJXW iCiJpVz7PFpmg6kTE79yK1tDuFPGWn2HuFfa5/H35pPXBwrTE5wBwotooiBvo3zYKFBM Z0KYF5u43A9iKa+hTSPtXGi4b6RoFyrKq5yKvGqP1havw0w5k9FZTzpYlhKOHigUPnx5 nvFMnhT/FAG1x98QRNhvAh2t9ato5x+azae3jBgRbiRc7bwO/lc+Wobd569aWWLS4+SO Xk3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703177358; x=1703782158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IliaEP2TEKKFe31xugoOmaiAaNmKUbc7ILbkzWi/uR4=; b=Ub7Cs9/JRM8c54PGTygT1cyld5hlk11rIVXKZ3w06YV1iieAUEz5UThOaX8W54iDs3 MkHh9VyiRGkYjZ1jkggOrncSsPrcxqVbNnHNTOThdjzASGnVHQ0vO9Zc5M22rvpz6jz4 VQBq5hHfno9t14/A0L/YhKly3F7lp6DzufUy1nBae3fhx3SUGaGtCd1RBvDMsX1mEuru SJqvxEVgm7bZ70kp1UjU5XDP8Wm7PZOX0aAug5A7MEr9XuZOmujdgTjVZXq8DAAhnz7i SFGIC10oGqqxK1j6J7tjfIjat1BhuwvHnIjihLVmt6zrGIIhRjl3sEUHLH1yzRKmuVr+ r0KA== X-Gm-Message-State: AOJu0YzeqJhTnH2dVcTmD4a/hkkE75db0Oa3BpbULFxq9u3Y66Q0nKME 8wU6JZPPnXiJjalK0WwDM6eNoVkoO651C1NZBak6Ug== X-Google-Smtp-Source: AGHT+IHzRY2TP1fT8cYyIu/GGr8sClLki/Vl7Xsmy78Vr2W6jMqVblj+5+ahLRb7jOT6ynkgsSedVg== X-Received: by 2002:a05:6a21:3284:b0:190:2ce8:dc87 with SMTP id yt4-20020a056a21328400b001902ce8dc87mr1944412pzb.60.1703177358518; Thu, 21 Dec 2023 08:49:18 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id g20-20020a63e614000000b0058901200bbbsm1842456pgh.40.2023.12.21.08.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 08:49:18 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jerin Jacob Subject: [PATCH v5 15/18] event/skeleton: replace logtype PMD with dynamic type Date: Thu, 21 Dec 2023 08:46:32 -0800 Message-ID: <20231221164841.125006-16-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231221164841.125006-1-stephen@networkplumber.org> References: <20231213014408.612051-1-stephen@networkplumber.org> <20231221164841.125006-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The skeleton is supposed to match current best practices. Change it to use dynamic logtype. Signed-off-by: Stephen Hemminger --- drivers/event/skeleton/skeleton_eventdev.c | 4 ++-- drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c index 7df032b7daa1..848b3be82c40 100644 --- a/drivers/event/skeleton/skeleton_eventdev.c +++ b/drivers/event/skeleton/skeleton_eventdev.c @@ -457,8 +457,7 @@ skeleton_eventdev_probe(struct rte_vdev_device *vdev) const char *name; name = rte_vdev_device_name(vdev); - RTE_LOG(INFO, PMD, "Initializing %s on NUMA node %d\n", name, - rte_socket_id()); + PMD_DRV_LOG(INFO, "Initializing %s on NUMA node %d", name, rte_socket_id()); return skeleton_eventdev_create(name, rte_socket_id(), vdev); } @@ -479,3 +478,4 @@ static struct rte_vdev_driver vdev_eventdev_skeleton_pmd = { }; RTE_PMD_REGISTER_VDEV(EVENTDEV_NAME_SKELETON_PMD, vdev_eventdev_skeleton_pmd); +RTE_LOG_REGISTER_DEFAULT(skeleton_eventdev_logtype, INFO); diff --git a/drivers/event/skeleton/skeleton_eventdev.h b/drivers/event/skeleton/skeleton_eventdev.h index 9193f45f4782..9c1ed4ec5755 100644 --- a/drivers/event/skeleton/skeleton_eventdev.h +++ b/drivers/event/skeleton/skeleton_eventdev.h @@ -8,9 +8,12 @@ #include #include +extern int skeleton_eventdev_logtype; + #ifdef RTE_LIBRTE_PMD_SKELETON_EVENTDEV_DEBUG #define PMD_DRV_LOG(level, fmt, args...) \ - RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ ## level, skeleton_eventdev_logtype, \ + "%s(): " fmt "\n", __func__, ## args) #define PMD_DRV_FUNC_TRACE() PMD_DRV_LOG(DEBUG, ">>") #else #define PMD_DRV_LOG(level, fmt, args...) do { } while (0) @@ -18,7 +21,8 @@ #endif #define PMD_DRV_ERR(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ## args) + rte_log(RTE_LOG_ERR, skeleton_eventdev_logtype, \ + "%s(): " fmt "\n", __func__, ## args) struct skeleton_eventdev { uintptr_t reg_base; -- 2.43.0