]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
tools/rtla: Generate optstring from long options
authorCosta Shulyupin <costa.shul@redhat.com>
Thu, 8 Jan 2026 09:49:55 +0000 (11:49 +0200)
committerTomas Glozar <tglozar@redhat.com>
Mon, 2 Mar 2026 13:53:41 +0000 (14:53 +0100)
commit4a1cec7450b7159a0ee57403f44460ac4d618b4f
tree4a5b7a7fb58dfd161a5fe53f1a5d4178b2f190c7
parent11439c4635edd669ae435eec308f4ab8a0804808
tools/rtla: Generate optstring from long options

getopt_long() processes short and long options independently.
RTLA, like the majority of applications, uses both short and long
variants for each logical option.

Since the val member of struct option holds the letter of the short
variant, the string of short options can be reconstructed from the
array of long options.

Add getopt_auto() to generate optstring from an array of long options,
eliminating the need to maintain separate short option strings.

Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Reviewed-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260108095011.2115719-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