]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rtla: Use str_has_prefix() for option prefix check
authorWander Lairson Costa <wander@redhat.com>
Mon, 9 Mar 2026 19:46:26 +0000 (16:46 -0300)
committerTomas Glozar <tglozar@redhat.com>
Wed, 11 Mar 2026 14:29:50 +0000 (15:29 +0100)
commitea5ea8359cd68037d8a093df67d55b750818ab8f
treecb3d15b7ec883aa828c7a642957ef24807c638b6
parentb3910a739235f89f616345dda1f8303d9ccb99fb
rtla: Use str_has_prefix() for option prefix check

The argument parsing code in timerlat_main() and osnoise_main() uses
strncmp() with a length of 1 to check if the first argument starts
with a dash, indicating an option flag was passed.

Replace this pattern with str_has_prefix() for consistency with the
rest of the codebase. While character comparison would be slightly
more efficient, using str_has_prefix() provides better readability
and maintains a uniform coding style throughout the rtla tool.

Signed-off-by: Wander Lairson Costa <wander@redhat.com>
Link: https://lore.kernel.org/r/20260309195040.1019085-14-wander@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
tools/tracing/rtla/src/osnoise.c
tools/tracing/rtla/src/timerlat.c