]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
tools/rtla: Fix unassigned nr_cpus
authorCosta Shulyupin <costa.shul@redhat.com>
Thu, 2 Oct 2025 17:08:45 +0000 (20:08 +0300)
committerTomas Glozar <tglozar@redhat.com>
Thu, 20 Nov 2025 12:15:54 +0000 (13:15 +0100)
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.

Signed-off-by: Costa Shulyupin <costa.shul@redhat.com>
Reviewed-by: Tomas Glozar <tglozar@redhat.com>
Fixes: 2f3172f9dd58 ("tools/rtla: Consolidate code between osnoise/timerlat and hist/top")
Link: https://lore.kernel.org/r/20251002170846.437888-1-costa.shul@redhat.com
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
tools/tracing/rtla/Makefile.rtla
tools/tracing/rtla/src/timerlat.c

index 08c1b40883d3aa3b718f21bbd1f9e0f56a375cc6..1743d91829d460353af771d57bb225c0dad5284b 100644 (file)
@@ -18,7 +18,7 @@ export CC AR STRIP PKG_CONFIG LD_SO_CONF_PATH LDCONFIG
 FOPTS          := -flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong   \
                -fasynchronous-unwind-tables -fstack-clash-protection
 WOPTS          := -O -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2             \
-               -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized
+               -Wp,-D_GLIBCXX_ASSERTIONS
 
 ifeq ($(CC),clang)
   FOPTS                := $(filter-out -flto=auto -ffat-lto-objects, $(FOPTS))
index 28ea4f6710c184cac98d82989b733e63bdf30759..df4f9bfe3433168d7f813cb5af4c375e0e52e65a 100644 (file)
@@ -213,7 +213,8 @@ void timerlat_analyze(struct osnoise_tool *tool, bool stopped)
 void timerlat_free(struct osnoise_tool *tool)
 {
        struct timerlat_params *params = to_timerlat_params(tool->params);
-       int nr_cpus, i;
+       int nr_cpus = sysconf(_SC_NPROCESSORS_CONF);
+       int i;
 
        timerlat_aa_destroy();
        if (dma_latency_fd >= 0)