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 ABAAC43B6C; Fri, 8 Mar 2024 03:40:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 32EE540291; Fri, 8 Mar 2024 03:40:06 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2088.outbound.protection.outlook.com [40.107.95.88]) by mails.dpdk.org (Postfix) with ESMTP id 5FC0540284 for ; Fri, 8 Mar 2024 03:40:04 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g6cRixqKIMO411V/AbeflzXwzXgKutA5vzpSaALCIEvnG4/g7gEOxdJFwpyGW0g/wqrqLer2mZ1L0GCl79ksVaHYYLdbdKO5ksJHfFmKHyAjfp8s0h9O0U9mFCAPhZL24LDPqmnCN8BC/KQ6cSBkKGCLQHqjhihmrZ0esEiGs+ErjhDQ1l5Ssu7ceUQsbmV3gyYpq8MajMEUVlgVyXoYhF57lueai0B+vP4u7/IpDW4FCgUiqrsuCvqJsalE7r+0/TXuGFUyhLmRhoHr7NlauGfqTcYbtIwxw6oAEbybYB9k4NYKzgyUgl7WnIwAo5sHoZXDwBy00IkYjH1f1oCmiQ== 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=wrR/WZCNM/4cI7nADumSigI3+1yIgetUgtKKbNeHdv0=; b=CpF9axwZ+g8mEXJv9I6aJ3jU5gM85lCiz9Z1+SWcNUDgrEykHJWTj6E9B/yVV2QiAae6dcLbzVr0g+N915aVzrgLS9y8Z5dnNMN5T9Auko/SPr4nR+ECoZI65Jok3ijwu5910Vp4lh9Mc45lThT/n5/CMbamIlqv3MFOBjKqkkRzV/Q5kBk6oPfbGHs++q8eIR3/fzLeuhvDu1O5ET75WlaEk7oKYR2TgfcZXGDaGJLiGvYgMmZKk0P/iWqg6VLqSMXXJHPhgCAVbxrU+XVNV0xBJNCiK8oox7HklbBc3c82gh7hhixkb2M5bY10n0ZIVWMOYDgaxJgjY7f8ZCCGOQ== 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=wrR/WZCNM/4cI7nADumSigI3+1yIgetUgtKKbNeHdv0=; b=HA1bj3lbhJSY3aZZ5Njymp4HYbUrn/1QDzWxqvPsawBLipEWKoRN7CKSAh7P6nRxgbjZJt0gKqtVg86tIuKhUqgkuAABp33xHd9jhEFeD54EGAvirVf3eLV9A5Y8cM8ENBLl/gXU9DVrwa2g0bkb/UQSA73nyYsnYQQAtdObpMY= 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 BL3PR12MB6596.namprd12.prod.outlook.com (2603:10b6:208:38f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.26; Fri, 8 Mar 2024 02:40:02 +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.7362.024; Fri, 8 Mar 2024 02:40:02 +0000 Content-Type: multipart/alternative; boundary="------------7C0vb1nCjF2ptr1AzVuuDt6z" Message-ID: <230a4d93-211a-45b8-a226-b188b765bdb3@amd.com> Date: Fri, 8 Mar 2024 08:09:55 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] app/dma-perf: add average latency per worker Content-Language: en-US To: fengchengwen , dev@dpdk.org Cc: ferruh.yigit@amd.com, neerav.parikh@amd.com References: <20231219164021.858-1-vipin.varghese@amd.com> <20240306150628.1417-1-vipin.varghese@amd.com> <0526dd9f-aeda-af3f-fd94-70392bd13fab@huawei.com> From: "Varghese, Vipin" In-Reply-To: <0526dd9f-aeda-af3f-fd94-70392bd13fab@huawei.com> X-ClientProxiedBy: BMXPR01CA0090.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:54::30) To PH7PR12MB8596.namprd12.prod.outlook.com (2603:10b6:510:1b7::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH7PR12MB8596:EE_|BL3PR12MB6596:EE_ X-MS-Office365-Filtering-Correlation-Id: d25a41d0-1ed7-402f-b3b8-08dc3f190dde X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: B0zQS8lWpYZtsh8v9Mnt9CbZHNRqtCtfa806JAUeGWZeE2V+ZADwiqISxfqgVMdKknKxA/jyrZ75HNWgtkhO75dd8x2GlAsz48d107eSdulbq3ORzKwn+D++KGxlt3oinJPQoKkSqT6C7JUetr2AccUv86nzgS7AVkm76oBeNcvnBC5ZXka/kSUO0QW3EW4+l9TiDuwR1mRML6cOv+UbqaHarL4twMEwRQ5goSc170kw39fGHwOyCDKYGkDgR/Mhg7CTjnHVshkwB8vuVbWV9kVSvzLyVi1u51kf8l9xUmrivYbroiO4lZU4xDMvRo5zw34t0AAwriT4SnuEZRoBeS2/kazIdr2nj5Ei8jb2OtrSNMpceHtoVNS2xO1PYGRKiqpA1Dw3yPLjF0HyDh49D2DNuHx+di0Om5z9+U27j7G5AREIyk/DsTWGfsRdaGyrywWt+VscmBKnRtTqBRKVN434sViz+/Rh8Lr72bR8wUFxvbImWd9ysbTAKsJv7AF8z13GO0MNRTIUshppyq7BkZuTbZi9XKxajRpQAhS3yBUW1WKDuxZKZcF745TvIbwF4bUtRjF3/m5jUC1OrvVq6CgpEPVDIXskoYpur54CWQJgQ6xOjBuXeVdUCtdU39Kn071ca9mSnCKyNpYI0T0faXcPUB73i5O/3at1JBdD1NQ= 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)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?WGo3ZnV5bC8wVy93WTZMaCtmQXJPcXNLRWo1dnB0L2Y3T1RITVVvTXI1NTlp?= =?utf-8?B?SUovRVFkR0RNWmNYNyt3czZTbWZPUjNyNGNlZnFwS01TRjFjQ3lrMkRWK0pI?= =?utf-8?B?VDI2WGk0TU1GNitxY2ZKL05mUmxpS25PSXZnTjlRV3grenVJTnlMcllIanhB?= =?utf-8?B?Z2dNNzlQWmR2OFlTbStRRUZ2WHJHVHc4QXZTZmhRaUhyOVVKekFvSHJWVzV5?= =?utf-8?B?cnYzTnVTaG0zZHVUcitETWd4b2Q0bTRNblhhRnluQlNJUVhyekd0U2hnZi85?= =?utf-8?B?NHR4QjNzTU9PMUN1blZmcGEyYkJVVWNvWThiRzBaOEc1NXR0ZjlFVmRTUm9U?= =?utf-8?B?VFdYTks2MnBOS0J6eGRsaC85WFhFS1NKQ3VTeWJmVzhzNlpOQnVvQktxU2Z6?= =?utf-8?B?SlhTWThYY1N0VVcvNHlzT2RFRG15bmIzWXpScDNVOTJ6dEVEU1B2dUhQMy9l?= =?utf-8?B?aURvWXcrdXJndkVXU2tESEZJU2FrbF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1THBpeW41VjdmUjgrdWxMd2UvMGZCZjVpSGFHeXJuNlVPNG5JTmo4?= =?utf-8?B?VzJGdTRJdW9UTzFITEFDZDl3OWh2NjV3angyN0V0RXNhcWFsOHV2Nk1tOGJx?= =?utf-8?B?b2VlZzNkU0tJL2p5eTZPZUttS0M1Z1FFOVpvVFJXYThVaHNMbzZvOERaTnRU?= =?utf-8?B?ZmZNVkg2L1BxcHArSlE4cnNVUVhzSkFyUmppVjhwbW1BVzYzcWJSYkg0Q3pj?= =?utf-8?B?aGRvNjYxK1ptbWFmNnhabU56aml0bnJWYlNmd1JOYXMzL29MN09BOFNzUkpa?= =?utf-8?B?KzMyVytSVE5XM2xRZWgvY0pYVExodzg5U3RJZmFtWlZBVHBVWlYzN0hUNmt0?= =?utf-8?B?OG5oS1hBMVRoRXZoTUdMZnhNVDV2TitoeElXMXhlUnAwTTBEZmRWMk82Qm1P?= =?utf-8?B?UTRIb0pHOFVIRXZmS0oxeWdjRzAybm1pME1BWWtiOU56WkN6aFN2QWhvc2oz?= =?utf-8?B?b1gvc1o5bTZQNTUvRmVhOElsaFlZWHhqQVVrK3ZTTmJtRUI0VDNwRkJtUlVT?= =?utf-8?B?Q1FmYzQ0SEkzdVlPbXJpOEZ6a1FiVmVYZnhDVk9wNVFzYjhaZ01ja0VDVXRX?= =?utf-8?B?S0hLaVArVmpMVWI1bXRjNTJ2Ym5LTHJtSHExdFhHNnl2Sk1xMHl3aC8zb2Ry?= =?utf-8?B?bW9aNmFDQ0VORXlyVnlldExSZ0E2blJXRjE3RTgwdzVDcWlXZVRkd0E3ZnZI?= =?utf-8?Q?krponi53cltu18CWv2aOegzVv?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d25a41d0-1ed7-402f-b3b8-08dc3f190dde X-MS-Exchange-CrossTenant-AuthSource: PH7PR12MB8596.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Mar 2024 02:40:02.2534 (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: xDkq0lKjLnFnR9WBWKkZR9w8l0kCZPDArbEEjL2gJuqgVm1/3rlffEU+Cx/ru/lwAYnF88kSJ8jI0uO63P3k1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6596 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 --------------7C0vb1nCjF2ptr1AzVuuDt6z Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit >> - printf("\nTotal Bandwidth: %.3lf Gbps, Total MOps: %.3lf\n", bandwidth_total, mops_total); >> + printf("\nAverage Cycles/op per worker: %.1f, Total Bandwidth: %.3lf Gbps, Total MOps: %.3lf\n", >> + (avg_cycles_total * (float) 1.0) / nb_workers, bandwidth_total, mops_total); >> 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); > As previous mentioned, please make sure the csv format and the above snprintf also modified (make sure stdout and csv has the same value). Hi Chengwen, the CSV_TOTAL_LINE_FMT already has `Cycles/op` with `%u`. I think you are asking to convert this to `%0.1f`to keep it same as `printf`. Sure I will share v3 for the same. --------------7C0vb1nCjF2ptr1AzVuuDt6z Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit <snipped>
-     printf("\nTotal Bandwidth: %.3lf Gbps, Total MOps: %.3lf\n", bandwidth_total, mops_total);
+     printf("\nAverage Cycles/op per worker: %.1f, Total Bandwidth: %.3lf Gbps, Total MOps: %.3lf\n",
+                     (avg_cycles_total * (float) 1.0) / nb_workers, bandwidth_total, mops_total);
      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);
As previous mentioned, please make sure the csv format and the above snprintf also modified (make sure stdout and csv has the same value).

Hi Chengwen, the CSV_TOTAL_LINE_FMT already has `Cycles/op` with `%u`. I think you are asking to convert this to `%0.1f` to keep it same as `printf`.

Sure I will share v3 for the same.

--------------7C0vb1nCjF2ptr1AzVuuDt6z--