Skip to contentSkip to conversation

trace-cmd extract: Do not extract top level unless told to

PATCH New Steven Rostedt 1 participant 1 message Jun 1, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd extract: Do not extract top level unless told to

From: Steven Rostedt (Google) <[email protected]>

The trace-cmd extract man pages explicitly states that if the '-B' option is used, it will only extract the given instance and not touch any other buffer instance including the top level, unless '-t' is given (for the top level) or '-a' (for all instances). But currently it is hard coded to extract the top level. Make extract only touch what it is told according to the documentation.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=217340

---

tracecmd/trace-record.c +1 -1
index f852aa71..56b7991a 100644
@@ -7278,7 +7278,7 @@ void trace_extract(int argc, char **argv)
 
 	type = get_trace_cmd_type(ctx.curr_cmd);
 
-	update_first_instance(ctx.instance, 1);
+	update_first_instance(ctx.instance, ctx.topt);
 	check_function_plugin();
 
 	if (!ctx.output)