[PATCH] trace-cmd show: Update help message for --hist and --trigger options

Steven Rostedt <[email protected]> Fri, 11 Apr 2025 09:13:53 -0400
Newsgroups org.kernel.vger.linux-trace-devel
Message-ID <[email protected]>
From: "Steven Rostedt (Google)" <[email protected]>

The trace-cmd show help message was missing the --hist and --trigger
options. These are quite useful options and should be visible to the user
and not hidden as Easter eggs!

Also update the bash completion script to help out with the event list.

Fixes: 3e930655b ("trace-cmd show: Add --hist and --trigger options")
Signed-off-by: Steven Rostedt (Google) <[email protected]>
---
 tracecmd/trace-cmd.bash | 4 ++++
 tracecmd/trace-usage.c  | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/tracecmd/trace-cmd.bash b/tracecmd/trace-cmd.bash
index 1bf4bc1b..c500ef0d 100644
--- a/tracecmd/trace-cmd.bash
+++ b/tracecmd/trace-cmd.bash
@@ -139,6 +139,10 @@ __trace_cmd_show_complete()
 	-B)
 	    show_instances "$cur"
 	    ;;
+	--hist|--trigger)
+	    local list=`list_events $cur`
+	    COMPREPLY=( $(compgen -W "all ${list}" -- "${cur}") )
+	    ;;
 	*)
 	    cmd_options show "$cur"
 	    ;;
diff --git a/tracecmd/trace-usage.c b/tracecmd/trace-usage.c
index 9884631d..3fd975c0 100644
--- a/tracecmd/trace-usage.c
+++ b/tracecmd/trace-usage.c
@@ -177,6 +177,8 @@ static struct usage_help usage_help[] = {
 		"          -f display the file path that is being dumped\n"
 		"          The following options shows the corresponding file name\n"
 		"           and then exits.\n"
+		"          --hist event (show the hist file of an event)\n"
+		"          --trigger event (show the trigger file of an event)\n"
 		"          --tracing_on\n"
 		"          --current_tracer\n"
 		"          --buffer_size (for buffer_size_kb)\n"
-- 
2.47.2