]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rtla/timerlat: Simplify RTLA_NO_BPF environment variable check
authorWander Lairson Costa <wander@redhat.com>
Mon, 9 Mar 2026 19:46:27 +0000 (16:46 -0300)
committerTomas Glozar <tglozar@redhat.com>
Wed, 11 Mar 2026 14:29:50 +0000 (15:29 +0100)
commit48fbcd4db34b5ea9135801ffe4585a22681c0815
treed2bcdecea030dc4dd65fb9f6b18848f9b09ab71e
parentea5ea8359cd68037d8a093df67d55b750818ab8f
rtla/timerlat: Simplify RTLA_NO_BPF environment variable check

The code that checks the RTLA_NO_BPF environment variable calls
getenv() twice and uses strncmp() with a length of 2 to compare
against the single-character string "1". This is inefficient and
the comparison length is unnecessarily long.

Store the result of getenv() in a local variable to avoid the
redundant call, and replace strncmp() with strncmp_static() for
the exact match comparison. This follows the same pattern
established in recent commits that improved string comparison
consistency throughout the rtla codebase.

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