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 239F84240D; Wed, 18 Jan 2023 12:03:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B8937400D6; Wed, 18 Jan 2023 12:03:32 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 5EAA24003F for ; Wed, 18 Jan 2023 12:03:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1674039810; x=1705575810; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=yPrHn5vxfbgyNAuT1SMmwAJG7avuaJoSmvVtjcP/69s=; b=h79I7Ol66E/guR3aAC8PKYEaX5YHx3u2FEyuUa+AeoOlBkHZZyKUqqRe mtxlKNcSR/QzmWRz01evCRqcY8soolVHzTZpL+v6bYNPSRBfo1hdRNGtD L6CQA6ONkgy1FRqloGKXHseK9kcDc3sQqJCDhvPNbN6GVzi/Ma1VPUloV nBqvLPVvOmep55vP3BZXonFxoZCIx6qSouPZ8hQUFd+Z/LXvelmY5Uca7 xJoNjo5eSUu6GYQ2DJmF6Ghx2QQzgNlMQwV2809F+9Fsvc3uNASNpt95V sl7mKJEtLl0BdEBBiiJ0FMNl65Xwb1dZn2E/WsD1mqPckctWIXjSKzoEJ g==; X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="325008746" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="325008746" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jan 2023 03:03:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10593"; a="728151120" X-IronPort-AV: E=Sophos;i="5.97,226,1669104000"; d="scan'208";a="728151120" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by fmsmga004.fm.intel.com with ESMTP; 18 Jan 2023 03:03:29 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 18 Jan 2023 03:03:28 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) 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, 18 Jan 2023 03:03:28 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 18 Jan 2023 03:03:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dyL3XcJkSiSfARne12sMoTUZ/JVt9myJQmpcuWCci7ysrIErm28Oio3h1eKPsmOFYTr77TfpxGXvS01tyvNOZ/zaR4N7vNHsUVwRCPnEPXHgI2YKDFSeVJdTYFW+LEm4bLIPecl9mWaSsm2PQV8nQNAX5TihliZxfZeqmYcTcTcVeERc7cOxdLtF271BiA4/3/XJbfxQqxc6cK4c9OlqlVaFBKgrS9heYW1HHHYbMWfAo+ZdKIhGH9rEkWXoI37RP0JSqd3kPhc02SywQ9NPQqFZcUwZpAXAyjh+2j2B9lKWFHaK4Dyz07JSoU5oG+uhxwXtoKyFeUGtg2Oi4SuGHw== 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=orGT53bO3mB3d+hKO7DICCUlJ9yR/dLqGa7SnyXM7TA=; b=GhHef9iWg/KcPU/RZf/Ds6NdZsEgoqc/QWL1MKJwGxlh11nNxgDJYfYBF0hZS4cXs58EU0+BNIAyQT0a7/hhJv7SQS0sdgsREW16MrFFlrvruC1sxyN2u6wCuAYBEW3Ycnlw0kMiHxTOZ4JQqcx+KuB30S0eh05l6UA+FD6go7QlPFldYyD/eoczu0RkzWKpzCmYludQv79/sp2aKuGRH5xrs9vSDI73kR5jUCIsrHqr5NiuL+9TPgfpwQOm2mWgVHWsXi7650SIEnxf4bRu9as2C6Z5gNcK47RV9uS0MG8dZkbqXbtDvouYdEQ/ikIr3+Pj/A68mep2B0SMp16AHw== 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 MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by SA2PR11MB4843.namprd11.prod.outlook.com (2603:10b6:806:fb::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.23; Wed, 18 Jan 2023 11:03:26 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::5f56:1bdc:2eae:c041]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::5f56:1bdc:2eae:c041%7]) with mapi id 15.20.6002.013; Wed, 18 Jan 2023 11:03:26 +0000 Message-ID: <45b9e94c-da88-5e03-5cac-66015abfdc49@intel.com> Date: Wed, 18 Jan 2023 11:03:20 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v5 1/4] eal: add lcore info in telemetry To: =?UTF-8?Q?Morten_Br=c3=b8rup?= , Robin Jarry , CC: Tyler Retzlaff , Ciara Power References: <20221123102612.1688865-1-rjarry@redhat.com> <20221216102109.64142-1-rjarry@redhat.com> <20221216102109.64142-2-rjarry@redhat.com> <50d3c808-c227-2915-3d07-74e8c3c7fab8@intel.com> <98CBD80474FA8B44BF855DF32C47DC35D87685@smartserver.smartshare.dk> Content-Language: en-US From: Kevin Laatz In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87685@smartserver.smartshare.dk> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO2P265CA0073.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::13) To MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR11MB5872:EE_|SA2PR11MB4843:EE_ X-MS-Office365-Filtering-Correlation-Id: f4c82e26-2f4a-4bb2-e0be-08daf9439f9c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AC4CGjlma/uo0TW/zRBrz4kXZC0fe+tNM74p5qEmQg/A/Sqf6Ij6TAtVRXMWik37UwpDovqnagFUDT7g/WY7LHGtEEBqDqUyp1A6glq6byY4hyTgQq88IVePQu2yzzr7Y8umSjNVnSZeYyhn3/XrceI2u+gnI/LHQdnDWDclZw2muMJmcTCGkUoOSal+n1CTlufJq4KokEZOE2ISUNdyyiDdd4CXyX0L9T/FLSEQKLg6J41yy365VV8OuKu4c5izFMQjg69xeqEovvT6Og0BHplWT+zbhojgSK6IM9+bKzft6D3s8POf+ImrdY5sIiskSE9x1FF8VT0h/Wa3pNMlg9ZSRHD+dgqmeDGF6uSVaQJofoHYsa0xfmfeFCURR//MqkyKVxvFg/j1fxd3g+TeRamTWD0r4RKD6hXMF9abnejOMr9NpsLKKhkP9Ouf6/GCxXf0PcDOziZhPrAydQaS0zPEyvCf5eVa5e7DTrCQpO99Lb/S2CH8UoGN9HywmTpG6NmrBl0FdfRHwQEN62CzHC4IXtTpipznoQTX6UzSmkgvJJeEZKP7m2SrI8eUjq5Hcq+iqCwgmho2yFX0Qx+8zk/TWoWbiE9Cn3PbQL/BgQIKr7itDysyasY6CzjSqRs+wJ0by9UmcJXoiS2OyzdAce4vq/DrVilBRMsVcjdRHaAIUqg1pRGtxov02TzzYOUntReZ7GNS0icZIjFkMX7TjH0LudIVXnxsos/QwioAt5M= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR11MB5872.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(366004)(396003)(136003)(39860400002)(376002)(451199015)(31696002)(36756003)(86362001)(66476007)(2616005)(66946007)(8676002)(26005)(6512007)(41300700001)(66556008)(4326008)(186003)(66574015)(83380400001)(6666004)(107886003)(316002)(6506007)(110136005)(478600001)(54906003)(44832011)(2906002)(6486002)(82960400001)(38100700002)(8936002)(53546011)(5660300002)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y1lMUzZjdWVTMHFwV25KZ0JwSnRzcDlRQWkrbTVtRDRLTmlHODhtZ0VBZmRt?= =?utf-8?B?NTRGRUM2SUFXdFQxT21XZjdJY05qTWRaaDBZWlB1eklneURmSkhhek91SlFJ?= =?utf-8?B?RlcrVi9WUzc0NFh4cWdCdE1lVTY3bUxJenlIc1FER2RlYW8wZEk2eTAySFZ1?= =?utf-8?B?WFE0QlJWTkVDblp2cE9leUkyQVdneDVITEZyUndIdkdVUTl5SWJBSFN2eUY5?= =?utf-8?B?NkFHS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ybFJVMlQvNSs0aEJCVGJMRHBySGU4M0xH?= =?utf-8?B?MVFJTE1WN1Q5NE5nbEFmUk9QdE85a3dCanFVZGF0RkpuRkFZSTl3WXQzTUVJ?= =?utf-8?B?NWFONTJLZGg0QVk5a3NKL0I2Tzh6L2V0K3FETXVFQW5GOVhuMlpyZmpsaFBm?= =?utf-8?B?V2c9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: f4c82e26-2f4a-4bb2-e0be-08daf9439f9c X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2023 11:03:26.6078 (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: nEZDSyLQI2gQkF5c0ZFYFXSHEtH/PUl0RJEwVbYt/TpyOwxbLxb/G1BX6KiQwAPRY+MG2cfJcbFCkOGUcK/tNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4843 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 18/01/2023 10:21, Morten Brørup wrote: >> From: Kevin Laatz [mailto:kevin.laatz@intel.com] >> Sent: Wednesday, 18 January 2023 10.42 >> To: Robin Jarry; dev@dpdk.org >> Cc: Tyler Retzlaff; Morten Brørup >> Subject: Re: [PATCH v5 1/4] eal: add lcore info in telemetry >> >> On 16/12/2022 10:21, Robin Jarry wrote: >>> Report the same information than rte_lcore_dump() in the telemetry >>> API into /eal/lcore/list and /eal/lcore/info,ID. >>> >>> Example: >>> >>> --> /eal/lcore/info,3 >>> { >>> "/eal/lcore/info": { >>> "lcore_id": 3, >>> "socket": 0, >>> "role": "RTE", >>> "cpuset": [ >>> 3 >>> ] >>> } >>> } >>> >>> Signed-off-by: Robin Jarry >>> Acked-by: Morten Brørup >>> --- > >> Hi Robin, >> >> Thanks for taking the time to work on this. It is a good implementation >> for debug use-cases. >> >> I have 2 suggestions which would improve the usability of the data: >> 1. Could we make the lcore_id paramater on /eal/lcore/info optional? >> This would allow users to read info for all lcores in the application >> at >> once. > +1 to this suggestion. > >> 2. Could we add 2 additional telemetry endpoints? One which returns an >> array of busy_cycles values and the other returns an array of >> total_cycles values. These arrays could be used in conjunction with the >> /eal/lcore/list endpoint to quickly read the usage related metrics. >> I've >> included an example diff below [1]. > I prefer this done in a more generic way, see below. > >> We have a use-case beyond debugging in which we read telemetry every >> few >> milliseconds. From a performance point of view, adding the 2 additional >> endpoints would be very beneficial. >> >> Thanks, >> Kevin >> >> [1] >> >> diff --git a/lib/eal/common/eal_common_lcore.c >> b/lib/eal/common/eal_common_lcore.c >> index 210636d21d..94ddb276c5 100644 >> --- a/lib/eal/common/eal_common_lcore.c >> +++ b/lib/eal/common/eal_common_lcore.c >> @@ -569,6 +569,32 @@ handle_lcore_info(const char *cmd __rte_unused, >> const char *params, struct rte_t >>         return rte_lcore_iterate(lcore_telemetry_info_cb, &info); >>  } >> >> +static int >> +lcore_telemetry_busy_cycles_cb(unsigned int lcore_id, void *arg) >> +{ >> +       struct rte_tel_data *d = arg; >> +       struct rte_lcore_usage usage; >> +       rte_lcore_usage_cb usage_cb; >> +       unsigned long cycles = 0; >> + >> +       memset(&usage, 0, sizeof(usage)); >> +       usage_cb = lcore_usage_cb; >> +       if (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) >> +               cycles = usage.busy_cycles; >> + >> +       return rte_tel_data_add_array_u64(d, cycles); >> +} >> + >> +static int >> +handle_lcore_busy_cycles(const char *cmd __rte_unused, >> +               const char *params __rte_unused, struct rte_tel_data >> *d) >> +{ >> +       int ret = rte_tel_data_start_array(d, RTE_TEL_U64_VAL); >> +       if (ret) >> +               return ret; >> +       return rte_lcore_iterate(lcore_telemetry_busy_cycles_cb, d); >> +} >> + >>  RTE_INIT(lcore_telemetry) >>  { >>         rte_telemetry_register_cmd( >> @@ -577,5 +603,8 @@ RTE_INIT(lcore_telemetry) >>         rte_telemetry_register_cmd( >>                         "/eal/lcore/info", handle_lcore_info, >>                         "Returns lcore info. Parameters: int >> lcore_id"); >> +       rte_telemetry_register_cmd( >> +                       "/eal/lcore/busy_cycles", >> handle_lcore_busy_cycles, >> +                       "List of busy cycle values. Takes no >> parameters"); >> } >> #endif /* !RTE_EXEC_ENV_WINDOWS */ > This should be generalized to support any named field in the rte_lcore_usage structure. > > The general path could be: /eal/lcore/usage > > With optional parameter lcore_id. This should return one object (or an array of such objects, if lcore_id is not given) with all usage fields and their values, e.g.: > > { > "lcore_id": 7, > "total_cycles": 1234, > "usage_cycles": 567 > } > > > The paths to support the array-optimized feature you are requesting could be: /eal/lcores/usage/total_cycles and /eal/lcores/usage/usage_cycles. > > These paths should return the arrays as suggested. I only request that you change "/lcore" to plural "/lcores" and add "/usage" to the path before the field name in the usage table. > > Alternatively, you could add a path /eal/lcores/usage_array, taking the field names as parameters and outputting multiple arrays like this: > > /eal/lcores/usage_array,total_cycles,usage_cycles > > { > "total_cycles": [1234, 1234, 1234], > "usage_cycles": [567, 678, 789] > } +1, this would also work nicely and allows for extension in future without flooding with endpoints. > > But I don't know if this breaks with DPDK's standard REST interface. It would be easier if we had decided on something like OData, instead of inventing our own. > >