[v3] app/testpmd: add trace dump command

Message ID 20230626110734.14126-1-viacheslavo@nvidia.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v3] app/testpmd: add trace dump command |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation fail Compilation issues

Commit Message

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

The tracing data are saved according to the EAL configuration
(explicit --trace-dir EAL command line parameter alters
the target folder to save). The result dump folder gets the name
like rte-YYYY-MM-DD-xx-HH-MM-SS format.

This command is useful to get the trace date without exiting
testpmd application and to get the multiple dumps to observe
the situation in dynamics.

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

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index c6690887d3..70b598c64e 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8372,6 +8372,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 =
@@ -8384,7 +8386,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 */