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 8D6D743C12; Wed, 28 Feb 2024 04:06:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7BE7240E64; Wed, 28 Feb 2024 04:06:58 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2086.outbound.protection.outlook.com [40.107.223.86]) by mails.dpdk.org (Postfix) with ESMTP id 4838C4027D; Wed, 28 Feb 2024 04:06:57 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dJ6VDaVqr90bfYpqUh1Jqq/62Th4+KGhPt7vReCALDVRG8Uw+x+KPtOXVp4PaH0tDRHykme0Z3AYZMg/bI5bQNwhi01xY5wugGs9U6PUgkAoW1d1/sO2N3XcA3LOeonz83oR1ZduHbZ9fOuMgmDzWpzTtWop65n8yNW00TG8upxrLApA4VQt0080DsVpK1dIOi4Dq91wkI4jBUC2nAJFn0VsPJRWZvZY/eM/pA4Nm2gP84U13NP2vaymleuIM8aKrUlaUC7HEkUGf5jPoERTb0oQQcoAoHe7how5KRYWrxcqmWHMfAXNj+fp7QiSX51uVZ9988HirK5yGwF7c9J7Xw== 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=4TM95AiFeJi1Qi4w/TVCcchl326rAisFG54ynjeMZYM=; b=Yspe2HRG/6R/unzk15YQhaHl9aByRUTLSv1Atnp6b1nRSG2r9HnoT/wrbVoSKGdm7mnBcPuJwHFecqY6O+w6cqOehuaAn/wSSOFY2EtSIZLRubJOfJ9BTq9/j4rHMYdvDNKB7+rWMfYJSoNUieWzKeg6dmxDCguAp7efDfgTD43gosPb7eJKMjsbI4Lr5ixEZlHgKW17Qt5j6Yr8wRNox3ztFx6xi+odeTxsEv/UvQyAE/FmvTFzoGllyiO1g98MY75YYs+ylBf4aC0zeOfryNOb+DKto5ErUHvqYM3qGM9lMjB7Zxnxr1+Te8/TQardQrTcvLfbdrO7JGXisaBxlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4TM95AiFeJi1Qi4w/TVCcchl326rAisFG54ynjeMZYM=; b=5S+LlnSoE0kCcxHmAD/KZ7sCXzJn9P/OkXlqXiXk0HTnRQ6Vh3t1E7k78uqXgpzHNf8unZs92cCr0FTratm0mL4gHr9tZI7Q2cIodM/EbfPwBqFq/gDZHor/vZdPW8p9hSYxzWam90Nfzai0/K5CfUAp2YUyxvb4zCJHT0WmsB8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from PH7PR12MB8596.namprd12.prod.outlook.com (2603:10b6:510:1b7::6) by DS0PR12MB9324.namprd12.prod.outlook.com (2603:10b6:8:1b6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Wed, 28 Feb 2024 03:06:55 +0000 Received: from PH7PR12MB8596.namprd12.prod.outlook.com ([fe80::5f0d:af7:7f6b:9b9c]) by PH7PR12MB8596.namprd12.prod.outlook.com ([fe80::5f0d:af7:7f6b:9b9c%5]) with mapi id 15.20.7316.035; Wed, 28 Feb 2024 03:06:54 +0000 Message-ID: <7bdf08b4-a2b1-49ca-b60e-d774765a7b53@amd.com> Date: Wed, 28 Feb 2024 08:36:52 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] app/dma-perf: add average latency per worker Content-Language: en-US To: fengchengwen , dev@dpdk.org, stable@dpdk.org, honest.jiang@foxmail.com, gmuthukrishn@marvell.com, ferruh.yigit@amd.com References: <20231219164021.858-1-vipin.varghese@amd.com> <9acefd53-f617-28c1-1d6b-21b137d336eb@huawei.com> <53b56a35-175f-de95-0f5f-cb7a4835607c@huawei.com> From: "Varghese, Vipin" In-Reply-To: <53b56a35-175f-de95-0f5f-cb7a4835607c@huawei.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PN3PR01CA0140.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:bf::12) To PH7PR12MB8596.namprd12.prod.outlook.com (2603:10b6:510:1b7::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB8596:EE_|DS0PR12MB9324:EE_ X-MS-Office365-Filtering-Correlation-Id: db4f455d-ab20-45fa-2491-08dc380a5146 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: X0iiILACSzwqwOUJA6fI+dJ4OJKU7avo94m8IpAQqtmM9GK/xNgrVgOdkUknyP+yzGkoFN0dJMk1PlG4aG3K536auZrMhbYjFg73IO8RvfhbOM4z/2smU3vzyLszBezGBmCMT7CTOfvPX2BdZVEvLr33XvK73oNinXJ+omsAmK+rCm3hy2VNt0KtzSCUn9aVaEo2KCpFEq0PxlwZ9uLIujoQrOLC0Ru7kY8yOSwxIH+AgRom6FYO087qwa63EazCKzyKtX2uEEJ2zLo4q84VARz1Z85IC05siayg0f2iaq5YQqI4qC17no6CAXfmOfBVNIhM9xarZVQLSf3HitfhJFK6CrJ4ZvILAvaYtbdE/shhDF06jFiy3IarhGX0b0CleUsgce64egfDFqX/Mn1SRThnYRwKSDdJ6TPurkq0wtFNhWr5ysvhU4mBAtZnWmwHE9npGvP7+ISaftuq9jgouFAEwwaz6vnut8J4HrizTw0mD6WrjqRycySGhjiQ2MOYpENkIh548x8Dm2rhLc1ApoX9woXc8gH0A53RhkkHkXPl5BxdTNozufJopRjpJaQ8Rx5coFUQxN8sa45MYFgtDL5bLMOfW37r4DVkuOJNTuXCbdSxX9JU7xLiaa4nZQl1Mlz9itDgwpGA9/VplmD2j1orwM2N6c+8vj2augdqZkA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR12MB8596.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(230273577357003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UGZYZ3hiT3ZybTFWNlBhaUtZN1YzNGIzMlJCaWhLUTNRbVQ1T1dBL3MwLzM3?= =?utf-8?B?VG1mbnJsc1NHNlNiSzRmQlpLcDUwL09ERVllcWxMSkVsZkg0Zk5XNzBvVXBp?= =?utf-8?B?Zm5mMThCU0RwUEdHNDJyUGJPV2NlZFZXRTkzY2NQMFZwZGsyWGp6aGVsczIv?= =?utf-8?B?S1RYMEdHc2d0NXJnS1Mxay9XcUlIQWFCU1FtREt2VXVsdEFydm5RK0h6RW9V?= =?utf-8?B?anpWSUlManZxV1kzVS9rMGJUaHlhRnk1UDAvZmVxUys4RUJZZ2lEK2I0MWZJ?= =?utf-8?B?cFFyR3h4TnpZajk1eGdPOFk5UnFHclpTdk9Ha1VvWGpTdjc5R2wwNXB4d2lr?= =?utf-8?B?VWEwSk5jVGNkbjl1L1V5Rkh5SmlBOGREbzBXZFppOUNmZi9sYldNcDlndlFC?= =?utf-8?B?Z1Q3Y25ZRGlBT04yUEZJanRvS0dPdGJncHNoMlJoc0ZxMmZ5Ti9DdzM4b3V6?= =?utf-8?B?MktUZDdMVX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TNYOUV4dkxCV2IwRmlCd0tPQ1FEZ2xiU2VlbDV4S3VxVkpsU1RrVDVSdjQ3?= =?utf-8?B?NE9OMHRNVTJFU1RQYzl3VlgzL2t2M0laZ0FXYU12Sy9TVTg5U2thQVdqdU9N?= =?utf-8?B?bU5COFhuY00vcHR5OXo5SjJzSWRyaVU5R3VhZjVqbU5YM2dabGN3STJzeVBD?= =?utf-8?B?cm42SHZOcEZ0bFBMNnhvUDczWWRmaGFHU2x6YXZpTTNYSk5ZNEtlUERiaGlK?= =?utf-8?B?MEdjZ0YvTDJWcEF1bHFKVGgwSWx4VVQrMy84ZDBnVnErNm83aFgwNGlyZ1I4?= =?utf-8?B?aFovMXlXV3lZMVMyQjd2TFhuRkI0eWNsa05EZGxnYUZ1c3ZmY1ovNDVqUkMx?= =?utf-8?B?SVZJODZrV1JpeHZKcENkSTc0ZjNUemdIb3ZtdWpNMGViNmdtMFY0czBnRFRM?= =?utf-8?B?V3FJR2YxQW5wQTNLclhaOS90ZTNKSjVBQkxsNGZOUzNqKzFIWnM1RHpXMG9l?= =?utf-8?B?RFB5Sk5wblJUT2NhUzh3Q2hVaFdjMmEvbmQ1b20rQldkNFhFaGJsQm5vMGQr?= =?utf-8?B?SFVZUEwyMEUza3JpVDdzTW9iWUxtSFZXVXprNCtrMCswaldLM0lhRFJGaGVx?= =?utf-8?B?bzZZSG0xNitwTnhUaWpEdDk5Y2ZUUmVFalQvc3BLMSsybkFFT29icjZuMmxt?= =?utf-8?B?ZTlhTmErWmw4UHVIZWl3cTAvYVVVOU1JS1liNWswWUcxaEd5Z1pqRlFEYXk5?= =?utf-8?Q?VFeJg8XADHUqHaTWNUG4uk9PS?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: db4f455d-ab20-45fa-2491-08dc380a5146 X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB8596.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2024 03:06:54.7228 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rS+44I2tr9W26ONuO584PudYgaoDRPjJjhNpKUipbdQWXV2KasQpUdCtYipveQPLSLkcb4U6XFkrZpmy4gLGIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9324 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 2/27/2024 6:39 PM, fengchengwen wrote: > Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. > > > Hi Vipin, > > On 2024/2/27 17:50, Varghese, Vipin wrote: >> On 2/23/2024 3:15 PM, fengchengwen wrote: >>> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. >>> >>> >>> Hi Vipin, >>> >>> On 2023/12/20 0:40, Vipin Varghese wrote: >>>> Modify the user display data with total average latency per worker. >>>> >>>> Signed-off-by: Vipin Varghese >>>> --- >>>> app/test-dma-perf/benchmark.c | 3 ++- >>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/app/test-dma-perf/benchmark.c b/app/test-dma-perf/benchmark.c >>>> index 9b1f58c78c..8b6886af62 100644 >>>> --- a/app/test-dma-perf/benchmark.c >>>> +++ b/app/test-dma-perf/benchmark.c >>>> @@ -470,7 +470,8 @@ mem_copy_benchmark(struct test_configure *cfg, bool is_dma) >>>> bandwidth_total += bandwidth; >>>> avg_cycles_total += avg_cycles; >>>> } >>>> - printf("\nTotal Bandwidth: %.3lf Gbps, Total MOps: %.3lf\n", bandwidth_total, mops_total); >>>> + printf("\nAverage Cycles/op: %.2lf, Total Bandwidth: %.3lf Gbps, Total MOps: %.3lf\n", >>>> + (float) avg_cycles_total / nb_workers, bandwidth_total, mops_total); >> thanks for the suggestions, please find my observations below >> >>> Because this is total stats, suggest add Total prefix, e.g. "Total Average Cycles/op" >> I did not follow this, so please let me try to explain my understanding. For `n` operation we count the average cycles, then >> we add the cycles to form `total average cycles`; this is then divide by `n` operations. Making this per operation what is the >> average cycles taken for the round trip time. Hence `Total Average Cyeles/op` does not sound right, but `Average Cycles / op` does. > OK > My intention was to differentiate (since they have the same beginning). > >>> I think print format keep one-digit precision is enough. Also please modify CSV_TOTAL_LINE_FMT >>> make sure the csv also have same precision of Cycles/op. >> We have checked the CSV formatting a find >> 1. the precision for average cycle/op is 2 digits precision. >> 2. already the CVS format has average cycles/op integrated. >> >> Hence no change is required. > It's weird. > > We can see more clear when add together: > #define CSV_TOTAL_LINE_FMT "Scenario %u Summary, , , , , ,%u,%.2lf,%u,%.3lf,%.3lf\n" > snprintf(output_str[MAX_WORKER_NB], MAX_OUTPUT_STR_LEN, CSV_TOTAL_LINE_FMT, > cfg->scenario_id, nr_buf, memory * nb_workers, > avg_cycles_total / nb_workers, bandwidth_total, mops_total); > The bandwidth_total, mops_total both are float, which take last two "%.31f", then "%u" is for "avg_cycles_total / nb_workers" > > Also, avg_cycles_total / nb_workers both are u32, and its result is u32 if not with force convert. > > You could modify with "avg_cycles_total*1.0 / nb_workers", then compile will output warning: > > [2035/3727] Compiling C object app/dpdk-test-dma-perf.p/test-dma-perf_benchmark.c.o > ../../dpdk/app/test-dma-perf/benchmark.c: In function ‘mem_copy_benchmark’: > ../../dpdk/app/test-dma-perf/benchmark.c:26:28: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 7 has type ‘double’ [-Wformat=] > #define CSV_TOTAL_LINE_FMT "Scenario %u Summary, , , , , ,%u,%.2lf,%u,%.3lf,%.3lf\n" thank you Chengwen, let me share v2 for this patch with both print and csv in same format. > > Thanks > ^ >>> Thanks >>> >>>> snprintf(output_str[MAX_WORKER_NB], MAX_OUTPUT_STR_LEN, CSV_TOTAL_LINE_FMT, >>>> cfg->scenario_id, nr_buf, memory * nb_workers, >>>> avg_cycles_total / nb_workers, bandwidth_total, mops_total); >>>> >> .