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 B0A4942D2F; Fri, 23 Jun 2023 13:53:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3DD0A42C4D; Fri, 23 Jun 2023 13:53:42 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2057.outbound.protection.outlook.com [40.107.92.57]) by mails.dpdk.org (Postfix) with ESMTP id DCA10406B8 for ; Fri, 23 Jun 2023 13:53:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U+bpUFOEKEJpm856Dc0EUTBBLQEd2KF1ofbk+4X9+uysn4KTFczsHHhN0Zod3bMIB7RuI8BT+gxnMDV+cVhi8mEXE7k7jwEvMlAlgLIqsukGB4XNjspjHQUra/lb9wLuPO2D57F9QFhTz/y9NZfOzKIK4T5jOTyAICnBbBOhylYFZB8/hl0mLzWwcbCD2jEVHwe93KH91O0HT5yic8pm56w3M6+nsgE9e+cjvL4eXeB8xGE0qptuuxo0eORhD6H8tDQnvk4lcwLhyyHmRfpDWF4gl9rDdF22dDbKVA0piV3oDV4zjvTNkxBCjXZAvH3DRoYt1Ky+F5h1zjR1mUKwJg== 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=yzJCAwb42mt/lK4xMsKBCMuf2vqBbMqd98IQc34cQ/g=; b=TRnOqLdl6F6fGj+D/vrx3gGJLHADsXpG+klNkUqyGfovoh1JdyURBhyDSG0N5mS8pDBmJ9l0lbar9q8joP0riiqgJwn7UKlJFRS1RuLMAkP965hNRLzl7oTcQM1eTlcxOGUuT7EA/q2rcGP3grAi/nUngZnuZpKHaLCyFAwOoxhN9HfcuYas8njzH2C1EdLv2A3SbPMSLt6ODcZKsOVjsJ59gOmAS9h9SIhz62qRHb3lCmCeTwv5qKm5Y27cusrylWWOx4pjH714Zq5aGSLxbsD5Txzn0e+3V/tIE33tAvnF1xqwZBx2xys7I49N5Q2l5/DbIhYcOCr1WG04pUj1QA== 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=yzJCAwb42mt/lK4xMsKBCMuf2vqBbMqd98IQc34cQ/g=; b=pBRUaBa8HB9PqYcqiXSkgZ1wUV4qtFb5ygu2lnzgAjdF5ss47wRBeqcEaf8XeHTnfJip1dcjqAWpvir9c3K8/i5AMOdsZ/9ciLrgWT3QUWVwJ7QJtsMK00qYIm6TtbbnUKzKIzSzv3FjM831AOxQHYcCnfO0TlS3Ah6lYIYAYMU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by SA0PR12MB4575.namprd12.prod.outlook.com (2603:10b6:806:73::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Fri, 23 Jun 2023 11:53:38 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::16e3:326c:5c2a:be42]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::16e3:326c:5c2a:be42%3]) with mapi id 15.20.6521.024; Fri, 23 Jun 2023 11:53:38 +0000 Message-ID: <6ea523e0-12a1-99cd-5682-23537955f63b@amd.com> Date: Fri, 23 Jun 2023 12:52:27 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Content-Language: en-US To: Slava Ovsiienko , Aman Singh , Jerin Jacob Kollanukkaran Cc: "dev@dpdk.org" References: <20230420100803.494-1-viacheslavo@nvidia.com> <20230613165845.19109-1-viacheslavo@nvidia.com> <20230613165845.19109-2-viacheslavo@nvidia.com> From: Ferruh Yigit Subject: Re: [PATCH v2 1/5] app/testpmd: add trace save command In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LNXP265CA0088.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:76::28) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SA0PR12MB4575:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d0c0925-7d52-4f51-5f57-08db73e07b45 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: es4h1pF9IQdO+5CgpvUHY1ZsKfYsemTLIbedxBz9pgaAQ8OUnch+U7+P+7diZDK98WWX8OIzVyF0e00JLJLvr6wJe4fU+xadDNVRmwbQqp5rasKr3osrxT5uc078SMnxkLwg3+KLz+PrkhynuPxiX8iL69FRzctmiZAr+x3XIJtOIPsrBaJCSQ+CA5lDOnkuae5hikV4EbRCka0kD/WodnMPE3Ou7s9jEihOUClmDvqjKL+pYaWx/KQJtdAoBXTDiSfjluiiXF8WU5sh+BzcSi81Gc+NOIILHu0NjlaUL5e/cqIvs7D5WQDTcC+6SdMqTviDYnbl9RWH9s3Q1AcOsc+TTlaH/ay0a2tVOK/5CqBcPeJN0KdChDPynNTqHg/J0OFcXPApwSrTPC6Mi2oh8jxP8yeahkkG5aNpOTU9hN59V1ydLl3LHpQTn6AqHjw3mqQEKU4MftzEvQlLQFXzfLzZK8dGotNFyW3mxh04R6z06JFMHjh/MOI/JyurGkvt/FOw6bAsUgDcOVIjxEFRortTp7+Bf8dBHEqaEXXCX1KvV9+tes+1XNYI3voNkXlD8roVPZfRiKPUQ2Wr/bu6do3tYzbAa9gIh1sQgpMH+Q8K6tWA6tCGemDdbDqtgEynxIvESb1+bfX5NNCTC4H6BA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(346002)(136003)(366004)(376002)(396003)(39860400002)(451199021)(478600001)(31696002)(86362001)(38100700002)(8676002)(41300700001)(66946007)(66476007)(8936002)(66556008)(2616005)(316002)(44832011)(83380400001)(53546011)(5660300002)(6506007)(6486002)(6666004)(966005)(6512007)(4326008)(186003)(26005)(110136005)(2906002)(31686004)(36756003)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QW9ENjMwMlc2VVhoS2NTWjJXblpETlU0aTlOeWxYSEFMV0lVV05sMlZJTU4w?= =?utf-8?B?MzEyZGFMdmdLV1czWUNQQXVpOVRoWGJlU04rMW5OZ3ZMVkdpK1FoNW9HSFNI?= =?utf-8?B?dS9YeGQzSXdkSlZCUXVtNnRET2pEL05hQ0ZJMGdaMFZ5UmxVMkNsZUxZenI5?= =?utf-8?B?R0tRdUNsZ2JEcGZvOUxUT0NoNzJZK2VZUmZHZ0dXODFoQm5zZlkxbXNjZlRz?= =?utf-8?B?KzhUSE5vcHpFT1pxQTNkTDN1UEIzSXFlemhjTmt5VFhJSGk3L0hFTllsYnk4?= =?utf-8?B?ZkRaeGx2VnBSdlNGeURYK2tFazJReEVQQVRHRXZwWnVpeE5sUGVITWYyaWRZ?= =?utf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: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d0c0925-7d52-4f51-5f57-08db73e07b45 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2023 11:53:38.5343 (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: etfVtJBPt1JH4pJ7uNJ1is2GpvLL/W6ojvGPN5KhVyo0V0mnC+U3SkTcb1w/Nsvk X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4575 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 6/23/2023 9:00 AM, Slava Ovsiienko wrote: > Hi, Ferruh > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Wednesday, June 21, 2023 2:16 PM >> To: Slava Ovsiienko ; dev@dpdk.org; Aman Singh >> >> Cc: Jerin Jacob Kollanukkaran >> Subject: Re: [PATCH v2 1/5] app/testpmd: add trace save command >> >> On 6/13/2023 5:58 PM, Viacheslav Ovsiienko wrote: >>> The "save_trace" CLI command is added to trigger saving the trace >>> dumps to the trace directory. >>> >> >> Hi Viacheslav, >> >> Trace is already saved when dpdk application terminated, I guess this is to >> save the trace before exiting the application, what is the use case for this, can >> you please detail in the commit log. > > OK, will update the commit log. The command "save_trace" is useful in some > dynamic debug scenarios to save the trace without restarting the entire application. > >> >> And what happens if this is called multiple times, or what happens on the >> application exit, will it overwrite the file or fail? > It overwrites. > >> Again please explain in the commit log. > Sure, will do. > >> >>> Signed-off-by: Viacheslav Ovsiienko >>> --- >>> app/test-pmd/cmdline.c | 38 ++++++++++++++++++++++++++++++++++++++ >>> 1 file changed, 38 insertions(+) >>> >> >> Can you please update documentation too? >> >>> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index >>> a15a442a06..db71ce2028 100644 >>> --- a/app/test-pmd/cmdline.c >>> +++ b/app/test-pmd/cmdline.c >>> @@ -39,6 +39,7 @@ >>> #include >>> #endif >>> #include >>> +#include >>> >>> #include >>> #include >>> @@ -12745,6 +12746,40 @@ static cmdline_parse_inst_t >> cmd_config_tx_affinity_map = { >>> }, >>> }; >>> >>> +#ifndef RTE_EXEC_ENV_WINDOWS >>> +/* *** SAVE_TRACE *** */ >>> + >>> +struct cmd_save_trace_result { >>> + cmdline_fixed_string_t save; >>> +}; >>> + >>> +static void cmd_save_trace_parsed(__rte_unused void *parsed_result, >>> + __rte_unused struct cmdline *cl, >>> + __rte_unused void *data) >>> +{ >>> + int rc; >>> + >>> + rc = rte_trace_save(); >>> + if (rc) >>> + printf("Save trace failed with error: %d\n", rc); >>> + else >>> + printf("Trace saved successfully\n"); } >>> + >>> +static cmdline_parse_token_string_t cmd_save_trace_save = >>> + TOKEN_STRING_INITIALIZER(struct cmd_save_trace_result, save, >>> +"save_trace"); >>> + >> >> We have dump_* commands, what do you think to have 'dump_trace' >> command for this? > It was initially (in v1) with "dump_trace" command. > And there is the comment by Jerin: > https://inbox.dpdk.org/dev/CALBAE1Of79a_jHnFT3KX--Enhud-h5RzL02TMQBsmoW721ds7A@mail.gmail.com/#t > > So, I have changed to "save_trace". I have no strong opinion about command name, any allowing trace save is OK for me. > Ah, I missed that. @Jerin, I just saw your comment, agree more exact action can be 'save' but 'dump' also describes enough. Since there are existing 'dump_*' commands, it makes command more intuitive and easy to remember. As an active user of testpmd myself, I am finding it hard to remember/find the command I need as number of commands increased. That is why I am paying extra attention to have more hierarchical, consistent and intuitive commands. For me "dump_trace" works better in that manner, what do you think, do you have strong opinion on 'save_trace'?