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 3CCED42D2F; Fri, 23 Jun 2023 14:24:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1926241133; Fri, 23 Jun 2023 14:24:04 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2062.outbound.protection.outlook.com [40.107.100.62]) by mails.dpdk.org (Postfix) with ESMTP id 734F0406B8 for ; Fri, 23 Jun 2023 14:24:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PDH04yw6Aycj4HyBI1HvNT259/9T4XqemJTgFA++x4HE3QKa3M7WdPmik0vbj0gzBhqkaTu2eKHykwCcZCf1cwzabC7mhQ8f6kHMZ7IcnbTRjBVVp0HsleKfnn9OyOnDkgaVAG223n+ETJsrn6IcAOHtaSWDBoDhbXB3A39gzy5oZ+0NIOwkNLxzkR8tpWXNZYGFfX0hArsCGN3dAjq4PRlcnZDXyiMn/viYTt5+erOOEUIeCMTSwokI11sht8HNDXvZJ0wm5pYIt1jDWVwtwxAG9CcbfVntFtk8nBPKose663+Qn7XAaZnEZqkrAZspLBqH8RyZAgtSK8pHNyFJLw== 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=SzrKAQ2KYVZUcdUfnx0isLFnfw4V2aN7g6HvLT8vMTY=; b=doshL/JQZgeUn2Le4FsOtzoplOWuj7AJBOSbM38WjgzL3eCKFLn6V/xLxsZ/b7OUiIJqqdF+y4fVAyEkVCpMiAhrL+KB1vQAYvbvOKzNz0lNc/x+W9jKN6epDIYVVqby/dpihknbti89qO4MwvIggm3zCSe0POlrVg6y+nESxrWTJMgQ5G5Xi5PeKf2NpK3DFxcoel8CZswoQDMcUHD1L0ZhNUraHdh+dmmPMXuexOFRBA3rcc25/WAVnPj45ewu7d0Z5EbeLWooziSKzAoXPU4mZNGu/oBnulDI6s26xAVRTIs/bU/kuZNmWkKosOYH54K7TSyjSu981sw/jZ+naw== 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=SzrKAQ2KYVZUcdUfnx0isLFnfw4V2aN7g6HvLT8vMTY=; b=rm5yjBe5NoFm7D2GdycSsuyk/7k8T3R0EcSAehoq0Qlre2MnquOU1eNSXTqkHa1GPT8G6Fi6Ovg/OpGSxoxpEnq0tvgqDkpR/K9mNgsqFzf9BA7AwJ059LJ33ttpDyNryfC645vY4U/9P6LTbpo1S6jGHsi3OTAcmvKz3hU5cyk= 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 CH3PR12MB8331.namprd12.prod.outlook.com (2603:10b6:610:12f::10) 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 12:24:00 +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 12:24:00 +0000 Message-ID: <28bd9ac6-eb62-b426-61de-17080bedd6ef@amd.com> Date: Fri, 23 Jun 2023 13:23:54 +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: Jerin Jacob Cc: Slava Ovsiienko , Aman Singh , Jerin Jacob Kollanukkaran , "dev@dpdk.org" References: <20230420100803.494-1-viacheslavo@nvidia.com> <20230613165845.19109-1-viacheslavo@nvidia.com> <20230613165845.19109-2-viacheslavo@nvidia.com> <6ea523e0-12a1-99cd-5682-23537955f63b@amd.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: 8bit X-ClientProxiedBy: LNXP265CA0058.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::22) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CH3PR12MB8331:EE_ X-MS-Office365-Filtering-Correlation-Id: ae3a591d-fb0a-43a1-4618-08db73e4b943 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BXoCoRes4f8+HkUZv4gfB66ROc2T18lCCfIBgJy+jJ3WrTM0QBQ8kXGRiMqAWi5maT3cP8lIELpm2mGohOb9nF9uDEd/gzk7WmYBVOmP4J3CKqCtVSleoiCfmuZgfHkDer1VWnltdwiVoxrpkeFYnNNbpdU8+T3vqQI6DW9jrMamC7+RYe5rBC7ZAt9GDuf/tKqpEMR0W1JroksdSvkDrZF2y4+/L7Vefm5qYL8zZl6Kk0JvvDFjdrksBCbv4/9SvhQNHuDf6x4DIt/uZ3uoTdLp/jesFgSL2VuVUYAe3xMotcoThQRKYvrUZDEXWPGJAD7fk7JJCfpCuijDzprJ4ScwdjxIHrfYivgsm3D33RY/yohkqgPuZvbEDcdD4PticalNKSLbAVxDgdYzsU0LuKOyXzC09/XQ62zpTK60mMiIMToEBCEy3mmyjYK5YkOwMwWO7FJRPXHyMhdERm/8+t6blhnd6fHR1MskGREiCh681ZVbkuJXugDAOWcX7cMCQbsP72iNUOaCz6ZYhsrmHPRNbwa4DSC/O7PD+xakddWJaSBDvfnKm4DMpKUkHl5itBKu0h7nlh/2WmcB0t1vZETCWxuRp2PGUS7ARo7arT7M5bWAKO0lWpRbobbxnmJNimkUoSbF7oyMEF3GJzEuwA== 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)(366004)(346002)(396003)(376002)(39860400002)(136003)(451199021)(4326008)(316002)(6916009)(86362001)(8936002)(2616005)(8676002)(66476007)(31696002)(41300700001)(66946007)(66556008)(31686004)(6512007)(26005)(54906003)(6666004)(36756003)(5660300002)(44832011)(186003)(6506007)(53546011)(83380400001)(478600001)(6486002)(966005)(2906002)(38100700002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?emhOSkRTV25JcEs1endhbytNeDRhV0g4Z29RRVdyTXBSbXdpSVNSQ0FsNnpz?= =?utf-8?B?ZFhhcHNmL1FsaDBqRDlaT1hiZzN1d2dGM0RWTHIySEc1bjhDRGF6Zy9mdEFy?= =?utf-8?B?Um5qVGpHQm9oQSswdkhLeGVDeEtnMHFReGpzUU83a01FcDB3WXhXVWk1eVZX?= =?utf-8?B?Q0creUlGaGF6cVRrV29kOVpZVzFIeERqeVpRWDQ0QlhvbVd2d0hWamZMTDY0?= =?utf-8?B?di9ydHRTWUhib0NiblJseEU2bnFZV1FrWGd6SlFBZGVaSHFxVi9tVUk3K3Rx?= =?utf-8?B?aytMdjY1ci9pQmh1amZYRkR1TDNldkJZMGx5OU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5?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: ae3a591d-fb0a-43a1-4618-08db73e4b943 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2023 12:24:00.2731 (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: ZjIuIqDukosYbHX+Rarymvhpvrrw3h7slGeEhvfOEHFB9qHUmkDBYYVdQbCOE/oX X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8331 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 1:03 PM, Jerin Jacob wrote: > On Fri, Jun 23, 2023 at 5:23 PM Ferruh Yigit wrote: >> >> 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'? > > dump_* commands dumping on stdout or FILE. > Trace is mostly saving "current trace buffer" it and internally it > figure out the FILE. > Agree that 'save' can be more accurate, but 'dump_*' is more consistent. Saving trace buffer to a file, or dumping content of trace buffer to a file, looks close enough to me. > But no strong opinion, if testpmd user thinks "dump" is better. > OK, lets continue with 'dump_trace'.