]> git.ipfire.org Git - thirdparty/linux.git/commit
tools/rtla: Add common_usage()
authorCosta Shulyupin <costa.shul@redhat.com>
Mon, 24 Nov 2025 06:31:46 +0000 (08:31 +0200)
committerTomas Glozar <tglozar@redhat.com>
Wed, 7 Jan 2026 14:57:15 +0000 (15:57 +0100)
commita08e012e814d346c191726a877b18901c3bc204f
tree60ccad42ef4e94396c5ad67dbefcbb98fa30fc0b
parentc219d4ee1d63b772d5fa8ed453b9cec18a9e2f6a
tools/rtla: Add common_usage()

The rtla tools have significant code quadruplication in their usage
functions. Each tool implements its own version of the same help text
formatting and option descriptions, leading to maintenance overhead and
inconsistencies.  Documentation/tools/rtla/common_options.rst lists 14
common options.

Add common_usage() infrastructure to consolidate help formatting.
Subsequent patches will extend this to handle other common options.

The refactored output is almost identical to the original, with the
following changes:
- add square brackets to specify optionality: `usage: [rtla] ...`
- remove `-q` from timerlat hist because hist tools don't support it
- minor spacing

Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Link: https://lore.kernel.org/r/20251124063204.845425-1-costa.shul@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
tools/tracing/rtla/src/common.c
tools/tracing/rtla/src/common.h
tools/tracing/rtla/src/osnoise_hist.c
tools/tracing/rtla/src/osnoise_top.c
tools/tracing/rtla/src/timerlat_hist.c
tools/tracing/rtla/src/timerlat_top.c