This patch series enhances the robustness and maintainability of the RTLA (Real-Time Linux Analysis) tool through systematic improvements to error handling, code clarity, and consistency.
The changes strengthen defensive programming practices throughout the codebase by improving input validation and memory management. Several new helper functions and macros are introduced to reduce code duplication and provide safer, more readable alternatives to common operations. The series also consolidates duplicate logic across modules and adopts standard conventions where appropriate. These improvements make the code more resilient and easier to maintain while preserving existing functionality and behavior. Wander Lairson Costa (13): rtla: Check for memory allocation failures rtla: Use strdup() to simplify code rtla: Introduce for_each_action() helper rtla: Replace atoi() with a robust strtoi() rtla: Simplify argument parsing rtla: Use strncmp_static() in more places rtla: Introduce timerlat_restart() helper rtla: Use standard exit codes for result enum rtla: Exit if trace output action fails rtla: Remove redundant memset after calloc rtla: Replace magic number with MAX_PATH rtla: Remove unused headers rtla: Fix inconsistent state in actions_add_* functions tools/tracing/rtla/src/actions.c | 91 ++++++++++++++++++-------- tools/tracing/rtla/src/actions.h | 7 +- tools/tracing/rtla/src/osnoise.c | 6 +- tools/tracing/rtla/src/osnoise_hist.c | 1 - tools/tracing/rtla/src/timerlat.c | 36 +++++++++- tools/tracing/rtla/src/timerlat.h | 9 +++ tools/tracing/rtla/src/timerlat_hist.c | 32 +++++---- tools/tracing/rtla/src/timerlat_top.c | 27 ++++---- tools/tracing/rtla/src/timerlat_u.c | 4 +- tools/tracing/rtla/src/trace.c | 23 ++++--- tools/tracing/rtla/src/utils.c | 48 +++++++++++--- tools/tracing/rtla/src/utils.h | 23 +++++-- 12 files changed, 220 insertions(+), 87 deletions(-) -- 2.51.1
