[PATCH v2 1/5] app/testpmd: add trace save command

Ferruh Yigit ferruh.yigit at amd.com
Wed Jun 21 13:15:33 CEST 2023


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.

And what happens if this is called multiple times, or what happens on
the application exit, will it overwrite the file or fail?
Again please explain in the commit log.

> Signed-off-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
> ---
>  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 <rte_gro.h>
>  #endif
>  #include <rte_mbuf_dyn.h>
> +#include <rte_trace.h>
>  
>  #include <cmdline_rdline.h>
>  #include <cmdline_parse.h>
> @@ -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?


>  



More information about the dev mailing list