diff mbox series

[v3] trace-cmd: List ftrace instances at the end of trace-cmd stat

Message ID 20200505101719.1856601-2-tz.stoyanov@gmail.com (mailing list archive)
State Accepted
Commit ff7882423c9affa27386e9e8492d928310144848
Headers show
Series [v3] trace-cmd: List ftrace instances at the end of trace-cmd stat | expand

Commit Message

Tzvetomir Stoyanov (VMware) May 5, 2020, 10:17 a.m. UTC
By default, "trace-cmd stat" command prints status of the main ftrace
instance. At top of the output there is a listing of all configured
instances abd the user could be confused which status is displayed.
Moved this list at the end of the command output.

Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
---
v3: Removed the "main" when top instance is displayed and move instance
    listing at the end of command's output.

 tracecmd/trace-stat.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tracecmd/trace-stat.c b/tracecmd/trace-stat.c
index c5057978..bd0e647a 100644
--- a/tracecmd/trace-stat.c
+++ b/tracecmd/trace-stat.c
@@ -920,8 +920,7 @@  static void stat_instance(struct buffer_instance *instance)
 			printf("---------------\n");
 		printf("Instance: %s\n",
 			tracefs_instance_get_name(instance->tracefs));
-	} else
-		report_instances();
+	}
 
 	report_plugin(instance);
 	report_events(instance);
@@ -937,6 +936,8 @@  static void stat_instance(struct buffer_instance *instance)
 	report_uprobes(instance);
 	report_traceon(instance);
 	report_errorlog(instance);
+	if (instance == &top_instance)
+		report_instances();
 }
 
 void trace_stat (int argc, char **argv)