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 CDBF741CA8; Wed, 15 Feb 2023 18:24:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90EFD42D61; Wed, 15 Feb 2023 18:24:05 +0100 (CET) Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by mails.dpdk.org (Postfix) with ESMTP id 69D4742D46 for ; Wed, 15 Feb 2023 18:23:58 +0100 (CET) Received: by mail-pj1-f45.google.com with SMTP id d13-20020a17090ad3cd00b0023127b2d602so2517905pjw.2 for ; Wed, 15 Feb 2023 09:23:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; 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=ih9HmuklDDu9CqsJA9hCit/INNrThteUX+RMNcoZ7QE=; b=gtCFyjx4qhOIxXug41+ZHJW6kkPoNa3K993LxYCSk06OB4hGSVi7qorBfDU7bzlBOe 8BuMi3yv8crVF7sSSXblNGbe4MhEeGdGFVrJQvssdfUy73k4EsioRXE1PEtWf2FMG8NE q44BaH8NjKI1UmkgXVuWVFgkHqC/g4cTIxSw0A+rus7g3UEkgBU+AuwObR3m2Mj+HchG DLOq66bWSlFC/RiiwG8NkXvqjERATHCAySg+BYkyFAEIks8lEge4OwtTrzpXR2I3u9OX imY5/AtNzY9DHxDjOjuF30+CJDl2OBuOwU+uFqcmXBEe+M2ZE7MUIpsnPOa4bepbJvMe g9cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=ih9HmuklDDu9CqsJA9hCit/INNrThteUX+RMNcoZ7QE=; b=FZ1dxp+FaKu8SKM5OdKdL+MfjaDNGMK415YmhwYWjo19vpc2PhtMS4ShxLP2F2ENf2 lWk83jWqp51FXKV2e6sK+5B+cAdrTL2wYlEay6O1+d5wtYLUS+eDzZIGvQn9q3NjELVn KbTfZcwmDycwEk3+xO7p8sfPlKttB91DhjiWFi9leBzRbwqDy6fPOSO4LpLSU0uhQrWo 3+Eb4iiWU55TkiN/hlfKZksxHPrDIw54YarLgjoU7sZBjM7etWKXVD5aZ+avPVVBZj/v 6ZNysnmDl24Xotzom52eQNRW0+uhpzyLtuIXGVr2C95Df/UTysXKx1JD32CYOCbN9wWB udow== X-Gm-Message-State: AO0yUKWVGov6REnWWXLi3CmcQty5M9noKh8KFsdZreTw7yq6IBpX0fY2 V+DJLOsLGBb7OwJKGfwF+i4pJ2Cniib7QBTT5FijvQ== X-Google-Smtp-Source: AK7set8OFG41d5xsh2kOZa7Ov+Dz1LoolabAjCbn4PH58vEmY2hQz+n0pO5bi2fWC0eSBHss0ao3aA== X-Received: by 2002:a05:6a21:9708:b0:bc:cd2c:dfce with SMTP id ub8-20020a056a21970800b000bccd2cdfcemr1974800pzb.31.1676481837268; Wed, 15 Feb 2023 09:23:57 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id m7-20020aa79007000000b005a8da960fa8sm3705304pfo.144.2023.02.15.09.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 09:23:56 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , David Hunt Subject: [PATCH v7 09/22] power: replace RTE_LOGTYPE_POWER with dynamic type Date: Wed, 15 Feb 2023 09:23:28 -0800 Message-Id: <20230215172341.1525320-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230215172341.1525320-1-stephen@networkplumber.org> References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230215172341.1525320-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 Use dynamic log type for power library. Also replace use of RTE_LOGTYPE_USER1 with lib.power.guest. Signed-off-by: Stephen Hemminger --- lib/eal/common/eal_common_log.c | 1 - lib/eal/include/rte_log.h | 2 +- lib/power/guest_channel.c | 3 ++- lib/power/power_common.c | 2 ++ lib/power/power_common.h | 3 ++- lib/power/power_kvm_vm.c | 1 + lib/power/rte_power.c | 1 + lib/power/rte_power_empty_poll.c | 1 + 8 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c index 9e853addb717..39e1e6680dea 100644 --- a/lib/eal/common/eal_common_log.c +++ b/lib/eal/common/eal_common_log.c @@ -355,7 +355,6 @@ static const struct logtype logtype_strings[] = { {RTE_LOGTYPE_HASH, "lib.hash"}, {RTE_LOGTYPE_LPM, "lib.lpm"}, {RTE_LOGTYPE_KNI, "lib.kni"}, - {RTE_LOGTYPE_POWER, "lib.power"}, {RTE_LOGTYPE_METER, "lib.meter"}, {RTE_LOGTYPE_SCHED, "lib.sched"}, {RTE_LOGTYPE_PORT, "lib.port"}, diff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h index 1408722b2c2f..7d4345acceca 100644 --- a/lib/eal/include/rte_log.h +++ b/lib/eal/include/rte_log.h @@ -36,7 +36,7 @@ extern "C" { #define RTE_LOGTYPE_LPM 7 /**< Log related to LPM. */ #define RTE_LOGTYPE_KNI 8 /**< Log related to KNI. */ /* was RTE_LOGTYPE_ACL */ -#define RTE_LOGTYPE_POWER 10 /**< Log related to power. */ + /* was RTE_LOGTYPE_POWER */ #define RTE_LOGTYPE_METER 11 /**< Log related to QoS meter. */ #define RTE_LOGTYPE_SCHED 12 /**< Log related to QoS port scheduler. */ #define RTE_LOGTYPE_PORT 13 /**< Log related to port. */ diff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c index 969a9e5aaa06..efc326d520ca 100644 --- a/lib/power/guest_channel.c +++ b/lib/power/guest_channel.c @@ -17,7 +17,8 @@ #include "guest_channel.h" -#define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1 +RTE_LOG_REGISTER_SUFFIX(guest_channel_logtype, guest, INFO); +#define RTE_LOGTYPE_GUEST_CHANNEL guest_channel_logtype /* Timeout for incoming message in milliseconds. */ #define TIMEOUT 10 diff --git a/lib/power/power_common.c b/lib/power/power_common.c index 1e09facb863f..bf77eafa886b 100644 --- a/lib/power/power_common.c +++ b/lib/power/power_common.c @@ -12,6 +12,8 @@ #include "power_common.h" +RTE_LOG_REGISTER_DEFAULT(power_logtype, INFO); + #define POWER_SYSFILE_SCALING_DRIVER \ "/sys/devices/system/cpu/cpu%u/cpufreq/scaling_driver" #define POWER_SYSFILE_GOVERNOR \ diff --git a/lib/power/power_common.h b/lib/power/power_common.h index c1c713927621..63a3a443509e 100644 --- a/lib/power/power_common.h +++ b/lib/power/power_common.h @@ -5,11 +5,12 @@ #ifndef _POWER_COMMON_H_ #define _POWER_COMMON_H_ - #include #define RTE_POWER_INVALID_FREQ_INDEX (~0) +extern int power_logtype; +#define RTE_LOGTYPE_POWER power_logtype #ifdef RTE_LIBRTE_POWER_DEBUG #define POWER_DEBUG_TRACE(fmt, args...) \ diff --git a/lib/power/power_kvm_vm.c b/lib/power/power_kvm_vm.c index 6a8109d44959..db031f43105a 100644 --- a/lib/power/power_kvm_vm.c +++ b/lib/power/power_kvm_vm.c @@ -8,6 +8,7 @@ #include "rte_power_guest_channel.h" #include "guest_channel.h" +#include "power_common.h" #include "power_kvm_vm.h" #define FD_PATH "/dev/virtio-ports/virtio.serial.port.poweragent" diff --git a/lib/power/rte_power.c b/lib/power/rte_power.c index 63a43bd8f5ae..db0e7705a9ef 100644 --- a/lib/power/rte_power.c +++ b/lib/power/rte_power.c @@ -10,6 +10,7 @@ #include "rte_power.h" #include "power_acpi_cpufreq.h" #include "power_cppc_cpufreq.h" +#include "power_common.h" #include "power_kvm_vm.h" #include "power_pstate_cpufreq.h" diff --git a/lib/power/rte_power_empty_poll.c b/lib/power/rte_power_empty_poll.c index 4a4db512474e..64e3b4b46d5e 100644 --- a/lib/power/rte_power_empty_poll.c +++ b/lib/power/rte_power_empty_poll.c @@ -10,6 +10,7 @@ #include "rte_power.h" #include "rte_power_empty_poll.h" +#include "power_common.h" #define INTERVALS_PER_SECOND 100 /* (10ms) */ #define SECONDS_TO_TRAIN_FOR 2 -- 2.39.1