Re: [PATCH v1 1/2] tools/rtla: Add for_each_monitored_cpu() helper

From: Tomas Glozar

Date: Wed Oct 29 2025 - 06:30:01 EST


čt 2. 10. 2025 v 14:36 odesílatel Costa Shulyupin
<costa.shul@xxxxxxxxxx> napsal:
>
> The rtla tools have many instances of iterating over CPUs while
> checking if they are monitored.
>
> Add a for_each_monitored_cpu() helper macro to make the code
> more readable and reduce code duplication.
>

Yeah this iteration is repeated many times.

> Signed-off-by: Costa Shulyupin <costa.shul@xxxxxxxxxx>
> ---
> tools/tracing/rtla/src/common.h | 4 ++++
> tools/tracing/rtla/src/osnoise_hist.c | 28 ++++++----------------
> tools/tracing/rtla/src/osnoise_top.c | 4 +---
> tools/tracing/rtla/src/timerlat.c | 9 ++------
> tools/tracing/rtla/src/timerlat_hist.c | 32 +++++++-------------------
> tools/tracing/rtla/src/timerlat_top.c | 4 +---
> 6 files changed, 23 insertions(+), 58 deletions(-)
>

Reviewed-by: Tomas Glozar <tglozar@xxxxxxxxxx>

Tomas