[PATCH v1] tools/rtla: Add missing --quiet option to timerlat hist

Costa Shulyupin posted 1 patch 4 months ago
tools/tracing/rtla/src/timerlat_hist.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
[PATCH v1] tools/rtla: Add missing --quiet option to timerlat hist
Posted by Costa Shulyupin 4 months ago
The --quiet option is available in all other rtla tools and documented
in the usage string, but was accidentally omitted from timerlat hist.

Add the missing --quiet option to timerlat hist for consistency and to
avoid confusion when silencing its output.

Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
---
 tools/tracing/rtla/src/timerlat_hist.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/tracing/rtla/src/timerlat_hist.c b/tools/tracing/rtla/src/timerlat_hist.c
index 606c1688057b..983153b311ff 100644
--- a/tools/tracing/rtla/src/timerlat_hist.c
+++ b/tools/tracing/rtla/src/timerlat_hist.c
@@ -830,6 +830,7 @@ static struct common_params
 			{"nano",		no_argument,		0, 'n'},
 			{"period",		required_argument,	0, 'p'},
 			{"priority",		required_argument,	0, 'P'},
+			{"quiet",		no_argument,		0, 'q'},
 			{"stack",		required_argument,	0, 's'},
 			{"thread",		required_argument,	0, 'T'},
 			{"trace",		optional_argument,	0, 't'},
@@ -859,7 +860,7 @@ static struct common_params
 		/* getopt_long stores the option index here. */
 		int option_index = 0;
 
-		c = getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:i:knp:P:s:t::T:uU0123456:7:8:9\1\2:\3:",
+		c = getopt_long(argc, argv, "a:c:C::b:d:e:E:DhH:i:knp:P:qs:t::T:uU0123456:7:8:9\1\2:\3:",
 				 long_options, &option_index);
 
 		/* detect the end of the options. */
@@ -961,6 +962,9 @@ static struct common_params
 				timerlat_hist_usage("Invalid -P priority");
 			params->common.set_sched = 1;
 			break;
+		case 'q':
+			params->common.quiet = 1;
+			break;
 		case 's':
 			params->print_stack = get_llong_from_str(optarg);
 			break;
-- 
2.51.0
Re: [PATCH v1] tools/rtla: Add missing --quiet option to timerlat hist
Posted by Costa Shulyupin 4 months ago
On Wed, 8 Oct 2025 at 09:45, Costa Shulyupin <costa.shul@redhat.com> wrote:
>
> The --quiet option is available in all other rtla tools and documented
> in the usage string, but was accidentally omitted from timerlat hist.
>
> Add the missing --quiet option to timerlat hist for consistency and to
> avoid confusion when silencing its output.

Actually, osnoise hist also lacks the --quiet option, and this appears
to be intentional.
Re: [PATCH v1] tools/rtla: Add missing --quiet option to timerlat hist
Posted by Tomas Glozar 4 months ago
st 8. 10. 2025 v 10:46 odesílatel Costa Shulyupin
<costa.shul@redhat.com> napsal:
>
> Actually, osnoise hist also lacks the --quiet option, and this appears
> to be intentional.
>

Yeah, --quiet is used to suppress printing every second, hist has no
such functionality, so it doesn't do anything there. See:

[tglozar@cs9 rtla]$ grep -r 'params->common.quiet' src/*.c
src/osnoise_top.c:      if (!params->common.quiet)
src/osnoise_top.c:                      params->common.quiet = 1;
src/osnoise_top.c:      if (isatty(STDOUT_FILENO) && !params->common.quiet)
src/timerlat_top.c:     if (!params->common.quiet)
src/timerlat_top.c:                     params->common.quiet = 1;
src/timerlat_top.c:     if (isatty(STDOUT_FILENO) && !params->common.quiet)
src/timerlat_top.c:             wait_retval =
timerlat_bpf_wait(params->common.quiet ? -1 :
src/timerlat_top.c:             if (!params->common.quiet)

Tomas