aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2023-07-10 12:39:14 -0400
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-07-10 13:02:58 -0400
commit354dccca52e805ce1b22e2b62cbae8c265886c27 (patch)
tree7c9bf9489334dc8aa163df231f642ba44e7c42bd
parent56cbc522518a5f08e49788e18c45087ab5fda1e1 (diff)
downloadtrace-cmd-354dccca52e805ce1b22e2b62cbae8c265886c27.tar.gz
trace-cmd split: Do not append '.1' to single file if output specified
If the user specifies an output file, and it is not the same as the input file, and the '-r' (repeat) option is not specified, there's no reason to append the '.1' to the output file name. Just use what the user specified. Link: https://lore.kernel.org/linux-trace-users/VE1PR09MB3535FFA94A0481583EF7992CF230A@VE1PR09MB3535.eurprd09.prod.outlook.com/ Link: https://lore.kernel.org/linux-trace-devel/20230710123914.5a58be62@gandalf.local.home Suggested-by: Sharon Gabay <Sharon.Gabay@mobileye.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--tracecmd/trace-split.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tracecmd/trace-split.c b/tracecmd/trace-split.c
index 6412c194..4fda7813 100644
--- a/tracecmd/trace-split.c
+++ b/tracecmd/trace-split.c
@@ -546,7 +546,7 @@ void trace_split (int argc, char **argv)
if (!output)
output = strdup(input_file);
- if (!repeat) {
+ if (!repeat && strcmp(output, input_file) == 0) {
output = realloc(output, strlen(output) + 3);
strcat(output, ".1");
}