get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/123631/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 123631,
    "url": "http://patches.dpdk.org/api/patches/123631/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230210010724.890413-7-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20230210010724.890413-7-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230210010724.890413-7-stephen@networkplumber.org",
    "date": "2023-02-10T01:07:14",
    "name": "[v3,06/16] power: replace RTE_LOGTYPE_POWER with dynamic type",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "6f98a8b0b55e184ae9a2ba62732a54be5795fcf4",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230210010724.890413-7-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 26935,
            "url": "http://patches.dpdk.org/api/series/26935/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26935",
            "date": "2023-02-10T01:07:08",
            "name": "Replace use of static logtypes",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/26935/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/123631/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/123631/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 73C5C41C58;\n\tFri, 10 Feb 2023 02:08:35 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 526C142D2F;\n\tFri, 10 Feb 2023 02:08:14 +0100 (CET)",
            "from mail-pl1-f175.google.com (mail-pl1-f175.google.com\n [209.85.214.175])\n by mails.dpdk.org (Postfix) with ESMTP id 6186B40EE3\n for <dev@dpdk.org>; Fri, 10 Feb 2023 02:08:10 +0100 (CET)",
            "by mail-pl1-f175.google.com with SMTP id w5so4874461plg.8\n for <dev@dpdk.org>; Thu, 09 Feb 2023 17:08:10 -0800 (PST)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n jd9-20020a170903260900b0019625428cefsm2103023plb.281.2023.02.09.17.08.07\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 09 Feb 2023 17:08:07 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20210112.gappssmtp.com; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=DcX7CLL5YNKDf43G1sbnUBI338OeT436Lvk7BVnMGQo=;\n b=yhq+7XwuryatAQDtif74+j9at/eD7fqaJ8Uzzvqbe1hGW+OI9pFYs4088dmFvVkDfz\n soHrBLoNIotPdgyCFTU1zm7uNz0Qw2lRj2tWEHNjplRvZbi1Sj4x4FAhKCX+BbFDjT70\n vYSeXRjGDJRqsjDOwA0nIq4jZCoCJrRHTTmsSnopC66CpHDm8WNawNaPd2bsa1xZHY64\n AxY+WVtu771CN8yO43lCsZg6sa0EER6WYkgQVE+3lUFcr4kpKmWtkYnaGC3ApG/6pIvl\n 0Q7pS+Kv5F50SaRKvtlE8Mq73JKcjqS+JB9wGDIO83NcbZCgyw43EsKstYpajjuWHiBT\n 1E4w==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=DcX7CLL5YNKDf43G1sbnUBI338OeT436Lvk7BVnMGQo=;\n b=Y+aAkVksKp0E1MmdIZTlT1E3AKiLenNommEu33Lmn0u/gFZMIeqTc+mDywRaIAejL7\n fFW/BX7HuMkc+gjOBh/+oWvqZuroW/cr6HLUv3aAz7cIwLw4cn7hS44sNpZPwgNRz+b3\n nXA9jk6pKHjNObG3mMCPovJeUpOoydRU82X379GMtRC6ZpxNVkRl3b/8GEzDt6nG4XPS\n 3iaV5jpnLojzXFEVULJ6rjZXPqXWIIKzz/p6i87cLj3IQWA7fbgOnJ6vdqX74YSLW47Q\n 4zbyGOVO0ARwZkmc1yBqcS14Hs/og9AsYk7x/u+hS4oaBTUhCMGKcmCVGvGXxdaPnxga\n l+fw==",
        "X-Gm-Message-State": "AO0yUKVoEiq5vEBQj09Odcb6gWWw9egXEar4wfKV2zB7HP9PMeMmew9w\n iwgaKZzRKoHU48x7nLFNpgfOcmqyYinv7vkjZlg=",
        "X-Google-Smtp-Source": "\n AK7set8kSjFkVrTjZHRkXiPiBJnUWpuxAgWAzNi+UQGabeOw7Y+w9xgDcjXa3GSMpiHidb44VbZQxA==",
        "X-Received": "by 2002:a17:902:eccf:b0:19a:5f47:9dcb with SMTP id\n a15-20020a170902eccf00b0019a5f479dcbmr4012876plh.51.1675991288377;\n Thu, 09 Feb 2023 17:08:08 -0800 (PST)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n David Hunt <david.hunt@intel.com>",
        "Subject": "[PATCH v3 06/16] power: replace RTE_LOGTYPE_POWER with dynamic type",
        "Date": "Thu,  9 Feb 2023 17:07:14 -0800",
        "Message-Id": "<20230210010724.890413-7-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.1",
        "In-Reply-To": "<20230210010724.890413-1-stephen@networkplumber.org>",
        "References": "<20230207204151.1503491-1-stephen@networkplumber.org>\n <20230210010724.890413-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 <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Use dynamic log type for power library.\nAlso replace use of RTE_LOGTYPE_USER1 with lib.power.guest.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n lib/eal/common/eal_common_log.c    |   1 -\n lib/eal/include/rte_log.h          |   2 +-\n lib/power/guest_channel.c          |  48 +++++----\n lib/power/power_acpi_cpufreq.c     | 118 ++++++++++----------\n lib/power/power_common.c           |  11 +-\n lib/power/power_common.h           |   7 +-\n lib/power/power_cppc_cpufreq.c     | 129 +++++++++++-----------\n lib/power/power_kvm_vm.c           |  24 +++--\n lib/power/power_pstate_cpufreq.c   | 166 ++++++++++++++++-------------\n lib/power/rte_power.c              |  25 +++--\n lib/power/rte_power_empty_poll.c   |  36 +++----\n lib/power/rte_power_intel_uncore.c |  75 ++++++-------\n lib/power/rte_power_pmd_mgmt.c     |  37 ++++---\n 13 files changed, 365 insertions(+), 314 deletions(-)",
    "diff": "diff --git a/lib/eal/common/eal_common_log.c b/lib/eal/common/eal_common_log.c\nindex 871f2c38298c..7dbf1df3b979 100644\n--- a/lib/eal/common/eal_common_log.c\n+++ b/lib/eal/common/eal_common_log.c\n@@ -355,7 +355,6 @@ static const struct logtype logtype_strings[] = {\n \t{RTE_LOGTYPE_HASH,       \"lib.hash\"},\n \t{RTE_LOGTYPE_LPM,        \"lib.lpm\"},\n \t{RTE_LOGTYPE_KNI,        \"lib.kni\"},\n-\t{RTE_LOGTYPE_POWER,      \"lib.power\"},\n \t{RTE_LOGTYPE_METER,      \"lib.meter\"},\n \t{RTE_LOGTYPE_SCHED,      \"lib.sched\"},\n \t{RTE_LOGTYPE_PORT,       \"lib.port\"},\ndiff --git a/lib/eal/include/rte_log.h b/lib/eal/include/rte_log.h\nindex d707098b6359..5b7850af4e2b 100644\n--- a/lib/eal/include/rte_log.h\n+++ b/lib/eal/include/rte_log.h\n@@ -36,7 +36,7 @@ extern \"C\" {\n #define RTE_LOGTYPE_LPM        7 /**< Log related to LPM. */\n #define RTE_LOGTYPE_KNI        8 /**< Log related to KNI. */\n \t\t\t\t /* was RTE_LOGTYPE_ACL */\n-#define RTE_LOGTYPE_POWER     10 /**< Log related to power. */\n+\t\t\t\t /* was RTE_LOGTYPE_POWER */\n #define RTE_LOGTYPE_METER     11 /**< Log related to QoS meter. */\n #define RTE_LOGTYPE_SCHED     12 /**< Log related to QoS port scheduler. */\n #define RTE_LOGTYPE_PORT      13 /**< Log related to port. */\ndiff --git a/lib/power/guest_channel.c b/lib/power/guest_channel.c\nindex 969a9e5aaa06..ad59d60f5d94 100644\n--- a/lib/power/guest_channel.c\n+++ b/lib/power/guest_channel.c\n@@ -17,7 +17,11 @@\n \n #include \"guest_channel.h\"\n \n-#define RTE_LOGTYPE_GUEST_CHANNEL RTE_LOGTYPE_USER1\n+RTE_LOG_REGISTER_SUFFIX(guest_channel_logtype, guest, INFO);\n+\n+#define GUEST_LOG(level, fmt, args...)\t\t\t\t\\\n+\trte_log(RTE_LOG_ ## level, guest_channel_logtype,\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ## args)\n \n /* Timeout for incoming message in milliseconds. */\n #define TIMEOUT 10\n@@ -58,38 +62,38 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)\n \tint fd = -1;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel(%u) is out of range 0...%d\\n\",\n+\t\tGUEST_LOG(ERR, \"Channel(%u) is out of range 0...%d\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n \t\treturn -1;\n \t}\n \t/* check if path is already open */\n \tif (global_fds[lcore_id] != -1) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel(%u) is already open with fd %d\\n\",\n+\t\tGUEST_LOG(ERR, \"Channel(%u) is already open with fd %d\",\n \t\t\t\tlcore_id, global_fds[lcore_id]);\n \t\treturn -1;\n \t}\n \n \tsnprintf(fd_path, PATH_MAX, \"%s.%u\", path, lcore_id);\n-\tRTE_LOG(INFO, GUEST_CHANNEL, \"Opening channel '%s' for lcore %u\\n\",\n+\tGUEST_LOG(INFO, \"Opening channel '%s' for lcore %u\",\n \t\t\tfd_path, lcore_id);\n \tfd = open(fd_path, O_RDWR);\n \tif (fd < 0) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Unable to to connect to '%s' with error \"\n-\t\t\t\t\"%s\\n\", fd_path, strerror(errno));\n+\t\tGUEST_LOG(ERR, \"Unable to connect to '%s' with error %s\",\n+\t\t\t  fd_path, strerror(errno));\n \t\treturn -1;\n \t}\n \n \tflags = fcntl(fd, F_GETFL, 0);\n \tif (flags < 0) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Failed on fcntl get flags for file %s\\n\",\n+\t\tGUEST_LOG(ERR, \"Failed on fcntl get flags for file %s\",\n \t\t\t\tfd_path);\n \t\tgoto error;\n \t}\n \n \tflags |= O_NONBLOCK;\n \tif (fcntl(fd, F_SETFL, flags) < 0) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Failed on setting non-blocking mode for \"\n-\t\t\t\t\"file %s\", fd_path);\n+\t\tGUEST_LOG(ERR, \"Failed on setting non-blocking mode for file %s\",\n+\t\t\t  fd_path);\n \t\tgoto error;\n \t}\n \t/* QEMU needs a delay after connection */\n@@ -102,13 +106,13 @@ guest_channel_host_connect(const char *path, unsigned int lcore_id)\n \tglobal_fds[lcore_id] = fd;\n \tret = guest_channel_send_msg(&pkt, lcore_id);\n \tif (ret != 0) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL,\n-\t\t\t\t\"Error on channel '%s' communications test: %s\\n\",\n-\t\t\t\tfd_path, ret > 0 ? strerror(ret) :\n-\t\t\t\t\"channel not connected\");\n+\t\tGUEST_LOG(ERR,\n+\t\t\t  \"Error on channel '%s' communications test: %s\",\n+\t\t\t  fd_path, ret > 0 ? strerror(ret) :\n+\t\t\t  \"channel not connected\");\n \t\tgoto error;\n \t}\n-\tRTE_LOG(INFO, GUEST_CHANNEL, \"Channel '%s' is now connected\\n\", fd_path);\n+\tGUEST_LOG(INFO, \"Channel '%s' is now connected\", fd_path);\n \treturn 0;\n error:\n \tclose(fd);\n@@ -124,13 +128,13 @@ guest_channel_send_msg(struct rte_power_channel_packet *pkt,\n \tvoid *buffer = pkt;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel(%u) is out of range 0...%d\\n\",\n+\t\tGUEST_LOG(ERR, \"Channel(%u) is out of range 0...%d\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n \t\treturn -1;\n \t}\n \n \tif (global_fds[lcore_id] < 0) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel is not connected\\n\");\n+\t\tGUEST_LOG(ERR, \"Channel is not connected\");\n \t\treturn -1;\n \t}\n \twhile (buffer_len > 0) {\n@@ -165,13 +169,13 @@ int power_guest_channel_read_msg(void *pkt,\n \t\treturn -1;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel(%u) is out of range 0...%d\\n\",\n+\t\tGUEST_LOG(ERR, \"Channel(%u) is out of range 0...%d\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n \t\treturn -1;\n \t}\n \n \tif (global_fds[lcore_id] < 0) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel is not connected\\n\");\n+\t\tGUEST_LOG(ERR, \"Channel is not connected\");\n \t\treturn -1;\n \t}\n \n@@ -180,10 +184,10 @@ int power_guest_channel_read_msg(void *pkt,\n \n \tret = poll(&fds, 1, TIMEOUT);\n \tif (ret == 0) {\n-\t\tRTE_LOG(DEBUG, GUEST_CHANNEL, \"Timeout occurred during poll function.\\n\");\n+\t\tGUEST_LOG(DEBUG, \"Timeout occurred during poll function.\");\n \t\treturn -1;\n \t} else if (ret < 0) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Error occurred during poll function: %s\\n\",\n+\t\tGUEST_LOG(ERR, \"Error occurred during poll function: %s\",\n \t\t\t\tstrerror(errno));\n \t\treturn -1;\n \t}\n@@ -199,7 +203,7 @@ int power_guest_channel_read_msg(void *pkt,\n \t\t}\n \n \t\tif (ret == 0) {\n-\t\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Expected more data, but connection has been closed.\\n\");\n+\t\t\tGUEST_LOG(ERR, \"Expected more data, but connection has been closed.\");\n \t\t\treturn -1;\n \t\t}\n \t\tpkt = (char *)pkt + ret;\n@@ -220,7 +224,7 @@ void\n guest_channel_host_disconnect(unsigned int lcore_id)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, GUEST_CHANNEL, \"Channel(%u) is out of range 0...%d\\n\",\n+\t\tGUEST_LOG(ERR, \"Channel(%u) is out of range 0...%d\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n \t\treturn;\n \t}\ndiff --git a/lib/power/power_acpi_cpufreq.c b/lib/power/power_acpi_cpufreq.c\nindex 6e57aca53513..3643044d9ef0 100644\n--- a/lib/power/power_acpi_cpufreq.c\n+++ b/lib/power/power_acpi_cpufreq.c\n@@ -62,8 +62,9 @@ static int\n set_freq_internal(struct acpi_power_info *pi, uint32_t idx)\n {\n \tif (idx >= RTE_MAX_LCORE_FREQS || idx >= pi->nb_freqs) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid frequency index %u, which \"\n-\t\t\t\t\"should be less than %u\\n\", idx, pi->nb_freqs);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Invalid frequency index %u, which should be less than %u\",\n+\t\t\t  idx, pi->nb_freqs);\n \t\treturn -1;\n \t}\n \n@@ -74,13 +75,15 @@ set_freq_internal(struct acpi_power_info *pi, uint32_t idx)\n \tPOWER_DEBUG_TRACE(\"Frequency[%u] %u to be set for lcore %u\\n\",\n \t\t\tidx, pi->freqs[idx], pi->lcore_id);\n \tif (fseek(pi->f, 0, SEEK_SET) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to set file position indicator to 0 \"\n-\t\t\t\t\"for setting frequency for lcore %u\\n\", pi->lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to set file position indicator to 0 for setting frequency for lcore %u\",\n+\t\t\t  pi->lcore_id);\n \t\treturn -1;\n \t}\n \tif (fprintf(pi->f, \"%u\", pi->freqs[idx]) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to write new frequency for \"\n-\t\t\t\t\"lcore %u\\n\", pi->lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to write new frequency for lcore %u\",\n+\t\t\t  pi->lcore_id);\n \t\treturn -1;\n \t}\n \tfflush(pi->f);\n@@ -126,14 +129,14 @@ power_get_available_freqs(struct acpi_power_info *pi)\n \n \topen_core_sysfs_file(&f, \"r\", POWER_SYSFILE_AVAIL_FREQ, pi->lcore_id);\n \tif (f == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_AVAIL_FREQ);\n \t\tgoto out;\n \t}\n \n \tret = read_core_sysfs_s(f, buf, sizeof(buf));\n \tif ((ret) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_AVAIL_FREQ);\n \t\tgoto out;\n \t}\n@@ -142,12 +145,13 @@ power_get_available_freqs(struct acpi_power_info *pi)\n \tcount = rte_strsplit(buf, sizeof(buf), freqs,\n \t\t\tRTE_MAX_LCORE_FREQS, ' ');\n \tif (count <= 0) {\n-\t\tRTE_LOG(ERR, POWER, \"No available frequency in \"\n-\t\t\t\t\"\"POWER_SYSFILE_AVAIL_FREQ\"\\n\", pi->lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"No available frequency in \" POWER_SYSFILE_AVAIL_FREQ,\n+\t\t\t  pi->lcore_id);\n \t\tgoto out;\n \t}\n \tif (count >= RTE_MAX_LCORE_FREQS) {\n-\t\tRTE_LOG(ERR, POWER, \"Too many available frequencies : %d\\n\",\n+\t\tPOWER_LOG(ERR, \"Too many available frequencies : %d\",\n \t\t\t\tcount);\n \t\tgoto out;\n \t}\n@@ -195,14 +199,14 @@ power_init_for_setting_freq(struct acpi_power_info *pi)\n \n \topen_core_sysfs_file(&f, \"rw+\", POWER_SYSFILE_SETSPEED, pi->lcore_id);\n \tif (f == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_SETSPEED);\n \t\tgoto err;\n \t}\n \n \tret = read_core_sysfs_s(f, buf, sizeof(buf));\n \tif ((ret) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_SETSPEED);\n \t\tgoto err;\n \t}\n@@ -236,7 +240,7 @@ power_acpi_cpufreq_init(unsigned int lcore_id)\n \tuint32_t exp_state;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Lcore id %u can not exceeds %u\\n\",\n+\t\tPOWER_LOG(ERR, \"Lcore id %u can not exceeds %u\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE - 1U);\n \t\treturn -1;\n \t}\n@@ -252,42 +256,47 @@ power_acpi_cpufreq_init(unsigned int lcore_id)\n \tif (!__atomic_compare_exchange_n(&(pi->state), &exp_state,\n \t\t\t\t\tPOWER_ONGOING, 0,\n \t\t\t\t\t__ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) {\n-\t\tRTE_LOG(INFO, POWER, \"Power management of lcore %u is \"\n-\t\t\t\t\"in use\\n\", lcore_id);\n+\t\tPOWER_LOG(INFO,\n+\t\t\t  \"Power management of lcore %u is in use\", lcore_id);\n \t\treturn -1;\n \t}\n \n \tpi->lcore_id = lcore_id;\n \t/* Check and set the governor */\n \tif (power_set_governor_userspace(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot set governor of lcore %u to \"\n-\t\t\t\t\"userspace\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot set governor of lcore %u to userspace\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n \t/* Get the available frequencies */\n \tif (power_get_available_freqs(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot get available frequencies of \"\n-\t\t\t\t\"lcore %u\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot get available frequencies of lcore %u\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n \t/* Init for setting lcore frequency */\n \tif (power_init_for_setting_freq(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot init for setting frequency for \"\n-\t\t\t\t\"lcore %u\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot init for setting frequency for lcore %u\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n \t/* Set freq to max by default */\n \tif (power_acpi_cpufreq_freq_max(lcore_id) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot set frequency of lcore %u \"\n-\t\t\t\t\"to max\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot set frequency of lcore %u to max\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Initialized successfully for lcore %u \"\n-\t\t\t\"power management\\n\", lcore_id);\n+\tPOWER_LOG(INFO,\n+\t\t  \"Initialized successfully for lcore %u power management\",\n+\t\t  lcore_id);\n \texp_state = POWER_ONGOING;\n \t__atomic_compare_exchange_n(&(pi->state), &exp_state, POWER_USED,\n \t\t\t\t    0, __ATOMIC_RELEASE, __ATOMIC_RELAXED);\n@@ -309,7 +318,7 @@ power_acpi_cpufreq_exit(unsigned int lcore_id)\n \tuint32_t exp_state;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Lcore id %u can not exceeds %u\\n\",\n+\t\tPOWER_LOG(ERR, \"Lcore id %u can not exceeds %u\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE - 1U);\n \t\treturn -1;\n \t}\n@@ -324,8 +333,8 @@ power_acpi_cpufreq_exit(unsigned int lcore_id)\n \tif (!__atomic_compare_exchange_n(&(pi->state), &exp_state,\n \t\t\t\t\tPOWER_ONGOING, 0,\n \t\t\t\t\t__ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) {\n-\t\tRTE_LOG(INFO, POWER, \"Power management of lcore %u is \"\n-\t\t\t\t\"not used\\n\", lcore_id);\n+\t\tPOWER_LOG(INFO,\n+\t\t\t  \"Power management of lcore %u is not used\", lcore_id);\n \t\treturn -1;\n \t}\n \n@@ -335,14 +344,15 @@ power_acpi_cpufreq_exit(unsigned int lcore_id)\n \n \t/* Set the governor back to the original */\n \tif (power_set_governor_original(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot set the governor of %u back \"\n-\t\t\t\t\"to the original\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot set the governor of %u back to the original\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Power management of lcore %u has exited from \"\n-\t\t\t\"'userspace' mode and been set back to the \"\n-\t\t\t\"original\\n\", lcore_id);\n+\tPOWER_LOG(INFO,\n+\t\t  \"Power management of lcore %u has exited from 'userspace' mode and been set back to the original\",\n+\t\t  lcore_id);\n \texp_state = POWER_ONGOING;\n \t__atomic_compare_exchange_n(&(pi->state), &exp_state, POWER_IDLE,\n \t\t\t\t    0, __ATOMIC_RELEASE, __ATOMIC_RELAXED);\n@@ -363,18 +373,18 @@ power_acpi_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)\n \tstruct acpi_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn 0;\n \t}\n \n \tif (freqs == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"NULL buffer supplied\\n\");\n+\t\tPOWER_LOG(ERR, \"NULL buffer supplied\");\n \t\treturn 0;\n \t}\n \n \tpi = &lcore_power_info[lcore_id];\n \tif (num < pi->nb_freqs) {\n-\t\tRTE_LOG(ERR, POWER, \"Buffer size is not enough\\n\");\n+\t\tPOWER_LOG(ERR, \"Buffer size is not enough\");\n \t\treturn 0;\n \t}\n \trte_memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));\n@@ -386,7 +396,7 @@ uint32_t\n power_acpi_cpufreq_get_freq(unsigned int lcore_id)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn RTE_POWER_INVALID_FREQ_INDEX;\n \t}\n \n@@ -397,7 +407,7 @@ int\n power_acpi_cpufreq_set_freq(unsigned int lcore_id, uint32_t index)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -410,7 +420,7 @@ power_acpi_cpufreq_freq_down(unsigned int lcore_id)\n \tstruct acpi_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -428,7 +438,7 @@ power_acpi_cpufreq_freq_up(unsigned int lcore_id)\n \tstruct acpi_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -445,7 +455,7 @@ int\n power_acpi_cpufreq_freq_max(unsigned int lcore_id)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -469,7 +479,7 @@ power_acpi_cpufreq_freq_min(unsigned int lcore_id)\n \tstruct acpi_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -486,7 +496,7 @@ power_acpi_turbo_status(unsigned int lcore_id)\n \tstruct acpi_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -502,7 +512,7 @@ power_acpi_enable_turbo(unsigned int lcore_id)\n \tstruct acpi_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -512,16 +522,16 @@ power_acpi_enable_turbo(unsigned int lcore_id)\n \t\tpi->turbo_enable = 1;\n \telse {\n \t\tpi->turbo_enable = 0;\n-\t\tRTE_LOG(ERR, POWER,\n-\t\t\t\"Failed to enable turbo on lcore %u\\n\",\n+\t\tPOWER_LOG(ERR,\n+\t\t\t\"Failed to enable turbo on lcore %u\",\n \t\t\tlcore_id);\n \t\t\treturn -1;\n \t}\n \n \t/* Max may have changed, so call to max function */\n \tif (power_acpi_cpufreq_freq_max(lcore_id) < 0) {\n-\t\tRTE_LOG(ERR, POWER,\n-\t\t\t\"Failed to set frequency of lcore %u to max\\n\",\n+\t\tPOWER_LOG(ERR,\n+\t\t\t\"Failed to set frequency of lcore %u to max\",\n \t\t\tlcore_id);\n \t\t\treturn -1;\n \t}\n@@ -535,7 +545,7 @@ power_acpi_disable_turbo(unsigned int lcore_id)\n \tstruct acpi_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -546,8 +556,8 @@ power_acpi_disable_turbo(unsigned int lcore_id)\n \tif ((pi->turbo_available) && (pi->curr_idx <= 1)) {\n \t\t/* Try to set freq to max by default coming out of turbo */\n \t\tif (power_acpi_cpufreq_freq_max(lcore_id) < 0) {\n-\t\t\tRTE_LOG(ERR, POWER,\n-\t\t\t\t\"Failed to set frequency of lcore %u to max\\n\",\n+\t\t\tPOWER_LOG(ERR,\n+\t\t\t\t\"Failed to set frequency of lcore %u to max\",\n \t\t\t\tlcore_id);\n \t\t\treturn -1;\n \t\t}\n@@ -562,11 +572,11 @@ int power_acpi_get_capabilities(unsigned int lcore_id,\n \tstruct acpi_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \tif (caps == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid argument\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid argument\");\n \t\treturn -1;\n \t}\n \ndiff --git a/lib/power/power_common.c b/lib/power/power_common.c\nindex 1e09facb863f..3a374f6b8431 100644\n--- a/lib/power/power_common.c\n+++ b/lib/power/power_common.c\n@@ -161,14 +161,14 @@ power_set_governor(unsigned int lcore_id, const char *new_governor,\n \topen_core_sysfs_file(&f_governor, \"rw+\", POWER_SYSFILE_GOVERNOR,\n \t\t\tlcore_id);\n \tif (f_governor == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_GOVERNOR);\n \t\tgoto out;\n \t}\n \n \tret = read_core_sysfs_s(f_governor, buf, sizeof(buf));\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_GOVERNOR);\n \t\tgoto out;\n \t}\n@@ -188,14 +188,15 @@ power_set_governor(unsigned int lcore_id, const char *new_governor,\n \t/* Write the new governor */\n \tret = write_core_sysfs_s(f_governor, new_governor);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to write %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to write %s\",\n \t\t\t\tPOWER_SYSFILE_GOVERNOR);\n \t\tgoto out;\n \t}\n \n \tret = 0;\n-\tRTE_LOG(INFO, POWER, \"Power management governor of lcore %u has been \"\n-\t\t\t\"set to '%s' successfully\\n\", lcore_id, new_governor);\n+\tPOWER_LOG(INFO,\n+\t\t  \"Power management governor of lcore %u has been set to '%s' successfully\",\n+\t\t  lcore_id, new_governor);\n out:\n \tif (f_governor != NULL)\n \t\tfclose(f_governor);\ndiff --git a/lib/power/power_common.h b/lib/power/power_common.h\nindex c1c713927621..8e5309bbbaff 100644\n--- a/lib/power/power_common.h\n+++ b/lib/power/power_common.h\n@@ -10,10 +10,15 @@\n \n #define RTE_POWER_INVALID_FREQ_INDEX (~0)\n \n+extern int power_logtype;\n+\n+#define POWER_LOG(level, fmt, args...)\t\t\t\\\n+\trte_log(RTE_LOG_ ## level, power_logtype,\t\\\n+\t\t\"%s(): \" fmt \"\\n\", __func__, ## args)\n \n #ifdef RTE_LIBRTE_POWER_DEBUG\n #define POWER_DEBUG_TRACE(fmt, args...) \\\n-\t\tRTE_LOG(ERR, POWER, \"%s: \" fmt, __func__, ## args)\n+\tPOWER_LOG(ERR, fmt, ## args)\n #else\n #define POWER_DEBUG_TRACE(fmt, args...)\n #endif\ndiff --git a/lib/power/power_cppc_cpufreq.c b/lib/power/power_cppc_cpufreq.c\nindex fc9cffef91a8..7ffda90ce7a7 100644\n--- a/lib/power/power_cppc_cpufreq.c\n+++ b/lib/power/power_cppc_cpufreq.c\n@@ -72,8 +72,9 @@ static int\n set_freq_internal(struct cppc_power_info *pi, uint32_t idx)\n {\n \tif (idx >= RTE_MAX_LCORE_FREQS || idx >= pi->nb_freqs) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid frequency index %u, which \"\n-\t\t\t\t\"should be less than %u\\n\", idx, pi->nb_freqs);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Invalid frequency index %u, which should be less than %u\",\n+\t\t\t  idx, pi->nb_freqs);\n \t\treturn -1;\n \t}\n \n@@ -84,13 +85,15 @@ set_freq_internal(struct cppc_power_info *pi, uint32_t idx)\n \tPOWER_DEBUG_TRACE(\"Frequency[%u] %u to be set for lcore %u\\n\",\n \t\t\tidx, pi->freqs[idx], pi->lcore_id);\n \tif (fseek(pi->f, 0, SEEK_SET) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to set file position indicator to 0 \"\n-\t\t\t\"for setting frequency for lcore %u\\n\", pi->lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to set file position indicator to 0 for setting frequency for lcore %u\",\n+\t\t\t  pi->lcore_id);\n \t\treturn -1;\n \t}\n \tif (fprintf(pi->f, \"%u\", pi->freqs[idx]) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to write new frequency for \"\n-\t\t\t\t\"lcore %u\\n\", pi->lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to write new frequency for lcore %u\",\n+\t\t\t  pi->lcore_id);\n \t\treturn -1;\n \t}\n \tfflush(pi->f);\n@@ -121,7 +124,7 @@ power_check_turbo(struct cppc_power_info *pi)\n \topen_core_sysfs_file(&f_max, \"r\", POWER_SYSFILE_HIGHEST_PERF,\n \t\t\tpi->lcore_id);\n \tif (f_max == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_HIGHEST_PERF);\n \t\tgoto err;\n \t}\n@@ -129,7 +132,7 @@ power_check_turbo(struct cppc_power_info *pi)\n \topen_core_sysfs_file(&f_nom, \"r\", POWER_SYSFILE_NOMINAL_PERF,\n \t\t\tpi->lcore_id);\n \tif (f_nom == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_NOMINAL_PERF);\n \t\tgoto err;\n \t}\n@@ -137,28 +140,28 @@ power_check_turbo(struct cppc_power_info *pi)\n \topen_core_sysfs_file(&f_cmax, \"r\", POWER_SYSFILE_SYS_MAX,\n \t\t\tpi->lcore_id);\n \tif (f_cmax == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_SYS_MAX);\n \t\tgoto err;\n \t}\n \n \tret = read_core_sysfs_u32(f_max, &highest_perf);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_HIGHEST_PERF);\n \t\tgoto err;\n \t}\n \n \tret = read_core_sysfs_u32(f_nom, &nominal_perf);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_NOMINAL_PERF);\n \t\tgoto err;\n \t}\n \n \tret = read_core_sysfs_u32(f_cmax, &cpuinfo_max_freq);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_SYS_MAX);\n \t\tgoto err;\n \t}\n@@ -208,7 +211,7 @@ power_get_available_freqs(struct cppc_power_info *pi)\n \topen_core_sysfs_file(&f_max, \"r\", POWER_SYSFILE_SCALING_MAX_FREQ,\n \t\t\tpi->lcore_id);\n \tif (f_max == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_SCALING_MAX_FREQ);\n \t\tgoto out;\n \t}\n@@ -216,21 +219,21 @@ power_get_available_freqs(struct cppc_power_info *pi)\n \topen_core_sysfs_file(&f_min, \"r\", POWER_SYSFILE_SCALING_MIN_FREQ,\n \t\t\tpi->lcore_id);\n \tif (f_min == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_SCALING_MIN_FREQ);\n \t\tgoto out;\n \t}\n \n \tret = read_core_sysfs_u32(f_max, &scaling_max_freq);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_SCALING_MAX_FREQ);\n \t\tgoto out;\n \t}\n \n \tret = read_core_sysfs_u32(f_min, &scaling_min_freq);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_SCALING_MIN_FREQ);\n \t\tgoto out;\n \t}\n@@ -248,7 +251,7 @@ power_get_available_freqs(struct cppc_power_info *pi)\n \tnum_freqs = (nominal_perf - scaling_min_freq) / BUS_FREQ + 1 +\n \t\tpi->turbo_available;\n \tif (num_freqs >= RTE_MAX_LCORE_FREQS) {\n-\t\tRTE_LOG(ERR, POWER, \"Too many available frequencies: %d\\n\",\n+\t\tPOWER_LOG(ERR, \"Too many available frequencies: %d\",\n \t\t\t\tnum_freqs);\n \t\tgoto out;\n \t}\n@@ -289,14 +292,14 @@ power_init_for_setting_freq(struct cppc_power_info *pi)\n \n \topen_core_sysfs_file(&f, \"rw+\", POWER_SYSFILE_SETSPEED, pi->lcore_id);\n \tif (f == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_SETSPEED);\n \t\tgoto err;\n \t}\n \n \tret = read_core_sysfs_s(f, buf, sizeof(buf));\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_SETSPEED);\n \t\tgoto err;\n \t}\n@@ -340,7 +343,7 @@ power_cppc_cpufreq_init(unsigned int lcore_id)\n \tuint32_t exp_state;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Lcore id %u can not exceeds %u\\n\",\n+\t\tPOWER_LOG(ERR, \"Lcore id %u can not exceeds %u\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE - 1U);\n \t\treturn -1;\n \t}\n@@ -356,42 +359,46 @@ power_cppc_cpufreq_init(unsigned int lcore_id)\n \tif (!__atomic_compare_exchange_n(&(pi->state), &exp_state,\n \t\t\t\t\tPOWER_ONGOING, 0,\n \t\t\t\t\t__ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) {\n-\t\tRTE_LOG(INFO, POWER, \"Power management of lcore %u is \"\n-\t\t\t\t\"in use\\n\", lcore_id);\n+\t\tPOWER_LOG(INFO,\n+\t\t\t  \"Power management of lcore %u is in use\", lcore_id);\n \t\treturn -1;\n \t}\n \n \tpi->lcore_id = lcore_id;\n \t/* Check and set the governor */\n \tif (power_set_governor_userspace(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot set governor of lcore %u to \"\n-\t\t\t\t\"userspace\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR, \"Cannot set governor of lcore %u to userspace\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n \t/* Get the available frequencies */\n \tif (power_get_available_freqs(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot get available frequencies of \"\n-\t\t\t\t\"lcore %u\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot get available frequencies of lcore %u\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n \t/* Init for setting lcore frequency */\n \tif (power_init_for_setting_freq(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot init for setting frequency for \"\n-\t\t\t\t\"lcore %u\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot init for setting frequency for lcore %u\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n \t/* Set freq to max by default */\n \tif (power_cppc_cpufreq_freq_max(lcore_id) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot set frequency of lcore %u \"\n-\t\t\t\t\"to max\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot set frequency of lcore %u to max\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Initialized successfully for lcore %u \"\n-\t\t\t\"power management\\n\", lcore_id);\n+\tPOWER_LOG(INFO,\n+\t\t  \"Initialized successfully for lcore %u power management\",\n+\t\t  lcore_id);\n \n \t__atomic_store_n(&(pi->state), POWER_USED, __ATOMIC_RELEASE);\n \n@@ -419,7 +426,7 @@ power_cppc_cpufreq_exit(unsigned int lcore_id)\n \tuint32_t exp_state;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Lcore id %u can not exceeds %u\\n\",\n+\t\tPOWER_LOG(ERR, \"Lcore id %u can not exceeds %u\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE - 1U);\n \t\treturn -1;\n \t}\n@@ -434,8 +441,9 @@ power_cppc_cpufreq_exit(unsigned int lcore_id)\n \tif (!__atomic_compare_exchange_n(&(pi->state), &exp_state,\n \t\t\t\t\tPOWER_ONGOING, 0,\n \t\t\t\t\t__ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) {\n-\t\tRTE_LOG(INFO, POWER, \"Power management of lcore %u is \"\n-\t\t\t\t\"not used\\n\", lcore_id);\n+\t\tPOWER_LOG(INFO,\n+\t\t\t  \"Power management of lcore %u is not used\",\n+\t\t\t  lcore_id);\n \t\treturn -1;\n \t}\n \n@@ -445,14 +453,15 @@ power_cppc_cpufreq_exit(unsigned int lcore_id)\n \n \t/* Set the governor back to the original */\n \tif (power_set_governor_original(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot set the governor of %u back \"\n-\t\t\t\t\"to the original\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot set the governor of %u back to the original\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Power management of lcore %u has exited from \"\n-\t\t\t\"'userspace' mode and been set back to the \"\n-\t\t\t\"original\\n\", lcore_id);\n+\tPOWER_LOG(INFO,\n+\t\t  \"Power management of lcore %u has exited from 'userspace' mode and been set back to the original\",\n+\t\t  lcore_id);\n \t__atomic_store_n(&(pi->state), POWER_IDLE, __ATOMIC_RELEASE);\n \n \treturn 0;\n@@ -469,18 +478,18 @@ power_cppc_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)\n \tstruct cppc_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn 0;\n \t}\n \n \tif (freqs == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"NULL buffer supplied\\n\");\n+\t\tPOWER_LOG(ERR, \"NULL buffer supplied\");\n \t\treturn 0;\n \t}\n \n \tpi = &lcore_power_info[lcore_id];\n \tif (num < pi->nb_freqs) {\n-\t\tRTE_LOG(ERR, POWER, \"Buffer size is not enough\\n\");\n+\t\tPOWER_LOG(ERR, \"Buffer size is not enough\");\n \t\treturn 0;\n \t}\n \trte_memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));\n@@ -492,7 +501,7 @@ uint32_t\n power_cppc_cpufreq_get_freq(unsigned int lcore_id)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn RTE_POWER_INVALID_FREQ_INDEX;\n \t}\n \n@@ -503,7 +512,7 @@ int\n power_cppc_cpufreq_set_freq(unsigned int lcore_id, uint32_t index)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -516,7 +525,7 @@ power_cppc_cpufreq_freq_down(unsigned int lcore_id)\n \tstruct cppc_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -534,7 +543,7 @@ power_cppc_cpufreq_freq_up(unsigned int lcore_id)\n \tstruct cppc_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -551,7 +560,7 @@ int\n power_cppc_cpufreq_freq_max(unsigned int lcore_id)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -575,7 +584,7 @@ power_cppc_cpufreq_freq_min(unsigned int lcore_id)\n \tstruct cppc_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -591,7 +600,7 @@ power_cppc_turbo_status(unsigned int lcore_id)\n \tstruct cppc_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -606,7 +615,7 @@ power_cppc_enable_turbo(unsigned int lcore_id)\n \tstruct cppc_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -616,8 +625,8 @@ power_cppc_enable_turbo(unsigned int lcore_id)\n \t\tpi->turbo_enable = 1;\n \telse {\n \t\tpi->turbo_enable = 0;\n-\t\tRTE_LOG(ERR, POWER,\n-\t\t\t\"Failed to enable turbo on lcore %u\\n\",\n+\t\tPOWER_LOG(ERR,\n+\t\t\t\"Failed to enable turbo on lcore %u\",\n \t\t\tlcore_id);\n \t\treturn -1;\n \t}\n@@ -627,8 +636,8 @@ power_cppc_enable_turbo(unsigned int lcore_id)\n \t */\n \t/* Max may have changed, so call to max function */\n \tif (power_cppc_cpufreq_freq_max(lcore_id) < 0) {\n-\t\tRTE_LOG(ERR, POWER,\n-\t\t\t\"Failed to set frequency of lcore %u to max\\n\",\n+\t\tPOWER_LOG(ERR,\n+\t\t\t\"Failed to set frequency of lcore %u to max\",\n \t\t\tlcore_id);\n \t\treturn -1;\n \t}\n@@ -642,7 +651,7 @@ power_cppc_disable_turbo(unsigned int lcore_id)\n \tstruct cppc_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -653,8 +662,8 @@ power_cppc_disable_turbo(unsigned int lcore_id)\n \tif ((pi->turbo_available) && (pi->curr_idx <= 1)) {\n \t\t/* Try to set freq to max by default coming out of turbo */\n \t\tif (power_cppc_cpufreq_freq_max(lcore_id) < 0) {\n-\t\t\tRTE_LOG(ERR, POWER,\n-\t\t\t\t\"Failed to set frequency of lcore %u to max\\n\",\n+\t\t\tPOWER_LOG(ERR,\n+\t\t\t\t\"Failed to set frequency of lcore %u to max\",\n \t\t\t\tlcore_id);\n \t\t\treturn -1;\n \t\t}\n@@ -670,11 +679,11 @@ power_cppc_get_capabilities(unsigned int lcore_id,\n \tstruct cppc_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \tif (caps == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid argument\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid argument\");\n \t\treturn -1;\n \t}\n \ndiff --git a/lib/power/power_kvm_vm.c b/lib/power/power_kvm_vm.c\nindex 6a8109d44959..74a1094ffaa0 100644\n--- a/lib/power/power_kvm_vm.c\n+++ b/lib/power/power_kvm_vm.c\n@@ -8,6 +8,7 @@\n \n #include \"rte_power_guest_channel.h\"\n #include \"guest_channel.h\"\n+#include \"power_common.h\"\n #include \"power_kvm_vm.h\"\n \n #define FD_PATH \"/dev/virtio-ports/virtio.serial.port.poweragent\"\n@@ -24,7 +25,7 @@ int\n power_kvm_vm_init(unsigned int lcore_id)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Core(%u) is out of range 0...%d\\n\",\n+\t\tPOWER_LOG(ERR, \"Core(%u) is out of range 0...%d\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n \t\treturn -1;\n \t}\n@@ -45,16 +46,16 @@ power_kvm_vm_freqs(__rte_unused unsigned int lcore_id,\n \t\t__rte_unused uint32_t *freqs,\n \t\t__rte_unused uint32_t num)\n {\n-\tRTE_LOG(ERR, POWER, \"rte_power_freqs is not implemented \"\n-\t\t\t\"for Virtual Machine Power Management\\n\");\n+\tPOWER_LOG(ERR,\n+\t\t  \"not implemented for Virtual Machine Power Management\");\n \treturn -ENOTSUP;\n }\n \n uint32_t\n power_kvm_vm_get_freq(__rte_unused unsigned int lcore_id)\n {\n-\tRTE_LOG(ERR, POWER, \"rte_power_get_freq is not implemented \"\n-\t\t\t\"for Virtual Machine Power Management\\n\");\n+\tPOWER_LOG(ERR,\n+\t\t  \"not implemented for Virtual Machine Power Management\");\n \treturn -ENOTSUP;\n }\n \n@@ -62,8 +63,8 @@ int\n power_kvm_vm_set_freq(__rte_unused unsigned int lcore_id,\n \t\t__rte_unused uint32_t index)\n {\n-\tRTE_LOG(ERR, POWER, \"rte_power_set_freq is not implemented \"\n-\t\t\t\"for Virtual Machine Power Management\\n\");\n+\tPOWER_LOG(ERR,\n+\t\t  \"not implemented for Virtual Machine Power Management\");\n \treturn -ENOTSUP;\n }\n \n@@ -73,7 +74,7 @@ send_msg(unsigned int lcore_id, uint32_t scale_direction)\n \tint ret;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Core(%u) is out of range 0...%d\\n\",\n+\t\tPOWER_LOG(ERR, \"Core(%u) is out of range 0...%d\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE-1);\n \t\treturn -1;\n \t}\n@@ -81,7 +82,7 @@ send_msg(unsigned int lcore_id, uint32_t scale_direction)\n \tret = guest_channel_send_msg(&pkt[lcore_id], lcore_id);\n \tif (ret == 0)\n \t\treturn 1;\n-\tRTE_LOG(DEBUG, POWER, \"Error sending message: %s\\n\",\n+\tPOWER_LOG(DEBUG, \"Error sending message: %s\",\n \t\t\tret > 0 ? strerror(ret) : \"channel not connected\");\n \treturn -1;\n }\n@@ -113,7 +114,7 @@ power_kvm_vm_freq_min(unsigned int lcore_id)\n int\n power_kvm_vm_turbo_status(__rte_unused unsigned int lcore_id)\n {\n-\tRTE_LOG(ERR, POWER, \"rte_power_turbo_status is not implemented for Virtual Machine Power Management\\n\");\n+\tPOWER_LOG(ERR, \"rte_power_turbo_status is not implemented for Virtual Machine Power Management\");\n \treturn -ENOTSUP;\n }\n \n@@ -133,6 +134,7 @@ struct rte_power_core_capabilities;\n int power_kvm_vm_get_capabilities(__rte_unused unsigned int lcore_id,\n \t\t__rte_unused struct rte_power_core_capabilities *caps)\n {\n-\tRTE_LOG(ERR, POWER, \"rte_power_get_capabilities is not implemented for Virtual Machine Power Management\\n\");\n+\tPOWER_LOG(ERR,\n+\t\t  \"rte_power_get_capabilities is not implemented for Virtual Machine Power Management\");\n \treturn -ENOTSUP;\n }\ndiff --git a/lib/power/power_pstate_cpufreq.c b/lib/power/power_pstate_cpufreq.c\nindex 52aa64510e21..c6869bbd3c59 100644\n--- a/lib/power/power_pstate_cpufreq.c\n+++ b/lib/power/power_pstate_cpufreq.c\n@@ -81,7 +81,7 @@ power_read_turbo_pct(uint64_t *outVal)\n \tfd = open(POWER_SYSFILE_TURBO_PCT, O_RDONLY);\n \n \tif (fd < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Error opening '%s': %s\\n\", POWER_SYSFILE_TURBO_PCT,\n+\t\tPOWER_LOG(ERR, \"Error opening '%s': %s\", POWER_SYSFILE_TURBO_PCT,\n \t\t\t\t strerror(errno));\n \t\treturn fd;\n \t}\n@@ -89,7 +89,7 @@ power_read_turbo_pct(uint64_t *outVal)\n \tret = read(fd, val, sizeof(val));\n \n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Error reading '%s': %s\\n\", POWER_SYSFILE_TURBO_PCT,\n+\t\tPOWER_LOG(ERR, \"Error reading '%s': %s\", POWER_SYSFILE_TURBO_PCT,\n \t\t\t\t strerror(errno));\n \t\tgoto out;\n \t}\n@@ -97,7 +97,7 @@ power_read_turbo_pct(uint64_t *outVal)\n \terrno = 0;\n \t*outVal = (uint64_t) strtol(val, &endptr, 10);\n \tif (errno != 0 || (*endptr != 0 && *endptr != '\\n')) {\n-\t\tRTE_LOG(ERR, POWER, \"Error converting str to digits, read from %s: %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Error converting str to digits, read from %s: %s\",\n \t\t\t\t POWER_SYSFILE_TURBO_PCT, strerror(errno));\n \t\tret = -1;\n \t\tgoto out;\n@@ -125,7 +125,7 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \topen_core_sysfs_file(&f_base_max, \"r\", POWER_SYSFILE_BASE_MAX_FREQ,\n \t\t\tpi->lcore_id);\n \tif (f_base_max == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_BASE_MAX_FREQ);\n \t\tgoto err;\n \t}\n@@ -133,7 +133,7 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \topen_core_sysfs_file(&f_base_min, \"r\", POWER_SYSFILE_BASE_MIN_FREQ,\n \t\t\tpi->lcore_id);\n \tif (f_base_min == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_BASE_MIN_FREQ);\n \t\tgoto err;\n \t}\n@@ -141,7 +141,7 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \topen_core_sysfs_file(&f_min, \"rw+\", POWER_SYSFILE_MIN_FREQ,\n \t\t\tpi->lcore_id);\n \tif (f_min == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_MIN_FREQ);\n \t\tgoto err;\n \t}\n@@ -149,7 +149,7 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \topen_core_sysfs_file(&f_max, \"rw+\", POWER_SYSFILE_MAX_FREQ,\n \t\t\tpi->lcore_id);\n \tif (f_max == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_MAX_FREQ);\n \t\tgoto err;\n \t}\n@@ -161,7 +161,7 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \t/* read base max ratio */\n \tret = read_core_sysfs_u32(f_base_max, &base_max_ratio);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_BASE_MAX_FREQ);\n \t\tgoto err;\n \t}\n@@ -169,7 +169,7 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \t/* read base min ratio */\n \tret = read_core_sysfs_u32(f_base_min, &base_min_ratio);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_BASE_MIN_FREQ);\n \t\tgoto err;\n \t}\n@@ -178,7 +178,7 @@ power_init_for_setting_freq(struct pstate_power_info *pi)\n \tif (f_base != NULL) {\n \t\tret = read_core_sysfs_u32(f_base, &base_ratio);\n \t\tif (ret < 0) {\n-\t\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\t\tPOWER_SYSFILE_BASE_FREQ);\n \t\t\tgoto err;\n \t\t}\n@@ -256,8 +256,9 @@ set_freq_internal(struct pstate_power_info *pi, uint32_t idx)\n \tuint32_t target_freq = 0;\n \n \tif (idx >= RTE_MAX_LCORE_FREQS || idx >= pi->nb_freqs) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid frequency index %u, which \"\n-\t\t\t\t\"should be less than %u\\n\", idx, pi->nb_freqs);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Invalid frequency index %u, which should be less than %u\",\n+\t\t\t  idx, pi->nb_freqs);\n \t\treturn -1;\n \t}\n \n@@ -269,16 +270,16 @@ set_freq_internal(struct pstate_power_info *pi, uint32_t idx)\n \t * User need change the min/max as same value.\n \t */\n \tif (fseek(pi->f_cur_min, 0, SEEK_SET) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to set file position indicator to 0 \"\n-\t\t\t\t\"for setting frequency for lcore %u\\n\",\n-\t\t\t\tpi->lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to set file position indicator to 0 for setting frequency for lcore %u\",\n+\t\t\t  pi->lcore_id);\n \t\treturn -1;\n \t}\n \n \tif (fseek(pi->f_cur_max, 0, SEEK_SET) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to set file position indicator to 0 \"\n-\t\t\t\t\"for setting frequency for lcore %u\\n\",\n-\t\t\t\tpi->lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to set file position indicator to 0 for setting frequency for lcore %u\",\n+\t\t\t  pi->lcore_id);\n \t\treturn -1;\n \t}\n \n@@ -287,7 +288,8 @@ set_freq_internal(struct pstate_power_info *pi, uint32_t idx)\n \t\tif (pi->turbo_enable)\n \t\t\ttarget_freq = pi->sys_max_freq;\n \t\telse {\n-\t\t\tRTE_LOG(ERR, POWER, \"Turbo is off, frequency can't be scaled up more %u\\n\",\n+\t\t\tPOWER_LOG(ERR,\n+\t\t\t\t  \"Turbo is off, frequency can't be scaled up more %u\",\n \t\t\t\t\tpi->lcore_id);\n \t\t\treturn -1;\n \t\t}\n@@ -298,14 +300,16 @@ set_freq_internal(struct pstate_power_info *pi, uint32_t idx)\n \tif (idx  >  pi->curr_idx) {\n \n \t\tif (fprintf(pi->f_cur_min, \"%u\", target_freq) < 0) {\n-\t\t\tRTE_LOG(ERR, POWER, \"Fail to write new frequency for \"\n-\t\t\t\t\t\"lcore %u\\n\", pi->lcore_id);\n+\t\t\tPOWER_LOG(ERR,\n+\t\t\t\t  \"Fail to write new frequency for lcore %u\",\n+\t\t\t\t  pi->lcore_id);\n \t\t\treturn -1;\n \t\t}\n \n \t\tif (fprintf(pi->f_cur_max, \"%u\", target_freq) < 0) {\n-\t\t\tRTE_LOG(ERR, POWER, \"Fail to write new frequency for \"\n-\t\t\t\t\t\"lcore %u\\n\", pi->lcore_id);\n+\t\t\tPOWER_LOG(ERR,\n+\t\t\t\t  \"Fail to write new frequency for lcore %u\",\n+\t\t\t\t  pi->lcore_id);\n \t\t\treturn -1;\n \t\t}\n \n@@ -321,14 +325,16 @@ set_freq_internal(struct pstate_power_info *pi, uint32_t idx)\n \tif (idx  <  pi->curr_idx) {\n \n \t\tif (fprintf(pi->f_cur_max, \"%u\", target_freq) < 0) {\n-\t\t\tRTE_LOG(ERR, POWER, \"Fail to write new frequency for \"\n-\t\t\t\t\t\"lcore %u\\n\", pi->lcore_id);\n+\t\t\tPOWER_LOG(ERR,\n+\t\t\t\t  \"Fail to write new frequency for lcore %u\",\n+\t\t\t\t  pi->lcore_id);\n \t\t\treturn -1;\n \t\t}\n \n \t\tif (fprintf(pi->f_cur_min, \"%u\", target_freq) < 0) {\n-\t\t\tRTE_LOG(ERR, POWER, \"Fail to write new frequency for \"\n-\t\t\t\t\t\"lcore %u\\n\", pi->lcore_id);\n+\t\t\tPOWER_LOG(ERR,\n+\t\t\t\t  \"Fail to write new frequency for lcore %u\",\n+\t\t\t\t  pi->lcore_id);\n \t\t\treturn -1;\n \t\t}\n \n@@ -383,7 +389,7 @@ power_get_available_freqs(struct pstate_power_info *pi)\n \topen_core_sysfs_file(&f_max, \"r\", POWER_SYSFILE_BASE_MAX_FREQ,\n \t\t\tpi->lcore_id);\n \tif (f_max == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_BASE_MAX_FREQ);\n \t\tgoto out;\n \t}\n@@ -391,7 +397,7 @@ power_get_available_freqs(struct pstate_power_info *pi)\n \topen_core_sysfs_file(&f_min, \"r\", POWER_SYSFILE_BASE_MIN_FREQ,\n \t\t\tpi->lcore_id);\n \tif (f_min == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_BASE_MIN_FREQ);\n \t\tgoto out;\n \t}\n@@ -399,14 +405,14 @@ power_get_available_freqs(struct pstate_power_info *pi)\n \t/* read base ratios */\n \tret = read_core_sysfs_u32(f_max, &sys_max_freq);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_BASE_MAX_FREQ);\n \t\tgoto out;\n \t}\n \n \tret = read_core_sysfs_u32(f_min, &sys_min_freq);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_BASE_MIN_FREQ);\n \t\tgoto out;\n \t}\n@@ -449,7 +455,7 @@ power_get_available_freqs(struct pstate_power_info *pi)\n \tnum_freqs = (RTE_MIN(base_max_freq, sys_max_freq) - sys_min_freq) / BUS_FREQ\n \t\t\t+ 1 + pi->turbo_available;\n \tif (num_freqs >= RTE_MAX_LCORE_FREQS) {\n-\t\tRTE_LOG(ERR, POWER, \"Too many available frequencies: %d\\n\",\n+\t\tPOWER_LOG(ERR, \"Too many available frequencies: %d\",\n \t\t\t\tnum_freqs);\n \t\tgoto out;\n \t}\n@@ -493,14 +499,14 @@ power_get_cur_idx(struct pstate_power_info *pi)\n \topen_core_sysfs_file(&f_cur, \"r\", POWER_SYSFILE_CUR_FREQ,\n \t\t\tpi->lcore_id);\n \tif (f_cur == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(ERR, \"failed to open %s\",\n \t\t\t\tPOWER_SYSFILE_CUR_FREQ);\n \t\tgoto fail;\n \t}\n \n \tret = read_core_sysfs_u32(f_cur, &sys_cur_freq);\n \tif (ret < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(ERR, \"Failed to read %s\",\n \t\t\t\tPOWER_SYSFILE_CUR_FREQ);\n \t\tgoto fail;\n \t}\n@@ -542,7 +548,7 @@ power_pstate_cpufreq_init(unsigned int lcore_id)\n \tuint32_t exp_state;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Lcore id %u can not exceed %u\\n\",\n+\t\tPOWER_LOG(ERR, \"Lcore id %u can not exceed %u\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE - 1U);\n \t\treturn -1;\n \t}\n@@ -558,47 +564,52 @@ power_pstate_cpufreq_init(unsigned int lcore_id)\n \tif (!__atomic_compare_exchange_n(&(pi->state), &exp_state,\n \t\t\t\t\tPOWER_ONGOING, 0,\n \t\t\t\t\t__ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) {\n-\t\tRTE_LOG(INFO, POWER, \"Power management of lcore %u is \"\n-\t\t\t\t\"in use\\n\", lcore_id);\n+\t\tPOWER_LOG(INFO,\n+\t\t\t  \"Power management of lcore %u is in use\", lcore_id);\n \t\treturn -1;\n \t}\n \n \tpi->lcore_id = lcore_id;\n \t/* Check and set the governor */\n \tif (power_set_governor_performance(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot set governor of lcore %u to \"\n-\t\t\t\t\"performance\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot set governor of lcore %u to performance\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \t/* Init for setting lcore frequency */\n \tif (power_init_for_setting_freq(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot init for setting frequency for \"\n-\t\t\t\t\"lcore %u\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot init for setting frequency for lcore %u\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n \t/* Get the available frequencies */\n \tif (power_get_available_freqs(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot get available frequencies of \"\n-\t\t\t\t\"lcore %u\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot get available frequencies of lcore %u\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n \tif (power_get_cur_idx(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot get current frequency \"\n-\t\t\t\t\"index of lcore %u\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot get current frequency index of lcore %u\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n \t/* Set freq to max by default */\n \tif (power_pstate_cpufreq_freq_max(lcore_id) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot set frequency of lcore %u \"\n-\t\t\t\t\"to max\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot set frequency of lcore %u to max\", lcore_id);\n \t\tgoto fail;\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Initialized successfully for lcore %u \"\n-\t\t\t\"power management\\n\", lcore_id);\n+\tPOWER_LOG(INFO,\n+\t\t  \"Initialized successfully for lcore %u power management\",\n+\t\t  lcore_id);\n \texp_state = POWER_ONGOING;\n \t__atomic_compare_exchange_n(&(pi->state), &exp_state, POWER_USED,\n \t\t\t\t    0, __ATOMIC_RELEASE, __ATOMIC_RELAXED);\n@@ -620,7 +631,7 @@ power_pstate_cpufreq_exit(unsigned int lcore_id)\n \tuint32_t exp_state;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Lcore id %u can not exceeds %u\\n\",\n+\t\tPOWER_LOG(ERR, \"Lcore id %u can not exceeds %u\",\n \t\t\t\tlcore_id, RTE_MAX_LCORE - 1U);\n \t\treturn -1;\n \t}\n@@ -636,8 +647,8 @@ power_pstate_cpufreq_exit(unsigned int lcore_id)\n \tif (!__atomic_compare_exchange_n(&(pi->state), &exp_state,\n \t\t\t\t\tPOWER_ONGOING, 0,\n \t\t\t\t\t__ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) {\n-\t\tRTE_LOG(INFO, POWER, \"Power management of lcore %u is \"\n-\t\t\t\t\"not used\\n\", lcore_id);\n+\t\tPOWER_LOG(INFO,\n+\t\t\t  \"Power management of lcore %u is not used\", lcore_id);\n \t\treturn -1;\n \t}\n \n@@ -649,14 +660,15 @@ power_pstate_cpufreq_exit(unsigned int lcore_id)\n \n \t/* Set the governor back to the original */\n \tif (power_set_governor_original(pi) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Cannot set the governor of %u back \"\n-\t\t\t\t\"to the original\\n\", lcore_id);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Cannot set the governor of %u back to the original\",\n+\t\t\t  lcore_id);\n \t\tgoto fail;\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Power management of lcore %u has exited from \"\n-\t\t\t\"'performance' mode and been set back to the \"\n-\t\t\t\"original\\n\", lcore_id);\n+\tPOWER_LOG(INFO,\n+\t\t  \"Power management of lcore %u has exited from 'performance' mode and been set back to the original\",\n+\t\t  lcore_id);\n \texp_state = POWER_ONGOING;\n \t__atomic_compare_exchange_n(&(pi->state), &exp_state, POWER_IDLE,\n \t\t\t\t    0, __ATOMIC_RELEASE, __ATOMIC_RELAXED);\n@@ -678,18 +690,18 @@ power_pstate_cpufreq_freqs(unsigned int lcore_id, uint32_t *freqs, uint32_t num)\n \tstruct pstate_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn 0;\n \t}\n \n \tif (freqs == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"NULL buffer supplied\\n\");\n+\t\tPOWER_LOG(ERR, \"NULL buffer supplied\");\n \t\treturn 0;\n \t}\n \n \tpi = &lcore_power_info[lcore_id];\n \tif (num < pi->nb_freqs) {\n-\t\tRTE_LOG(ERR, POWER, \"Buffer size is not enough\\n\");\n+\t\tPOWER_LOG(ERR, \"Buffer size is not enough\");\n \t\treturn 0;\n \t}\n \trte_memcpy(freqs, pi->freqs, pi->nb_freqs * sizeof(uint32_t));\n@@ -701,7 +713,7 @@ uint32_t\n power_pstate_cpufreq_get_freq(unsigned int lcore_id)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn RTE_POWER_INVALID_FREQ_INDEX;\n \t}\n \n@@ -713,7 +725,7 @@ int\n power_pstate_cpufreq_set_freq(unsigned int lcore_id, uint32_t index)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -726,7 +738,7 @@ power_pstate_cpufreq_freq_up(unsigned int lcore_id)\n \tstruct pstate_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -745,7 +757,7 @@ power_pstate_cpufreq_freq_down(unsigned int lcore_id)\n \tstruct pstate_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -761,7 +773,7 @@ int\n power_pstate_cpufreq_freq_max(unsigned int lcore_id)\n {\n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -786,7 +798,7 @@ power_pstate_cpufreq_freq_min(unsigned int lcore_id)\n \tstruct pstate_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -803,7 +815,7 @@ power_pstate_turbo_status(unsigned int lcore_id)\n \tstruct pstate_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -818,7 +830,7 @@ power_pstate_enable_turbo(unsigned int lcore_id)\n \tstruct pstate_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -828,10 +840,10 @@ power_pstate_enable_turbo(unsigned int lcore_id)\n \t\tpi->turbo_enable = 1;\n \telse {\n \t\tpi->turbo_enable = 0;\n-\t\tRTE_LOG(ERR, POWER,\n-\t\t\t\"Failed to enable turbo on lcore %u\\n\",\n-\t\t\tlcore_id);\n-\t\t\treturn -1;\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Failed to enable turbo on lcore %u\",\n+\t\t\t  lcore_id);\n+\t\treturn -1;\n \t}\n \n \treturn 0;\n@@ -844,7 +856,7 @@ power_pstate_disable_turbo(unsigned int lcore_id)\n \tstruct pstate_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \n@@ -855,8 +867,8 @@ power_pstate_disable_turbo(unsigned int lcore_id)\n \tif (pi->turbo_available && pi->curr_idx <= 1) {\n \t\t/* Try to set freq to max by default coming out of turbo */\n \t\tif (power_pstate_cpufreq_freq_max(lcore_id) < 0) {\n-\t\t\tRTE_LOG(ERR, POWER,\n-\t\t\t\t\"Failed to set frequency of lcore %u to max\\n\",\n+\t\t\tPOWER_LOG(ERR,\n+\t\t\t\t\"Failed to set frequency of lcore %u to max\",\n \t\t\t\tlcore_id);\n \t\t\treturn -1;\n \t\t}\n@@ -872,11 +884,11 @@ int power_pstate_get_capabilities(unsigned int lcore_id,\n \tstruct pstate_power_info *pi;\n \n \tif (lcore_id >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID\");\n \t\treturn -1;\n \t}\n \tif (caps == NULL) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid argument\\n\");\n+\t\tPOWER_LOG(ERR, \"Invalid argument\");\n \t\treturn -1;\n \t}\n \ndiff --git a/lib/power/rte_power.c b/lib/power/rte_power.c\nindex 63a43bd8f5ae..23a97fa77f53 100644\n--- a/lib/power/rte_power.c\n+++ b/lib/power/rte_power.c\n@@ -10,6 +10,7 @@\n #include \"rte_power.h\"\n #include \"power_acpi_cpufreq.h\"\n #include \"power_cppc_cpufreq.h\"\n+#include \"power_common.h\"\n #include \"power_kvm_vm.h\"\n #include \"power_pstate_cpufreq.h\"\n \n@@ -70,7 +71,7 @@ rte_power_set_env(enum power_management_env env)\n \trte_spinlock_lock(&global_env_cfg_lock);\n \n \tif (global_default_env != PM_ENV_NOT_SET) {\n-\t\tRTE_LOG(ERR, POWER, \"Power Management Environment already set.\\n\");\n+\t\tPOWER_LOG(ERR, \"Power Management Environment already set.\");\n \t\trte_spinlock_unlock(&global_env_cfg_lock);\n \t\treturn -1;\n \t}\n@@ -127,7 +128,7 @@ rte_power_set_env(enum power_management_env env)\n \t\trte_power_freq_disable_turbo = power_cppc_disable_turbo;\n \t\trte_power_get_capabilities = power_cppc_get_capabilities;\n \t} else {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid Power Management Environment(%d) set\\n\",\n+\t\tPOWER_LOG(ERR, \"Invalid Power Management Environment(%d) set\",\n \t\t\t\tenv);\n \t\tret = -1;\n \t}\n@@ -172,39 +173,40 @@ rte_power_init(unsigned int lcore_id)\n \tcase PM_ENV_CPPC_CPUFREQ:\n \t\treturn power_cppc_cpufreq_init(lcore_id);\n \tdefault:\n-\t\tRTE_LOG(INFO, POWER, \"Env isn't set yet!\\n\");\n+\t\tPOWER_LOG(INFO, \"Env isn't set yet!\");\n \t}\n \n \t/* Auto detect Environment */\n-\tRTE_LOG(INFO, POWER, \"Attempting to initialise ACPI cpufreq power management...\\n\");\n+\tPOWER_LOG(INFO, \"Attempting to initialise ACPI cpufreq power management...\");\n \tret = power_acpi_cpufreq_init(lcore_id);\n \tif (ret == 0) {\n \t\trte_power_set_env(PM_ENV_ACPI_CPUFREQ);\n \t\tgoto out;\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Attempting to initialise PSTAT power management...\\n\");\n+\tPOWER_LOG(INFO, \"Attempting to initialise PSTAT power management...\");\n \tret = power_pstate_cpufreq_init(lcore_id);\n \tif (ret == 0) {\n \t\trte_power_set_env(PM_ENV_PSTATE_CPUFREQ);\n \t\tgoto out;\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Attempting to initialise CPPC power management...\\n\");\n+\tPOWER_LOG(INFO, \"Attempting to initialise CPPC power management...\");\n \tret = power_cppc_cpufreq_init(lcore_id);\n \tif (ret == 0) {\n \t\trte_power_set_env(PM_ENV_CPPC_CPUFREQ);\n \t\tgoto out;\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Attempting to initialise VM power management...\\n\");\n+\tPOWER_LOG(INFO, \"Attempting to initialise VM power management...\");\n \tret = power_kvm_vm_init(lcore_id);\n \tif (ret == 0) {\n \t\trte_power_set_env(PM_ENV_KVM_VM);\n \t\tgoto out;\n \t}\n-\tRTE_LOG(ERR, POWER, \"Unable to set Power Management Environment for lcore \"\n-\t\t\t\"%u\\n\", lcore_id);\n+\tPOWER_LOG(ERR,\n+\t\t  \"Unable to set Power Management Environment for lcore %u\",\n+\t\t  lcore_id);\n out:\n \treturn ret;\n }\n@@ -222,9 +224,12 @@ rte_power_exit(unsigned int lcore_id)\n \tcase PM_ENV_CPPC_CPUFREQ:\n \t\treturn power_cppc_cpufreq_exit(lcore_id);\n \tdefault:\n-\t\tRTE_LOG(ERR, POWER, \"Environment has not been set, unable to exit gracefully\\n\");\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Environment has not been set, unable to exit gracefully\");\n \n \t}\n \treturn -1;\n \n }\n+\n+RTE_LOG_REGISTER_DEFAULT(power_logtype, INFO);\ndiff --git a/lib/power/rte_power_empty_poll.c b/lib/power/rte_power_empty_poll.c\nindex 4a4db512474e..da4b1ec3068a 100644\n--- a/lib/power/rte_power_empty_poll.c\n+++ b/lib/power/rte_power_empty_poll.c\n@@ -10,6 +10,7 @@\n \n #include \"rte_power.h\"\n #include \"rte_power_empty_poll.h\"\n+#include \"power_common.h\"\n \n #define INTERVALS_PER_SECOND 100     /* (10ms) */\n #define SECONDS_TO_TRAIN_FOR 2\n@@ -75,7 +76,7 @@ enter_normal_state(struct priority_worker *poll_stats)\n \tpoll_stats->iter_counter = 0;\n \tpoll_stats->threshold_ctr = 0;\n \tpoll_stats->queue_state = MED_NORMAL;\n-\tRTE_LOG(INFO, POWER, \"Set the power freq to MED\\n\");\n+\tPOWER_LOG(INFO, \"Set the power freq to MED\");\n \tset_power_freq(poll_stats->lcore_id, MED, false);\n \n \tpoll_stats->thresh[MED].threshold_percent = med_to_high_threshold;\n@@ -213,11 +214,9 @@ update_stats(struct priority_worker *poll_stats)\n \tif (s->thresh[s->cur_freq].base_edpi < cur_edpi) {\n \n \t\t/* edpi mean empty poll counter difference per interval */\n-\t\tRTE_LOG(DEBUG, POWER, \"cur_edpi is too large \"\n-\t\t\t\t\"cur edpi %\"PRId64\" \"\n-\t\t\t\t\"base edpi %\"PRId64\"\\n\",\n-\t\t\t\tcur_edpi,\n-\t\t\t\ts->thresh[s->cur_freq].base_edpi);\n+\t\tPOWER_LOG(DEBUG,\n+\t\t\t  \"cur_edpi is too large cur edpi %\"PRId64\" base edpi %\"PRId64,\n+\t\t\t  cur_edpi, s->thresh[s->cur_freq].base_edpi);\n \t\t/* Value to make us fail need debug log*/\n \t\treturn 1000UL;\n \t}\n@@ -247,7 +246,7 @@ update_stats_normal(struct priority_worker *poll_stats)\n \t\tenum freq_val cur_freq = poll_stats->cur_freq;\n \n \t\t/* edpi mean empty poll counter difference per interval */\n-\t\tRTE_LOG(DEBUG, POWER, \"cure freq is %d, edpi is %\"PRIu64\"\\n\",\n+\t\tPOWER_LOG(DEBUG, \"cure freq is %d, edpi is %\"PRIu64\"\",\n \t\t\t\tcur_freq,\n \t\t\t\tpoll_stats->thresh[cur_freq].base_edpi);\n \t\treturn;\n@@ -257,12 +256,12 @@ update_stats_normal(struct priority_worker *poll_stats)\n \n \tif (percent > 100) {\n \t\t/* edpi mean empty poll counter difference per interval */\n-\t\tRTE_LOG(DEBUG, POWER, \"Edpi is bigger than threshold\\n\");\n+\t\tPOWER_LOG(DEBUG, \"Edpi is bigger than threshold\");\n \t\treturn;\n \t}\n \n \tif (poll_stats->cur_freq == LOW)\n-\t\tRTE_LOG(INFO, POWER, \"Purge Mode is not currently supported\\n\");\n+\t\tPOWER_LOG(INFO, \"Purge Mode is not currently supported\");\n \telse if (poll_stats->cur_freq == MED) {\n \n \t\tif (percent >\n@@ -272,7 +271,7 @@ update_stats_normal(struct priority_worker *poll_stats)\n \t\t\t\tpoll_stats->threshold_ctr++;\n \t\t\telse {\n \t\t\t\tset_state(poll_stats, HGH_BUSY);\n-\t\t\t\tRTE_LOG(INFO, POWER, \"MOVE to HGH\\n\");\n+\t\t\t\tPOWER_LOG(INFO, \"MOVE to HGH\");\n \t\t\t}\n \n \t\t} else {\n@@ -289,7 +288,7 @@ update_stats_normal(struct priority_worker *poll_stats)\n \t\t\t\tpoll_stats->threshold_ctr++;\n \t\t\telse {\n \t\t\t\tset_state(poll_stats, MED_NORMAL);\n-\t\t\t\tRTE_LOG(INFO, POWER, \"MOVE to MED\\n\");\n+\t\t\t\tPOWER_LOG(INFO, \"MOVE to MED\");\n \t\t\t}\n \t\t} else {\n \t\t\t/* reset */\n@@ -332,17 +331,17 @@ empty_poll_training(struct priority_worker *poll_stats,\n \n \t\tset_state(poll_stats, MED_NORMAL);\n \n-\t\tRTE_LOG(INFO, POWER, \"LOW threshold is %\"PRIu64\"\\n\",\n+\t\tPOWER_LOG(INFO, \"LOW threshold is %\"PRIu64\"\",\n \t\t\t\tpoll_stats->thresh[LOW].base_edpi);\n \n-\t\tRTE_LOG(INFO, POWER, \"MED threshold is %\"PRIu64\"\\n\",\n+\t\tPOWER_LOG(INFO, \"MED threshold is %\"PRIu64\"\",\n \t\t\t\tpoll_stats->thresh[MED].base_edpi);\n \n \n-\t\tRTE_LOG(INFO, POWER, \"HIGH threshold is %\"PRIu64\"\\n\",\n+\t\tPOWER_LOG(INFO, \"HIGH threshold is %\"PRIu64\"\",\n \t\t\t\tpoll_stats->thresh[HGH].base_edpi);\n \n-\t\tRTE_LOG(INFO, POWER, \"Training is Complete for %d\\n\",\n+\t\tPOWER_LOG(INFO, \"Training is Complete for %d\",\n \t\t\t\tpoll_stats->lcore_id);\n \t}\n \n@@ -414,7 +413,7 @@ rte_power_empty_poll_stat_init(struct ep_params **eptr, uint8_t *freq_tlb,\n \t\tfreq_index[HGH] = freq_tlb[HGH];\n \t}\n \n-\tRTE_LOG(INFO, POWER, \"Initialize the Empty Poll\\n\");\n+\tPOWER_LOG(INFO, \"Initialize the Empty Poll\");\n \n \t/* Train for pre-defined period */\n \tep_params->max_train_iter = INTERVALS_PER_SECOND * SECONDS_TO_TRAIN_FOR;\n@@ -433,7 +432,7 @@ rte_power_empty_poll_stat_init(struct ep_params **eptr, uint8_t *freq_tlb,\n \t\t\t\tavail_freqs[i],\n \t\t\t\tNUM_FREQS);\n \n-\t\tRTE_LOG(INFO, POWER, \"total avail freq is %d , lcoreid %d\\n\",\n+\t\tPOWER_LOG(INFO, \"total avail freq is %d , lcoreid %d\",\n \t\t\t\ttotal_avail_freqs[i],\n \t\t\t\ti);\n \n@@ -452,8 +451,7 @@ rte_power_empty_poll_stat_init(struct ep_params **eptr, uint8_t *freq_tlb,\n void\n rte_power_empty_poll_stat_free(void)\n {\n-\n-\tRTE_LOG(INFO, POWER, \"Close the Empty Poll\\n\");\n+\tPOWER_LOG(INFO, \"Close the Empty Poll\");\n \n \trte_free(ep_params);\n }\ndiff --git a/lib/power/rte_power_intel_uncore.c b/lib/power/rte_power_intel_uncore.c\nindex 3b8724385fb7..ee6412a3ed34 100644\n--- a/lib/power/rte_power_intel_uncore.c\n+++ b/lib/power/rte_power_intel_uncore.c\n@@ -52,8 +52,9 @@ set_uncore_freq_internal(struct uncore_power_info *ui, uint32_t idx)\n \tint ret;\n \n \tif (idx >= MAX_UNCORE_FREQS || idx >= ui->nb_freqs) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Invalid uncore frequency index %u, which \"\n-\t\t\t\t\"should be less than %u\\n\", idx, ui->nb_freqs);\n+\t\tPOWER_LOG(DEBUG,\n+\t\t\t  \"Invalid uncore frequency index %u, which should be less than %u\",\n+\t\t\t  idx, ui->nb_freqs);\n \t\treturn -1;\n \t}\n \n@@ -65,13 +66,13 @@ set_uncore_freq_internal(struct uncore_power_info *ui, uint32_t idx)\n \topen_core_sysfs_file(&ui->f_cur_max, \"rw+\", POWER_INTEL_UNCORE_SYSFILE_MAX_FREQ,\n \t\t\tui->pkg, ui->die);\n \tif (ui->f_cur_max == NULL) {\n-\t\tRTE_LOG(DEBUG, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(DEBUG, \"failed to open %s\",\n \t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_MAX_FREQ);\n \t\treturn -1;\n \t}\n \tret = read_core_sysfs_u32(ui->f_cur_max, &curr_max_freq);\n \tif (ret < 0) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(DEBUG, \"Failed to read %s\",\n \t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_MAX_FREQ);\n \t\tfclose(ui->f_cur_max);\n \t\treturn -1;\n@@ -79,14 +80,16 @@ set_uncore_freq_internal(struct uncore_power_info *ui, uint32_t idx)\n \n \t/* check this value first before fprintf value to f_cur_max, so value isn't overwritten */\n \tif (fprintf(ui->f_cur_min, \"%u\", target_uncore_freq) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to write new uncore frequency for \"\n-\t\t\t\t\"pkg %02u die %02u\\n\", ui->pkg, ui->die);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to write new uncore frequency for pkg %02u die %02u\",\n+\t\t\t  ui->pkg, ui->die);\n \t\treturn -1;\n \t}\n \n \tif (fprintf(ui->f_cur_max, \"%u\", target_uncore_freq) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to write new uncore frequency for \"\n-\t\t\t\t\"pkg %02u die %02u\\n\", ui->pkg, ui->die);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to write new uncore frequency for pkg %02u die %02u\",\n+\t\t\t  ui->pkg, ui->die);\n \t\treturn -1;\n \t}\n \n@@ -121,13 +124,13 @@ power_init_for_setting_uncore_freq(struct uncore_power_info *ui)\n \topen_core_sysfs_file(&f_base_max, \"r\", POWER_INTEL_UNCORE_SYSFILE_BASE_MAX_FREQ,\n \t\t\tui->pkg, ui->die);\n \tif (f_base_max == NULL) {\n-\t\tRTE_LOG(DEBUG, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(DEBUG, \"failed to open %s\",\n \t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_BASE_MAX_FREQ);\n \t\tgoto err;\n \t}\n \tret = read_core_sysfs_u32(f_base_max, &base_max_freq);\n \tif (ret < 0) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Failed to read %s\\n\",\n+\t\tPOWER_LOG(DEBUG, \"Failed to read %s\",\n \t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_BASE_MAX_FREQ);\n \t\tgoto err;\n \t}\n@@ -136,14 +139,14 @@ power_init_for_setting_uncore_freq(struct uncore_power_info *ui)\n \topen_core_sysfs_file(&f_base_min, \"r\", POWER_INTEL_UNCORE_SYSFILE_BASE_MIN_FREQ,\n \t\tui->pkg, ui->die);\n \tif (f_base_min == NULL) {\n-\t\tRTE_LOG(DEBUG, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(DEBUG, \"failed to open %s\",\n \t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_BASE_MIN_FREQ);\n \t\tgoto err;\n \t}\n \tif (f_base_min != NULL) {\n \t\tret = read_core_sysfs_u32(f_base_min, &base_min_freq);\n \t\tif (ret < 0) {\n-\t\t\tRTE_LOG(DEBUG, POWER, \"Failed to read %s\\n\",\n+\t\t\tPOWER_LOG(DEBUG, \"Failed to read %s\",\n \t\t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_BASE_MIN_FREQ);\n \t\t\tgoto err;\n \t\t}\n@@ -153,14 +156,14 @@ power_init_for_setting_uncore_freq(struct uncore_power_info *ui)\n \topen_core_sysfs_file(&f_min, \"rw+\", POWER_INTEL_UNCORE_SYSFILE_MIN_FREQ,\n \t\t\tui->pkg, ui->die);\n \tif (f_min == NULL) {\n-\t\tRTE_LOG(DEBUG, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(DEBUG, \"failed to open %s\",\n \t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_MIN_FREQ);\n \t\tgoto err;\n \t}\n \tif (f_min != NULL) {\n \t\tret = read_core_sysfs_u32(f_min, &min_freq);\n \t\tif (ret < 0) {\n-\t\t\tRTE_LOG(DEBUG, POWER, \"Failed to read %s\\n\",\n+\t\t\tPOWER_LOG(DEBUG, \"Failed to read %s\",\n \t\t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_MIN_FREQ);\n \t\t\tgoto err;\n \t\t}\n@@ -170,14 +173,14 @@ power_init_for_setting_uncore_freq(struct uncore_power_info *ui)\n \topen_core_sysfs_file(&f_max, \"rw+\", POWER_INTEL_UNCORE_SYSFILE_MAX_FREQ,\n \t\t\tui->pkg, ui->die);\n \tif (f_max == NULL) {\n-\t\tRTE_LOG(DEBUG, POWER, \"failed to open %s\\n\",\n+\t\tPOWER_LOG(DEBUG, \"failed to open %s\",\n \t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_MAX_FREQ);\n \t\tgoto err;\n \t}\n \tif (f_max != NULL) {\n \t\tret = read_core_sysfs_u32(f_max, &max_freq);\n \t\tif (ret < 0) {\n-\t\t\tRTE_LOG(DEBUG, POWER, \"Failed to read %s\\n\",\n+\t\t\tPOWER_LOG(DEBUG, \"Failed to read %s\",\n \t\t\t\t\tPOWER_INTEL_UNCORE_SYSFILE_MAX_FREQ);\n \t\t\tgoto err;\n \t\t}\n@@ -222,7 +225,7 @@ power_get_available_uncore_freqs(struct uncore_power_info *ui)\n \n \tnum_uncore_freqs = (ui->init_max_freq - ui->init_min_freq) / BUS_FREQ + 1;\n \tif (num_uncore_freqs >= MAX_UNCORE_FREQS) {\n-\t\tRTE_LOG(ERR, POWER, \"Too many available uncore frequencies: %d\\n\",\n+\t\tPOWER_LOG(ERR, \"Too many available uncore frequencies: %d\",\n \t\t\t\tnum_uncore_freqs);\n \t\tgoto out;\n \t}\n@@ -250,7 +253,7 @@ check_pkg_die_values(unsigned int pkg, unsigned int die)\n \tif (max_pkgs == 0)\n \t\treturn -1;\n \tif (pkg >= max_pkgs) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Package number %02u can not exceed %u\\n\",\n+\t\tPOWER_LOG(DEBUG, \"Package number %02u can not exceed %u\",\n \t\t\t\tpkg, max_pkgs);\n \t\treturn -1;\n \t}\n@@ -259,7 +262,7 @@ check_pkg_die_values(unsigned int pkg, unsigned int die)\n \tif (max_dies == 0)\n \t\treturn -1;\n \tif (die >= max_dies) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Die number %02u can not exceed %u\\n\",\n+\t\tPOWER_LOG(DEBUG, \"Die number %02u can not exceed %u\",\n \t\t\t\tdie, max_dies);\n \t\treturn -1;\n \t}\n@@ -282,15 +285,17 @@ rte_power_uncore_init(unsigned int pkg, unsigned int die)\n \n \t/* Init for setting uncore die frequency */\n \tif (power_init_for_setting_uncore_freq(ui) < 0) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Cannot init for setting uncore frequency for \"\n-\t\t\t\t\"pkg %02u die %02u\\n\", pkg, die);\n+\t\tPOWER_LOG(DEBUG,\n+\t\t\t  \"Cannot init for setting uncore frequency for pkg %02u die %02u\",\n+\t\t\t  pkg, die);\n \t\treturn -1;\n \t}\n \n \t/* Get the available frequencies */\n \tif (power_get_available_uncore_freqs(ui) < 0) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Cannot get available uncore frequencies of \"\n-\t\t\t\t\"pkg %02u die %02u\\n\", pkg, die);\n+\t\tPOWER_LOG(DEBUG,\n+\t\t\t  \"Cannot get available uncore frequencies of pkg %02u die %02u\",\n+\t\t\t  pkg, die);\n \t\treturn -1;\n \t}\n \n@@ -309,14 +314,16 @@ rte_power_uncore_exit(unsigned int pkg, unsigned int die)\n \tui = &uncore_info[pkg][die];\n \n \tif (fprintf(ui->f_cur_min, \"%u\", ui->org_min_freq) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to write original uncore frequency for \"\n-\t\t\t\t\"pkg %02u die %02u\\n\", ui->pkg, ui->die);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to write original uncore frequency for pkg %02u die %02u\",\n+\t\t\t  ui->pkg, ui->die);\n \t\treturn -1;\n \t}\n \n \tif (fprintf(ui->f_cur_max, \"%u\", ui->org_max_freq) < 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Fail to write original uncore frequency for \"\n-\t\t\t\t\"pkg %02u die %02u\\n\", ui->pkg, ui->die);\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Fail to write original uncore frequency for pkg %02u die %02u\",\n+\t\t\t  ui->pkg, ui->die);\n \t\treturn -1;\n \t}\n \n@@ -395,10 +402,8 @@ rte_power_uncore_get_num_pkgs(void)\n \n \td = opendir(INTEL_UNCORE_FREQUENCY_DIR);\n \tif (d == NULL) {\n-\t\tRTE_LOG(ERR, POWER,\n-\t\t\"Uncore frequency management not supported/enabled on this kernel. \"\n-\t\t\"Please enable CONFIG_INTEL_UNCORE_FREQ_CONTROL if on x86 with linux kernel\"\n-\t\t\" >= 5.6\\n\");\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Uncore frequency management not supported/enabled on this kernel\");\n \t\treturn 0;\n \t}\n \n@@ -427,16 +432,14 @@ rte_power_uncore_get_num_dies(unsigned int pkg)\n \tif (max_pkgs == 0)\n \t\treturn 0;\n \tif (pkg >= max_pkgs) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Invalid package number\\n\");\n+\t\tPOWER_LOG(DEBUG, \"Invalid package number\");\n \t\treturn 0;\n \t}\n \n \td = opendir(INTEL_UNCORE_FREQUENCY_DIR);\n \tif (d == NULL) {\n-\t\tRTE_LOG(ERR, POWER,\n-\t\t\"Uncore frequency management not supported/enabled on this kernel. \"\n-\t\t\"Please enable CONFIG_INTEL_UNCORE_FREQ_CONTROL if on x86 with linux kernel\"\n-\t\t\" >= 5.6\\n\");\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Uncore frequency management not supported/enabled on this kernel\");\n \t\treturn 0;\n \t}\n \ndiff --git a/lib/power/rte_power_pmd_mgmt.c b/lib/power/rte_power_pmd_mgmt.c\nindex ca1840387c74..e691e754ccb0 100644\n--- a/lib/power/rte_power_pmd_mgmt.c\n+++ b/lib/power/rte_power_pmd_mgmt.c\n@@ -146,7 +146,7 @@ get_monitor_addresses(struct pmd_core_cfg *cfg,\n \n \t\t/* attempted out of bounds access */\n \t\tif (i >= len) {\n-\t\t\tRTE_LOG(ERR, POWER, \"Too many queues being monitored\\n\");\n+\t\t\tPOWER_LOG(ERR, \"Too many queues being monitored\");\n \t\t\treturn -1;\n \t\t}\n \n@@ -422,7 +422,7 @@ check_scale(unsigned int lcore)\n \t/* only PSTATE and ACPI modes are supported */\n \tif (!rte_power_check_env_supported(PM_ENV_ACPI_CPUFREQ) &&\n \t    !rte_power_check_env_supported(PM_ENV_PSTATE_CPUFREQ)) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Neither ACPI nor PSTATE modes are supported\\n\");\n+\t\tPOWER_LOG(DEBUG, \"Neither ACPI nor PSTATE modes are supported\");\n \t\treturn -ENOTSUP;\n \t}\n \t/* ensure we could initialize the power library */\n@@ -432,7 +432,7 @@ check_scale(unsigned int lcore)\n \t/* ensure we initialized the correct env */\n \tenv = rte_power_get_env();\n \tif (env != PM_ENV_ACPI_CPUFREQ && env != PM_ENV_PSTATE_CPUFREQ) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Neither ACPI nor PSTATE modes were initialized\\n\");\n+\t\tPOWER_LOG(DEBUG, \"Neither ACPI nor PSTATE modes were initialized\");\n \t\treturn -ENOTSUP;\n \t}\n \n@@ -448,7 +448,7 @@ check_monitor(struct pmd_core_cfg *cfg, const union queue *qdata)\n \n \t/* check if rte_power_monitor is supported */\n \tif (!global_data.intrinsics_support.power_monitor) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Monitoring intrinsics are not supported\\n\");\n+\t\tPOWER_LOG(DEBUG, \"Monitoring intrinsics are not supported\");\n \t\treturn -ENOTSUP;\n \t}\n \t/* check if multi-monitor is supported */\n@@ -457,14 +457,14 @@ check_monitor(struct pmd_core_cfg *cfg, const union queue *qdata)\n \n \t/* if we're adding a new queue, do we support multiple queues? */\n \tif (cfg->n_queues > 0 && !multimonitor_supported) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Monitoring multiple queues is not supported\\n\");\n+\t\tPOWER_LOG(DEBUG, \"Monitoring multiple queues is not supported\");\n \t\treturn -ENOTSUP;\n \t}\n \n \t/* check if the device supports the necessary PMD API */\n \tif (rte_eth_get_monitor_addr(qdata->portid, qdata->qid,\n \t\t\t&dummy) == -ENOTSUP) {\n-\t\tRTE_LOG(DEBUG, POWER, \"The device does not support rte_eth_get_monitor_addr\\n\");\n+\t\tPOWER_LOG(DEBUG, \"The device does not support rte_eth_get_monitor_addr\");\n \t\treturn -ENOTSUP;\n \t}\n \n@@ -564,14 +564,14 @@ rte_power_ethdev_pmgmt_queue_enable(unsigned int lcore_id, uint16_t port_id,\n \t\tclb = clb_pause;\n \t\tbreak;\n \tdefault:\n-\t\tRTE_LOG(DEBUG, POWER, \"Invalid power management type\\n\");\n+\t\tPOWER_LOG(DEBUG, \"Invalid power management type\");\n \t\tret = -EINVAL;\n \t\tgoto end;\n \t}\n \t/* add this queue to the list */\n \tret = queue_list_add(lcore_cfg, &qdata);\n \tif (ret < 0) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Failed to add queue to list: %s\\n\",\n+\t\tPOWER_LOG(DEBUG, \"Failed to add queue to list: %s\",\n \t\t\t\tstrerror(-ret));\n \t\tgoto end;\n \t}\n@@ -684,7 +684,8 @@ int\n rte_power_pmd_mgmt_set_pause_duration(unsigned int duration)\n {\n \tif (duration == 0) {\n-\t\tRTE_LOG(ERR, POWER, \"Pause duration must be greater than 0, value unchanged\");\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Pause duration must be greater than 0, value unchanged\");\n \t\treturn -EINVAL;\n \t}\n \tpause_duration = duration;\n@@ -702,12 +703,13 @@ int\n rte_power_pmd_mgmt_set_scaling_freq_min(unsigned int lcore, unsigned int min)\n {\n \tif (lcore >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID: %u\\n\", lcore);\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID: %u\", lcore);\n \t\treturn -EINVAL;\n \t}\n \n \tif (min > scale_freq_max[lcore]) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid min frequency: Cannot be greater than max frequency\");\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Invalid min frequency: Cannot be greater than max frequency\");\n \t\treturn -EINVAL;\n \t}\n \tscale_freq_min[lcore] = min;\n@@ -719,7 +721,7 @@ int\n rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max)\n {\n \tif (lcore >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID: %u\\n\", lcore);\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID: %u\", lcore);\n \t\treturn -EINVAL;\n \t}\n \n@@ -727,7 +729,8 @@ rte_power_pmd_mgmt_set_scaling_freq_max(unsigned int lcore, unsigned int max)\n \tif (max == 0)\n \t\tmax = UINT32_MAX;\n \tif (max < scale_freq_min[lcore]) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid max frequency: Cannot be less than min frequency\");\n+\t\tPOWER_LOG(ERR,\n+\t\t\t  \"Invalid max frequency: Cannot be less than min frequency\");\n \t\treturn -EINVAL;\n \t}\n \n@@ -740,12 +743,12 @@ int\n rte_power_pmd_mgmt_get_scaling_freq_min(unsigned int lcore)\n {\n \tif (lcore >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID: %u\\n\", lcore);\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID: %u\", lcore);\n \t\treturn -EINVAL;\n \t}\n \n \tif (scale_freq_max[lcore] == 0)\n-\t\tRTE_LOG(DEBUG, POWER, \"Scaling freq min config not set. Using sysfs min freq.\\n\");\n+\t\tPOWER_LOG(DEBUG, \"Scaling freq min config not set. Using sysfs min freq.\");\n \n \treturn scale_freq_min[lcore];\n }\n@@ -754,12 +757,12 @@ int\n rte_power_pmd_mgmt_get_scaling_freq_max(unsigned int lcore)\n {\n \tif (lcore >= RTE_MAX_LCORE) {\n-\t\tRTE_LOG(ERR, POWER, \"Invalid lcore ID: %u\\n\", lcore);\n+\t\tPOWER_LOG(ERR, \"Invalid lcore ID: %u\", lcore);\n \t\treturn -EINVAL;\n \t}\n \n \tif (scale_freq_max[lcore] == UINT32_MAX) {\n-\t\tRTE_LOG(DEBUG, POWER, \"Scaling freq max config not set. Using sysfs max freq.\\n\");\n+\t\tPOWER_LOG(DEBUG, \"Scaling freq max config not set. Using sysfs max freq.\");\n \t\treturn 0;\n \t}\n \n",
    "prefixes": [
        "v3",
        "06/16"
    ]
}