summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorWander Lairson Costa <wander@redhat.com>2026-03-09 16:46:16 -0300
committerTomas Glozar <tglozar@redhat.com>2026-03-10 10:32:37 +0100
commit989e5b8f0c5302cfb233fa2db49f8877b5f1352d (patch)
tree49d902edd9b15dc5b057608f28ab593038931d5e /tools/perf/scripts/python
parentb8f7f49a23897fc772373da513a1cb6d51e5958e (diff)
rtla/actions: Simplify argument parsing
The actions_parse() function uses open-coded logic to extract arguments from a string. This includes manual length checks and strncmp() calls, which can be verbose and error-prone. To simplify and improve the robustness of argument parsing, introduce a new extract_arg() helper macro. This macro extracts the value from a "key=value" pair, making the code more concise and readable. Also, introduce STRING_LENGTH() and strncmp_static() macros to perform compile-time calculations of string lengths and safer string comparisons. Refactor actions_parse() to use these new helpers, resulting in cleaner and more maintainable code. Signed-off-by: Wander Lairson Costa <wander@redhat.com> Link: https://lore.kernel.org/r/20260309195040.1019085-4-wander@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions