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 92ED84373D; Mon, 18 Dec 2023 20:28:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F4C042E0F; Mon, 18 Dec 2023 20:27:00 +0100 (CET) Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) by mails.dpdk.org (Postfix) with ESMTP id 525BB42DED for ; Mon, 18 Dec 2023 20:26:53 +0100 (CET) Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1d3ce28ac3cso9503785ad.0 for ; Mon, 18 Dec 2023 11:26:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1702927612; x=1703532412; 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=IfEBZNx5o1grAD5H8WxbgdgKmhV0o98XWrLO5UjgMBA=; b=xE51+CHffYUec3qtjKFMmNWqShv4lqWdXDtDObygAIuAqlM3ZAg0asVTCPLArnXFg5 Yck2oSx86cWgMGGcO9oGhikRnkZ0kEjAuqVwVyQXSHera4MbhMlDMhkZd6+uuJVNf8+t Ibx1aOdJt5nEV/4qZoU45ytmXY2S+rgC/RNtDb0zdgPo3h0AyGIeGUCobY2SgCX4pKCW j2GRSb5XKkQP1fcJV3vXt/aMxSv6pDVE6qKVfyFJPe0Yja+p3O78mQqLRU5k5WbpquBJ 3BIhewWvAes9E82ABkQJ63No6UZ/QueeKYLvHet5jr4mfGn9VFt90cLb0KF5P/5kb+vC gmTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702927612; x=1703532412; 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=IfEBZNx5o1grAD5H8WxbgdgKmhV0o98XWrLO5UjgMBA=; b=ajLgLaTVTQgCY9SEDC3j/Lj1V/+g9/0vheJsVh9vBiLq7x8tJ+FEhgimRCV2sJHjEj Uh851gQzzSmzaSVujRX4RaXk1KKbC8yw1JgpFSo6UaLhEv5zKgHBbdCL24EZknUIZk3N D/fNk6kD1uLdYs3wRVQ9DuVeVWTFNdMkq08yW6SJfzi+mMfCNA5fY1GJASqvJ76tgkpJ 7SihICXfXlwfhd97Nsei8ZuvKudkGShGbOZlu9rIiIIIgeQKBOE63Iyv0hz0ruGyOTah iG/Os8J65cqpI2FdgAucbuoXLrcK6nXKz/jgNeGdFdqIL5+QAvryuzm8Iyf28NJG50RI 1Qfw== X-Gm-Message-State: AOJu0YwfIG0SJ2/Hmb3QM9ML/+CVedgbh8lA77WjDmcJxdYfnQkD5UXw AwzJogh/YwBZg4lErlH09ddQSlqoL3aOx7qbw7kUPw== X-Google-Smtp-Source: AGHT+IEbmrAR7ymdmNM2aug11mVWvnmrbR8/7Q/TeX7kY2T0wx0LCGW1Rlk1tp28lY0trnd56tTbxA== X-Received: by 2002:a17:902:e804:b0:1d0:6ffd:835b with SMTP id u4-20020a170902e80400b001d06ffd835bmr8877483plg.102.1702927612575; Mon, 18 Dec 2023 11:26:52 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id p17-20020a170903249100b001cfbe348ca5sm19410284plw.187.2023.12.18.11.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 11:26:52 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v4 14/17] event/skeleton: replace logtype PMD with dynamic type Date: Mon, 18 Dec 2023 11:22:30 -0800 Message-ID: <20231218192631.699267-15-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231218192631.699267-1-stephen@networkplumber.org> References: <20231213014408.612051-1-stephen@networkplumber.org> <20231218192631.699267-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 | 3 ++- drivers/event/skeleton/skeleton_eventdev.h | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c index 7df032b7daa1..df50d2e4e4ff 100644 --- a/drivers/event/skeleton/skeleton_eventdev.c +++ b/drivers/event/skeleton/skeleton_eventdev.c @@ -457,7 +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, + PMD_DRV_LOG(INFO, "Initializing %s on NUMA node %d\n", name, rte_socket_id()); return skeleton_eventdev_create(name, rte_socket_id(), vdev); } @@ -479,3 +479,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