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 1A69642B22; Tue, 16 May 2023 12:47:14 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A9B140A8B; Tue, 16 May 2023 12:47:14 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 3D03F4068E for ; Tue, 16 May 2023 12:47:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684234032; x=1715770032; h=message-id:date:subject:to:cc:references:from: in-reply-to:content-transfer-encoding:mime-version; bh=Hm9wfsFJxDn1hbdDDXSrBvjgr1wmGcOj3qSESSzm6XU=; b=az6Z3zYeLvzbFi5vjqYnAEgarQfctKrobN5Z665VGuC7ynQrOgFQ+3KM kq7nd8KpcT/Uz8CsvcxhndyE2P6aIIoPc7XE6WyULEwhKBoWo+tPHDw+V 0kXjSEczrWrnO2ZCOm2U4GyaneA1rhArHYbklQNSKjfZvAhQS25JYOQsL R2ZMAj8NsnFtHu2iOMd8CD1gQ9ePgYNBVWXgScD93aQoS6fuZZfSZDkhN wJIRu6NkekAuip9RVuG7SN92J+vv1Bh1998Yjc916o4OCZUM6dp4vZHC8 mh9kU2nvLyR6629XhUvsOhdDyjo+NCqS1VV0KRaM4mZ+6QfterjbKpIv/ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="331063547" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="331063547" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 May 2023 03:47:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10711"; a="704351010" X-IronPort-AV: E=Sophos;i="5.99,278,1677571200"; d="scan'208";a="704351010" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga007.fm.intel.com with ESMTP; 16 May 2023 03:47:11 -0700 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Tue, 16 May 2023 03:47:10 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23 via Frontend Transport; Tue, 16 May 2023 03:47:10 -0700 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.42) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.23; Tue, 16 May 2023 03:47:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kkSOlmWiZf4RxvCJoR7/L0qhy/WwK25j6sJl4jqHzdTKA1DY1vnVY0OyXdMrCsKXOiSvvpCOXMmW5S4Q92IkPhaUi35tDFJg7RammXY2vaMIOm/qiRycoaWPpiDtkY9Z6v4dkhOslKD9UX9cyGtdb9FIaqv3Sai/1J087SkdAlA/Cmdfd6mgQYTBlQ9egP9C9KP/B7i92MaGsIndoHBzfRxfgf8MCvLI1odZaD2sUJlrBQpKNZ5kxbX9sv49eUl0W74wFuPBj+ocSfCCssQ6IaPl1Bqq/uU0Z+n7mHFewJviu90LfBPVJsHCvfhNsQa3fQ7ZvRz83wgMSLfBZqIAOA== 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=/Cy30C+byHtMyn9UK755fuQhbItb/TgLHO+k47NTUqo=; b=KhQub/g19mCCT4LsbWneA6rfQAfSmorfDvnulAzgOuOdM3NAzgPVi8F3Dfj/RAKfoE5pijZGz3P++pPyJ+bCiqRMzbung87TkAiWFr7mis28as1QKQTFGXLY3iORFMhjm8o67IUY5SL1pWcDButsfvfzuSZKpWL08r4LRhNdpojwEEMZtcYGnMOmAuYyeRtMWzVlUK7cjpPlmIuMzFkEklcxck5XVehCPOe9rUbhc/pH7yi/osYMZaZGJ+zciC3H4shZoYLrE2w06pH4Pi3CO6NKAakb0rBfHaTnTzVtWf5dBYYoE3zItVZQF6cAoxhC4/AiZQHZQCfym3ztyjMXuw== 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 DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) by CY8PR11MB7828.namprd11.prod.outlook.com (2603:10b6:930:78::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33; Tue, 16 May 2023 10:47:08 +0000 Received: from DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::49c0:aa4c:e5b4:e718]) by DM4PR11MB6502.namprd11.prod.outlook.com ([fe80::49c0:aa4c:e5b4:e718%5]) with mapi id 15.20.6387.033; Tue, 16 May 2023 10:47:08 +0000 Message-ID: <3620972f-3954-1153-6601-f3b9d3f20b5f@intel.com> Date: Tue, 16 May 2023 11:47:02 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.11.0 Subject: Re: [PATCH v7] mem: telemetry support for memseg and element information To: Amit Prakash Shukla CC: , , , , , References: <20221025115138.4071745-1-amitprakashs@marvell.com> <20221025130216.4141896-1-amitprakashs@marvell.com> Content-Language: en-US From: "Burakov, Anatoly" In-Reply-To: <20221025130216.4141896-1-amitprakashs@marvell.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0063.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2af::16) To DM4PR11MB6502.namprd11.prod.outlook.com (2603:10b6:8:89::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR11MB6502:EE_|CY8PR11MB7828:EE_ X-MS-Office365-Filtering-Correlation-Id: f19a4c17-6f93-4607-4fd3-08db55fae509 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PPjlz+2fygxqq09kbyPDsR1y5G5ocEs+1EHnVsWpAbSBE+o4yvHPEa/W7qGl3R+dmLzhJbdVx4xXwRAjipNyTRmhdYihFr6pxVA4+HcKGtcN6hBRSKHqaXyTLy2ybVp73uYZNrD8OhTQu/2IyUap4yhFsX/55W8FHGSxMIrlLbkOOqcDIg3mQ9XMJ6LjjJZ9bQIjVBczvzihYbGBhDYmtiWak3qnx+vVuENVXWfMuTTFre/o0EUMZm0uC7t1PUU4JRI2a7kV/I2mjPJi3duf4JRMNK1b0dhyzWhaSYS1DKgZuhDSQthsZHoUv5wChk0SRQnfGdrqHreqzxEibu0MM+/wdQpnssvIfgIs0cAfUUEa2xqxLJKTkQhZRVI8XXFI/Pk6ToUKT0BcEHR4nfnNJ+uSj1wmFEt49SuRC/FXDefByyA5d2Z5ARr0/AN0a3435tqFpbTK73WMzwrL2SGa+QclQQbiAXG76mjPgQ56stFaO0fP3DMk7x22pvNuco0khc6DLctPr4pBlJTu9aTI5e0Mq1k781WrTR/uWiZdiULTH6fkAzGSru1OjMZgkT4mF+NfCiB4fSoXkn1YUgm1TNAyvSU1iVmYflCS/DEWzw+jmcxVJ+x2dnuyGDYaG8oq0tZRbn2lnX/Mv17KuHdTIA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB6502.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(396003)(346002)(366004)(376002)(39860400002)(136003)(451199021)(36756003)(86362001)(31696002)(316002)(66946007)(66556008)(66476007)(6916009)(4326008)(478600001)(6666004)(8936002)(8676002)(5660300002)(41300700001)(2906002)(38100700002)(82960400001)(2616005)(26005)(6506007)(6512007)(53546011)(186003)(83380400001)(6486002)(31686004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q0RJWlN3ZEEwcFFsRDBlTmkxYzJIUTFHUzRBcng0M1o0Y3QrcjRoa2xad2p3?= =?utf-8?B?RWJENnh0a0N2L0YzTGRnZExITmpSaHVVTmNiNnZhdm5ONzhoaUR0ZjQ3VjY3?= =?utf-8?B?T1hSbnlDcEtZeG5ZTzhtMk1aNXNaOXFlMHdpY05KQWdwRDhKU3FjQy9ZaEFN?= =?utf-8?B?bEZxOTRmdHNVYkxaZURLdERFbVczcmF6MWVVdTQ4QmZMTjhEU2t4QzR6NUdm?= =?utf-8?B?c21BdEt3Wmw3S013V2pGMFlaMlpicFNBWVZGdWJuYVBPWkJGK21TSWpUWG5X?= =?utf-8?B?RXo4ZkN2NWhueDA0bFZBdC92OHdIZ3hud3RTcjUxa29hODkxblRSWXNKR3Bt?= =?utf-8?B?Sit6WjRCY1dXZFVSVmdGc05JeElZdEFIbWtza01zYVMvUWxCUVgzMXRqM3FJ?= =?utf-8?B?anplZVdWSmsweDFTeG0yd2tEUXdYWWhwcG1jazBxRVpr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thSource: DM4PR11MB6502.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2023 10:47:07.9581 (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: wEZlTskYe5OuVBVAhAMb8MUuRQ0yUhaFqsRnOiLIFckFhpkbNihuDs+szJnAdGCmEv8AOolLvDbPyuSWzODKdUFq4fkF5XGU56+HpBHKu8k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR11MB7828 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 10/25/2022 2:02 PM, Amit Prakash Shukla wrote: > Changes adds telemetry support to display memory occupancy > in memseg and the information of the elements allocated from > a memseg based on arguments provided by user. This patch > adds following endpoints: > > 1. /eal/memseg_lists > The command displays the memseg list from which the memory > has been allocated. > Example: > --> /eal/memseg_lists > {"/eal/memseg_lists": [0, 1]} > > 2. /eal/memseg_list_info, > The command outputs the memsegs, from which the memory is > allocated, for the memseg_list given as input. > Example: > --> /eal/memseg_list_info,0 > {"/eal/memseg_list_info": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, \ > 12, 13, 14, 15]} > > 3. /eal/memseg_info,, > The command outputs the memseg information based on the > memseg-list and the memseg-id given as input. > Example: > --> /eal/memseg_info,0,10 > {"/eal/memseg_info": {"Memseg_list_index": 0, \ > "Memseg_index": 10, "Start_addr": "0x101600000", \ > "End_addr": "0x101800000", "Size": 2097152, "Hugepage_size": 2097152, \ > "Socket_id": 0, "flags": 0}} > > --> /eal/memseg_info,0,15 > {"/eal/memseg_info": {"Memseg_list_index": 0, "Memseg_index": 15, \ > "Start_addr": "0x102000000", "End_addr": "0x102200000", \ > "Size": 2097152, "Hugepage_size": 2097152, "Socket_id": 0, "flags": 0}} > > 4. /eal/mem_element_list,,, > The command outputs number of elements in a memseg based > on the heap-id, memseg-list-id and memseg-id given as input. > Example: > --> /eal/mem_element_list,0,0,10 > {"/eal/mem_element_list": {"Element_count": 52}} > > --> /eal/mem_element_list,0,1,15 > {"/eal/mem_element_list": {"Element_count": 52}} > > 5. /eal/mem_element_info,,,, \ > , > The command outputs element information like element start > address, end address, to which memseg it belongs, element > state, element size. User can give a range of elements to be > printed. > Example: > --> /eal/mem_element_info,0,0,15,1,2 > {"/eal/mem_element_info": {"element_1": {"msl_id": 0, "ms_id": 15, \ > "memseg_start_addr": "0x102000000", "memseg_end_addr": "0x102200000", \ > "element_start_addr": "0x102000b00", "element_end_addr": "0x102003380", \ > "element_size": 10368, "element_state": "Busy"}, "element_2": \ > {"msl_id": 0, "ms_id": 15, "memseg_start_addr": "0x102000000", \ > "memseg_end_addr": "0x102200000", "element_start_addr": "0x102003380", \ > "element_end_addr": "0x102005c00", "element_size": 10368, \ > "element_state": "Busy"}, "Element_count": 2}} > > Signed-off-by: Amit Prakash Shukla > --- > + ms_start_addr = ms->addr_64; > + ms_end_addr = (uint64_t)RTE_PTR_ADD(ms_start_addr, ms->len); > + ms_size = ms->len; > + hugepage_size = ms->hugepage_sz; > + ms_socket_id = ms->socket_id; > + ms_flags = ms->flags; > + > + rte_mcfg_mem_read_unlock(); > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_int(d, "Memseg_list_index", ms_list_idx); > + rte_tel_data_add_dict_int(d, "Memseg_index", ms_idx); > + snprintf(addr, ADDR_STR, "0x%"PRIx64, ms_start_addr); > + rte_tel_data_add_dict_string(d, "Start_addr", addr); > + snprintf(addr, ADDR_STR, "0x%"PRIx64, ms_end_addr); > + rte_tel_data_add_dict_string(d, "End_addr", addr); > + rte_tel_data_add_dict_u64(d, "Size", ms_size); > + rte_tel_data_add_dict_u64(d, "Hugepage_size", hugepage_size); Seems like rte_tel_data_add_dict_u64 is deprecated now. I would also suggest outputting IOVA address for memsegs as well (unless it's set to RTE_BAD_IOVA, in which case it should say something meaningful too). Otherwise (and with above changes), LGTM Acked-by: Anatoly Burakov -- Thanks, Anatoly