summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorTomas Glozar <tglozar@redhat.com>2026-06-29 10:36:51 +0200
committerTomas Glozar <tglozar@redhat.com>2026-08-05 10:14:40 +0200
commitdeaec85cd8bad3841412ff8cefec463f2688806b (patch)
tree5e9d765352d38fa975e41430199cb4148839d320 /tools/perf/scripts/python/stackcollapse.py
parent075b74841bd0065a3bda3440873c747938e69b68 (diff)
rtla: Allow unsetting non-list custom-callback CLI options
libsubcmd implicitly allows the user to unset already set options using a "no-" prefix for long options. For example, if I set the period like this: $ rtla timerlat -D Loading BPF program reading osnoise/timerlat_period_us returned 1000 setting osnoise/timerlat_period_us to 1000 reading osnoise/print_stack returned 0 setting osnoise/print_stack to 0 ... <timerlat top> it can be unset by a subsequent --no-debug: $ rtla timerlat -D --no-debug ... <timerlat top> Currently, this works only for boolean options. Extend the feature for all options by implementing handling of the "unset" argument in opt_*() callbacks defined in cli_p.h, except for list options, i.e. options that can be passed multiple times (--event, --filter, --trigger, --on-threshold, --on-end). This allows, for example, unsetting of int/long long options, e.g. "-p": $ rtla timerlat -D -p100 --no-period ... setting osnoise/timerlat_period_us to 1000 ... By default, options in params struct are reset to zero. A constant is added for every parameter with a different default value, which is then used both in <tool>_hist_args() while setting the initial value and in opt_*() when unsetting the option. This refactoring ensures there is no duplicate "magic number". The default value for opt_llong_callback() and opt_int_callback() is passed in struct option's defval field; new macros RTLA_OPT_{LLONG,INT}{,_DEFVAL} are added to define the field conveniently. The default value for other callbacks is hardcoded inside each callback's unset logic. Reviewed-by: Wander Lairson Costa <wander@redhat.com> Link: https://lore.kernel.org/r/20260629083654.1548925-1-tglozar@redhat.com Signed-off-by: Tomas Glozar <tglozar@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions