Re: [PATCH v1] tools/rtla: Fix unassigned nr_cpus
From: Tomas Glozar
Date: Wed Oct 29 2025 - 09:58:23 EST
čt 2. 10. 2025 v 19:09 odesílatel Costa Shulyupin
<costa.shul@xxxxxxxxxx> napsal:
>
> In recently introduced timerlat_free(),
> the variable 'nr_cpus' is not assigned.
>
> Assign it with sysconf(_SC_NPROCESSORS_CONF) as done elsewhere.
> Remove the culprit: -Wno-maybe-uninitialized. The rest of the
> code is clean.
I suspected that the warning was disabled because of issues with an
old version of GCC, but that is not the case: I tried building RTLA on
RHEL 7 with GCC 4.8, and got no warnings, beside the real bug that you
fix here.
Therefore, it can be removed, so that such bugs are caught in the future.
>
> Signed-off-by: Costa Shulyupin <costa.shul@xxxxxxxxxx>
> ---
> tools/tracing/rtla/Makefile.rtla | 2 +-
> tools/tracing/rtla/src/timerlat.c | 3 ++-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
Reviewed-by: Tomas Glozar <tglozar@xxxxxxxxxx>
Tomas