[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP4=nvT2oPtM73nfPkSJZ4612mcAPw1LWbHNrszFBVAmSJOVbw@mail.gmail.com>
Date: Wed, 7 Jan 2026 13:03:32 +0100
From: Tomas Glozar <tglozar@...hat.com>
To: Wander Lairson Costa <wander@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>, Crystal Wood <crwood@...hat.com>,
Ivan Pravdin <ipravdin.official@...il.com>, Costa Shulyupin <costa.shul@...hat.com>,
John Kacur <jkacur@...hat.com>, Tiezhu Yang <yangtiezhu@...ngson.cn>,
"open list:Real-time Linux Analysis (RTLA) tools" <linux-trace-kernel@...r.kernel.org>,
"open list:Real-time Linux Analysis (RTLA) tools" <linux-kernel@...r.kernel.org>,
"open list:BPF [MISC]:Keyword:(?:b|_)bpf(?:b|_)" <bpf@...r.kernel.org>
Subject: Re: [PATCH v2 07/18] rtla: Introduce common_restart() helper
Ășt 6. 1. 2026 v 14:42 odesĂlatel Wander Lairson Costa
<wander@...hat.com> napsal:
>
> A few functions duplicate the logic for handling threshold actions.
> When a threshold is reached, these functions stop the trace, perform
> actions, and restart the trace if configured to continue.
>
> Create a new helper function, common_restart(), to centralize this
> shared logic and avoid code duplication. This function now handles the
> threshold actions and restarts the necessary trace instances.
>
> Refactor the affected functions main loops to call the new helper.
> This makes the code cleaner and more maintainable.
>
The deduplication idea is good, but I find the name of the helper
quite confusing. The main function of the helper is not to restart
tracing, it is to handle a latency threshold overflow - restarting
tracing is only one of possible effects, and one that is only applied
when using --on-threshold continue which is not the most common use
case. Could something like common_handle_stop_tracing() perhaps be
better?
> +enum restart_result {
> + RESTART_OK,
> + RESTART_STOP,
> + RESTART_ERROR = -1,
> +};
Do we really need a separate return value enum just for this one helper?
Tomas
Powered by blists - more mailing lists