From 5f291d7af776585e4a2ae15e8f5902982926536d Mon Sep 17 00:00:00 2001 From: chenwei Date: Thu, 25 May 2023 15:29:11 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=BA=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8Ddump=20trace=E7=9A=84=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenwei --- bin/src/bytrace_cmd.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/src/bytrace_cmd.cpp b/bin/src/bytrace_cmd.cpp index 8463865..46d0991 100644 --- a/bin/src/bytrace_cmd.cpp +++ b/bin/src/bytrace_cmd.cpp @@ -45,6 +45,7 @@ struct option g_longOptions[] = { { "time", required_argument, nullptr, 0 }, // used to specify the time (in seconds) for trace to run. { "trace_begin", no_argument, nullptr, 0 }, { "trace_finish", no_argument, nullptr, 0 }, + { "trace_finish_ndump",no_argument, nullptr, 0 }, { "trace_dump", no_argument, nullptr, 0 }, { "list_categories", no_argument, nullptr, 0 }, { "overwrite", no_argument, nullptr, 0 }, @@ -427,6 +428,11 @@ static bool ParseControlOpt(int optionIndex, bool& isTrue) g_traceStop = true; g_traceDump = true; return true; + } else if (!strcmp(g_longOptions[optionIndex].name, "trace_finish_ndump")) { + g_traceStart = START_NONE; + g_traceStop = true; + g_traceDump = false; + return true; } else if (!strcmp(g_longOptions[optionIndex].name, "trace_dump")) { g_traceStart = START_NONE; g_traceStop = false; -- Gitee From f40feb10394df3f63f7ce13060c2996a372be922 Mon Sep 17 00:00:00 2001 From: chenwei Date: Thu, 25 May 2023 16:30:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=BA=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8Ddump=20trace=E7=9A=84=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenwei --- bin/src/bytrace_cmd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/src/bytrace_cmd.cpp b/bin/src/bytrace_cmd.cpp index 46d0991..3959f7f 100644 --- a/bin/src/bytrace_cmd.cpp +++ b/bin/src/bytrace_cmd.cpp @@ -45,7 +45,7 @@ struct option g_longOptions[] = { { "time", required_argument, nullptr, 0 }, // used to specify the time (in seconds) for trace to run. { "trace_begin", no_argument, nullptr, 0 }, { "trace_finish", no_argument, nullptr, 0 }, - { "trace_finish_ndump",no_argument, nullptr, 0 }, + { "trace_finish_ndump", no_argument, nullptr, 0 }, { "trace_dump", no_argument, nullptr, 0 }, { "list_categories", no_argument, nullptr, 0 }, { "overwrite", no_argument, nullptr, 0 }, -- Gitee From 7d748fbf89c14c91720b3c094a1def6b07926261 Mon Sep 17 00:00:00 2001 From: chenwei Date: Fri, 26 May 2023 12:49:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=BA=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8Ddump=20trace=E7=9A=84=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chenwei --- bin/src/bytrace_cmd.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/src/bytrace_cmd.cpp b/bin/src/bytrace_cmd.cpp index 3959f7f..32f19b3 100644 --- a/bin/src/bytrace_cmd.cpp +++ b/bin/src/bytrace_cmd.cpp @@ -45,7 +45,7 @@ struct option g_longOptions[] = { { "time", required_argument, nullptr, 0 }, // used to specify the time (in seconds) for trace to run. { "trace_begin", no_argument, nullptr, 0 }, { "trace_finish", no_argument, nullptr, 0 }, - { "trace_finish_ndump", no_argument, nullptr, 0 }, + { "trace_finish_nodump", no_argument, nullptr, 0 }, { "trace_dump", no_argument, nullptr, 0 }, { "list_categories", no_argument, nullptr, 0 }, { "overwrite", no_argument, nullptr, 0 }, @@ -398,6 +398,8 @@ static void ShowHelp(const string& cmd) " --trace_begin Starts capturing traces.\n" " --trace_dump Dumps traces to a specified path (stdout by default).\n" " --trace_finish Stops capturing traces and dumps traces to a specified path (stdout by default).\n" + " --trace_finish_nodump\n" + " Stops capturing traces and not dumps traces.\n" " --overwrite Sets the action to take when the buffer is full. If this option is used,\n" " the latest traces are discarded; if this option is not used (default setting),\n" " the earliest traces are discarded.\n" @@ -428,7 +430,7 @@ static bool ParseControlOpt(int optionIndex, bool& isTrue) g_traceStop = true; g_traceDump = true; return true; - } else if (!strcmp(g_longOptions[optionIndex].name, "trace_finish_ndump")) { + } else if (!strcmp(g_longOptions[optionIndex].name, "trace_finish_nodump")) { g_traceStart = START_NONE; g_traceStop = true; g_traceDump = false; -- Gitee