[RFC,1/5] app/testpmd: add trace dump command

Message ID 20230420100803.494-2-viacheslavo@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series net/mlx5: introduce Tx datapath tracing |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Slava Ovsiienko April 20, 2023, 10:07 a.m. UTC
  The "dump_trace" CLI command is added to trigger
saving the trace dumps to the trace directory.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 app/test-pmd/cmdline.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Comments

Jerin Jacob April 20, 2023, 10:13 a.m. UTC | #1
On Thu, Apr 20, 2023 at 3:39 PM Viacheslav Ovsiienko
<viacheslavo@nvidia.com> wrote:
>
> The "dump_trace" CLI command is added to trigger
> saving the trace dumps to the trace directory.
>
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---
>  app/test-pmd/cmdline.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 7b20bef4e9..be9e3a9ed6 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>
> @@ -8367,6 +8368,8 @@ static void cmd_dump_parsed(void *parsed_result,
>                 rte_lcore_dump(stdout);
>         else if (!strcmp(res->dump, "dump_log_types"))
>                 rte_log_dump(stdout);
> +       else if (!strcmp(res->dump, "dump_trace"))
> +               rte_trace_save();

Isn't saving the trace? If so, change the command to save_trace or so.

>  }
>
>  static cmdline_parse_token_string_t cmd_dump_dump =
> @@ -8379,7 +8382,8 @@ static cmdline_parse_token_string_t cmd_dump_dump =
>                 "dump_mempool#"
>                 "dump_devargs#"
>                 "dump_lcores#"
> -               "dump_log_types");
> +               "dump_log_types#"
> +               "dump_trace");
>
>  static cmdline_parse_inst_t cmd_dump = {
>         .f = cmd_dump_parsed,  /* function to call */
> --
> 2.18.1
>
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 7b20bef4e9..be9e3a9ed6 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>
@@ -8367,6 +8368,8 @@  static void cmd_dump_parsed(void *parsed_result,
 		rte_lcore_dump(stdout);
 	else if (!strcmp(res->dump, "dump_log_types"))
 		rte_log_dump(stdout);
+	else if (!strcmp(res->dump, "dump_trace"))
+		rte_trace_save();
 }
 
 static cmdline_parse_token_string_t cmd_dump_dump =
@@ -8379,7 +8382,8 @@  static cmdline_parse_token_string_t cmd_dump_dump =
 		"dump_mempool#"
 		"dump_devargs#"
 		"dump_lcores#"
-		"dump_log_types");
+		"dump_log_types#"
+		"dump_trace");
 
 static cmdline_parse_inst_t cmd_dump = {
 	.f = cmd_dump_parsed,  /* function to call */