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 1B62442D2F; Fri, 23 Jun 2023 14:04:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E97A42C4D; Fri, 23 Jun 2023 14:04:17 +0200 (CEST) Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) by mails.dpdk.org (Postfix) with ESMTP id 679F3406B8 for ; Fri, 23 Jun 2023 14:04:16 +0200 (CEST) Received: by mail-vs1-f46.google.com with SMTP id ada2fe7eead31-440c14d6a5eso170927137.0 for ; Fri, 23 Jun 2023 05:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687521855; x=1690113855; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=77FkmmQmc/3Odgla9CVs6vAemBev7oNwjMgyWWXxr1M=; b=JZAUcL4k+evQc7RUGV/3EO5C7ntXfsIPApPHbCHctrnj4hXRNYJO+hJ5z1dkTM9Ngf HhlvUv8NlonH7SNAwdX1XDT8FB1LxfMeyQpIqYoqRtXRhg/cRBXTysRTasgWApj2LE1k eeONH+VmKz2LMonRt8XlxitZxVHJQcaAyRTeBpRJl0QJQnyaXPHOpDWfiTcIGrwWihhG BTdwtYgZOB4JYHEuKDvw8+T9d82O8nn6YfZivCcukuY+Y2CPsQbhoQPXau+J/9tdAD/n l3iOgzEiv041meUF3ZGFK5X+VmETIpvY4Fke2XZbEDQ1O9FtdaEYBk8KVIO530MJlF1b eCOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687521855; x=1690113855; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=77FkmmQmc/3Odgla9CVs6vAemBev7oNwjMgyWWXxr1M=; b=YiZw3K8w+2ZDGr5lmPppTjbDRYPHH+2aKiQJoK8eQrqrvyWF2IlbegHvntArU9vdtY rsQ6BzZumT1im8Wc1f4cpJ7WI4UKZf8RkCDX97vLnWEtN24xtGgF/qNxB0OS9/wQPHRE gu2uYpWVvYnBQr14jc3cpZGGudUctAjs6OymkzkAo1q/ZvYucHOLxlQJWoocsaJnOdQ5 ZNvyOQqnC0JI521WECGoEtNdpJ1W9ZTNFwAM/iqiFw9DskaXhdo4SsNabqEyD2y5smXe Lp0dxVMfsXF4JncPa2LM9UnonNjthukiDrc9kM25qyHM8D955mFL71gFns4SiSPen/m1 /jCQ== X-Gm-Message-State: AC+VfDwbebYkgO0/hQR5iooPgZ9ccq0yxqE4B+xJizPsaBwQahZxgnxy I6vSiwQTqgy2UJ5JVPSgMbLNCHWl9Z4MWo1mygQ= X-Google-Smtp-Source: ACHHUZ4huaAlDK6qbrU2zPXms5/cUK5RpTxlmrvpfXcm3cTUKsTwDs+Tk1rojJ7PvTOEQOJRoyx5ole3/9Idxjba+74= X-Received: by 2002:a67:fc08:0:b0:440:af3c:4c18 with SMTP id o8-20020a67fc08000000b00440af3c4c18mr8982969vsq.5.1687521855488; Fri, 23 Jun 2023 05:04:15 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <6ea523e0-12a1-99cd-5682-23537955f63b@amd.com> From: Jerin Jacob Date: Fri, 23 Jun 2023 17:33:49 +0530 Message-ID: Subject: Re: [PATCH v2 1/5] app/testpmd: add trace save command To: Ferruh Yigit Cc: Slava Ovsiienko , Aman Singh , Jerin Jacob Kollanukkaran , "dev@dpdk.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Fri, Jun 23, 2023 at 5:23=E2=80=AFPM 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 fo= r this, can > >> you please detail in the commit log. > > > > OK, will update the commit log. The command "save_trace" is useful in s= ome > > 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 =3D { > >>> }, > >>> }; > >>> > >>> +#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 =3D 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 =3D > >>> + 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-h5RzL02TMQBsmoW= 721ds7A@mail.gmail.com/#t > > > > So, I have changed to "save_trace". I have no strong opinion about comm= and 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. But no strong opinion, if testpmd user thinks "dump" is better. >