[PATCH v2 0/5] tools/rtla: Improve argument processing

Costa Shulyupin posted 5 patches 2 months, 1 week ago
tools/tracing/rtla/src/osnoise_hist.c  | 74 +++++++++--------------
tools/tracing/rtla/src/osnoise_top.c   | 68 ++++++++-------------
tools/tracing/rtla/src/timerlat_hist.c | 82 ++++++++++----------------
tools/tracing/rtla/src/timerlat_top.c  | 76 +++++++++---------------
tools/tracing/rtla/src/timerlat_u.c    | 12 ++--
tools/tracing/rtla/src/utils.c         | 15 +++++
tools/tracing/rtla/src/utils.h         |  1 +
7 files changed, 128 insertions(+), 200 deletions(-)
[PATCH v2 0/5] tools/rtla: Improve argument processing
Posted by Costa Shulyupin 2 months, 1 week ago
The long-term goal of this patch series is to reduce code duplication
and unify argument display and parsing across all four tools.

Costa Shulyupin (5):
  tools/rtla: Add fatal() and replace error handling pattern
  tools/rtla: Replace timerlat_top_usage("...") with fatal("...")
  tools/rtla: Replace timerlat_hist_usage("...") with fatal("...")
  tools/rtla: Replace osnoise_top_usage("...") with fatal("...")
  tools/rtla: Replace osnoise_hist_usage("...") with fatal("...")

 tools/tracing/rtla/src/osnoise_hist.c  | 74 +++++++++--------------
 tools/tracing/rtla/src/osnoise_top.c   | 68 ++++++++-------------
 tools/tracing/rtla/src/timerlat_hist.c | 82 ++++++++++----------------
 tools/tracing/rtla/src/timerlat_top.c  | 76 +++++++++---------------
 tools/tracing/rtla/src/timerlat_u.c    | 12 ++--
 tools/tracing/rtla/src/utils.c         | 15 +++++
 tools/tracing/rtla/src/utils.h         |  1 +
 7 files changed, 128 insertions(+), 200 deletions(-)

-- 
2.51.0
Re: [PATCH v2 0/5] tools/rtla: Improve argument processing
Posted by Tomas Glozar 1 month, 2 weeks ago
so 11. 10. 2025 v 10:28 odesílatel Costa Shulyupin
<costa.shul@redhat.com> napsal:
>
> The long-term goal of this patch series is to reduce code duplication
> and unify argument display and parsing across all four tools.
>
> Costa Shulyupin (5):
>   tools/rtla: Add fatal() and replace error handling pattern
>   tools/rtla: Replace timerlat_top_usage("...") with fatal("...")
>   tools/rtla: Replace timerlat_hist_usage("...") with fatal("...")
>   tools/rtla: Replace osnoise_top_usage("...") with fatal("...")
>   tools/rtla: Replace osnoise_hist_usage("...") with fatal("...")

It's perhaps unnecessary to do one commit per <tool>_usage() change.
On the other hand, separating changes like this helps backporting (not
much relevant here but relevant in other case).

>
>  tools/tracing/rtla/src/osnoise_hist.c  | 74 +++++++++--------------
>  tools/tracing/rtla/src/osnoise_top.c   | 68 ++++++++-------------
>  tools/tracing/rtla/src/timerlat_hist.c | 82 ++++++++++----------------
>  tools/tracing/rtla/src/timerlat_top.c  | 76 +++++++++---------------
>  tools/tracing/rtla/src/timerlat_u.c    | 12 ++--
>  tools/tracing/rtla/src/utils.c         | 15 +++++
>  tools/tracing/rtla/src/utils.h         |  1 +
>  7 files changed, 128 insertions(+), 200 deletions(-)
>
> --
> 2.51.0
>

Otherwise, I agree. Especially the timerlat tools have so many
arguments that for a typical terminal size, you won't even see the
error message, as it will be pushed outside the view. I was not even
aware RTLA prints error messages in some of those cases, I thought it
just prints the help for some time.

For entire patchset:

Reviewed-by: Tomas Glozar <tglozar@redhat.com>

Tomas