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 8485541D40; Wed, 22 Feb 2023 17:34:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 76BAB43109; Wed, 22 Feb 2023 17:34:52 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id D76BA43106 for ; Wed, 22 Feb 2023 17:34:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677083691; x=1708619691; h=message-id:date:subject:to:references:from:in-reply-to: content-transfer-encoding:mime-version; bh=0Q7o5jN0rC7zOvDrWbugXJpmiF9Y2eoNJUxGjfI4bp8=; b=cgazvZiUUKTDiFKSaZy/ORn0U0Ycxh0MRnobl+j4Vh1Z52HOLt/rjods zd3joQcjfwpkaO8CNsgdCQk4bPDVOnTjmxJ1d5zBWZ7vI/HzW2YfsnhAF XDAC5iNC/sPxlHoVk5qluLDnU3c7othNqNA1ZTkSEVOuatYi87OfajXj2 XVPu6w114cdjgql+4rrMCxO2vWK0AhZSetJApDNoz7w4cU0pbC6An/x8m IKTUsC0V3nUhO6/Vrq6MWHzNvCTCGKnaDA6WSBROorwALd2u737Y6s9DW nDemeRMPuOAbBnbR4BQMifPuSckmNYhMumfaBFDhyf1Tmc8uz/Su/eyUw g==; X-IronPort-AV: E=McAfee;i="6500,9779,10629"; a="419198066" X-IronPort-AV: E=Sophos;i="5.97,319,1669104000"; d="scan'208";a="419198066" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Feb 2023 08:34:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10629"; a="665393874" X-IronPort-AV: E=Sophos;i="5.97,319,1669104000"; d="scan'208";a="665393874" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga007.jf.intel.com with ESMTP; 22 Feb 2023 08:34:49 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 22 Feb 2023 08:34:49 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 22 Feb 2023 08:34:49 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.172) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 22 Feb 2023 08:34:48 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nVXeZFtqWqdOnX1iMh5bLOPVyk02gKeXpL3OVcBSjDi6CgawEeUj3F4vd/2V6rtYodh2oh/LDyDPFMPyDgu4kHobTTc2EZ/LawU7iovNduJwya9FyzV+DFkJszZ1K+7wwqd4SjaYu06G7d5dA98I2Oa910GMZV5shl/LzNoeeyTtWjR96yUh9VbtFxFnJ8u1MerMYrw2H5q4I3G0eE7CWiaXZQ+BHhDe/Av/Cf26e0SwvsKp3Njpqt4CsClmUp4ERnhc+2XY2E9Vh4tOmTiVsTTVOkpxQGWWnRuFxTaFmHhavbGFNv4BqNmCGRe4jcU/1OqRx1HdtyPcN9MJc3A3RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rz15QE5K77lzwcqTSXg4Mkjjd2qsFQ7j+zS4jetHRz4=; b=YOtcESjZzMsULepxP8bZO7ovsX/JL8rKjifRXnBKzwXFvG3iF+vWRVY7PiB09VDfjSjiGWAwoiXDrmW6Zd6/6TcyyFr5kawGZjG/a0oIwqih+5uPNH3vbZD9aLu0sDwVqkEAtXM8s/RQ0F2a/XQz49CcyfRUNzELjSRp/p2sQAoC7VHsSUk0Tc/1AwHJgt6d1R/zLKi4EMnxv0bQmk3RqBUeQrA3EmFw6rE8Q8vtM43Kf+WWtKQuKfz89f7aYafWWju0YizQltpAfNaLUfQyfWwKdl7BqSRAqyJF2GRrGYozOXzJ0lAS6/IIyCqxlukbC9wgO4YEYTuDrn2ZCP8VGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) by DS0PR11MB8206.namprd11.prod.outlook.com (2603:10b6:8:166::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6111.18; Wed, 22 Feb 2023 16:34:46 +0000 Received: from BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::4242:36e2:5a81:ff49]) by BYAPR11MB3799.namprd11.prod.outlook.com ([fe80::4242:36e2:5a81:ff49%7]) with mapi id 15.20.6111.021; Wed, 22 Feb 2023 16:34:46 +0000 Message-ID: Date: Wed, 22 Feb 2023 16:34:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v7 09/22] power: replace RTE_LOGTYPE_POWER with dynamic type Content-Language: en-US To: Stephen Hemminger , References: <20230207204151.1503491-1-stephen@networkplumber.org> <20230215172341.1525320-1-stephen@networkplumber.org> <20230215172341.1525320-10-stephen@networkplumber.org> From: "Hunt, David" In-Reply-To: <20230215172341.1525320-10-stephen@networkplumber.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0191.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:311::19) To BYAPR11MB3799.namprd11.prod.outlook.com (2603:10b6:a03:fb::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR11MB3799:EE_|DS0PR11MB8206:EE_ X-MS-Office365-Filtering-Correlation-Id: c3cba523-e285-470d-db7c-08db14f2b54f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NXhZ38lKigdJ9h/FTg21NYGT68QoTJeocPMnKcnAk0rFGgyNolc1E83wQQu4jW05PWkFs7JzE+7RwFoEeKcKUcNniVIGWPMF1EZ281rozVrvu/dRXgQME2P1iXfmGrUaifvou7ACmCz1uuD0LZigOG2wLEIIPEa4q4i8BSe3XLLRUhKbx3Sg6v24O5Ubik2uLUoPAx3Fypy8SUHcVw6mMo8DpM/0sUGT4seoShBEldJvAH5+CvZvZ5q+v9KifO490EuQ7L8HETbb4Fa/SvpLN+YC198YF2wHYHOhbEPJF+jzqDiIj1RlS9WkBn9DiUTWD0yVY5qQDcBnOP/53ufOa13NmE6C9wmSJ711Icd8MGiKn8755QpgqddeE0jlw+grqZPnaclMLUJg/r3n/J60S1OjOaFei7eOxcsl83bgxJjMZB51OzPpZskKrpyLa1KdlcjTFgOPAqRsyytTws+LTeHIPzWU2EWTU0GIo/mIRhpa09z20UeV7nX/+npoqA2GJSEMd2oR6DmFiGVD/YLGbMOf+ze+qLpnL4ClWWYTHq7dI+cFcjBrKU+bX93KxF7MLTFwcMRkb6un/kENgr+hI177THXm+MyLvHsjJINK/Ukyd/XK/GvViQuxxyjp1ZqjYdGrDXwt8geFry0LtAwhdjU8hVoanAM6Qi4ykWfjHbxR12FuqOf05SvQh4ccZi4HHXXQfFj3xbTkYqwUfcFM8LCBexwQDJxldd5l2ypQA58= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR11MB3799.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(366004)(39860400002)(346002)(376002)(396003)(451199018)(316002)(478600001)(66556008)(66946007)(66476007)(31686004)(8936002)(8676002)(6486002)(5660300002)(41300700001)(38100700002)(6512007)(82960400001)(2906002)(31696002)(36756003)(26005)(186003)(83380400001)(6506007)(6666004)(86362001)(53546011)(2616005)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cXh2R0NsajVDRmgyVWVOOC9UaG1GdWU0eUU5eFRCbmJhNFRYOW1OaWFwWW1I?= =?utf-8?B?aEdxbzNWb3d0Y29sMzVMKzdnZWNuZFF6a1J0Ukl5TXdMWXFRem80KzhHQ0lE?= =?utf-8?B?U0dQbXR0SVRpL3d1QkdRRFRCUE9BM0t0Uk1QZTVhOUVPTnZIYlNxM2RaRVZo?= =?utf-8?B?WTBMUjlMQjcvL0x5QjdjYkdKN1pwNGxnUUkrTDQ5aXYwYkxmY0tGRVJsT2dF?= =?utf-8?B?dmZicFJUdnlVc2R6RHRUWUJYYXdldG42NmFub0hRN0cwWml3VmU5OG5CQTEw?= =?utf-8?B?K0tGNm4rUmZqZjJCYnBpWnNtZGhsU25rem1HdTdRd0gvZmJ3VVBEQ1owVXN0?= =?utf-8?B?SFRLK3hSTFBobjlhTmg3MUpCWG1BSy8yelBEZmhqV1U1enQ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Network-Message-Id: c3cba523-e285-470d-db7c-08db14f2b54f X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3799.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2023 16:34:46.2576 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /ix131paQ1JcXVkt2bvIVC5FT2LdtYBnfGeUgSS9qAOE9LstsCCoHnQaH4GPHZAZi+OAaCn3HMQSejnS7dcW6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB8206 X-OriginatorOrg: intel.com 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 On 15/02/2023 17:23, Stephen Hemminger wrote: > 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 Acked-by: David Hunt