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 2958543760; Fri, 22 Dec 2023 18:20:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0CAF242EAF; Fri, 22 Dec 2023 18:20:54 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id 2237140693 for ; Fri, 22 Dec 2023 18:20:51 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6d9344f30caso1498999b3a.1 for ; Fri, 22 Dec 2023 09:20:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1703265650; x=1703870450; 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=hQ4KiyeQqvyqK01nuB16GuZfh0H9VHVrdiE/So+szwKCJXV7aKTWg5ni7MU/N0Na4w 5Fnpl6e4Bgt2iLB6AsSFGIMmVL/kM/TEQ0ua2LCBVvsQ5IrgikrfA4LRcuapb10gSJRN R0VywkR24Ra90Tno1XH9v8KUVSCwLHBs2VbXxx80lj6k8oMpCToOZy7c1Ld5fjf36Fb2 acNiG2LmSA4Y8t65PXJ8JvcuwPQ6x7OK1wmy1eHE+UTttSqYyltaV3vs5pYBOZnHkBWY ThUpOPk9pVn3/7ullciudwcuNj31wNGvW8xNX0wXZmlzFQLKId1LTsBip2pDYDqpMzQL UuPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703265650; x=1703870450; 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=Apaii2u7Bv/9RZgyJrjIMry5tbazWEPlbyF+5eD1mbWJ0Yc0w05vFAnCUKPt/89PU0 hPuWCsOiLzJcRnTPjC+wzkBK+KAEzGqmZXJUOqgeO5WVswWN96xUMW9oRvJm7A0XyyAM 8duaVw0H1khxbdg7kT0Q7aTsy8sr5DkBuQ8BCqFDufcFscBrYaDADCYMCwfQpJPf1gbq tTwfkkoZJ/2CjKVsXRldjC8i19FBa+/lCn7jlh1mq5iJ8Alpka3RqPT+EtpBVR9cu1qR JNEHzkVlQpc+b1xSKh+aNgMMDfc8+9eS8tkPMFyjfhwnqGpYcaTKb9iI9IfsLZegn+Ba rSuQ== X-Gm-Message-State: AOJu0YySYJxyFGxQQyLN84n2xhqqcO2IgMWN8e/ASq9ni7hGGTWh7AgA ZEj8Uduox6avNLIROvkvKrgSiyx8MaHC5mB3cZJZSvN1MOVSkQ== X-Google-Smtp-Source: AGHT+IHyPvYtt7gOfmnjGswAUXpuzxe140Gapv5R2jKjOK3ir1xr+UHPrI5LCCQ7+29Rx/XYlt246w== X-Received: by 2002:a05:6a00:1822:b0:6d8:51de:b460 with SMTP id y34-20020a056a00182200b006d851deb460mr3324426pfa.9.1703265650318; Fri, 22 Dec 2023 09:20:50 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id h19-20020a62b413000000b006d7d454e58asm372024pfn.117.2023.12.22.09.20.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 09:20:50 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Jerin Jacob Subject: [PATCH v6 18/20] event/skeleton: replace logtype PMD with dynamic type Date: Fri, 22 Dec 2023 09:11:51 -0800 Message-ID: <20231222171820.8778-19-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231222171820.8778-1-stephen@networkplumber.org> References: <20231213014408.612051-1-stephen@networkplumber.org> <20231222171820.8778-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