Skip to content

Commit b4275b2

Browse files
makelinuxlenticularis39
authored andcommitted
tools/rtla: Fix unassigned nr_cpus
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: 2f3172f ("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>
1 parent 671314f commit b4275b2

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

tools/tracing/rtla/Makefile.rtla

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export CC AR STRIP PKG_CONFIG LD_SO_CONF_PATH LDCONFIG
1818
FOPTS := -flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong \
1919
-fasynchronous-unwind-tables -fstack-clash-protection
2020
WOPTS := -O -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 \
21-
-Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized
21+
-Wp,-D_GLIBCXX_ASSERTIONS
2222

2323
ifeq ($(CC),clang)
2424
FOPTS := $(filter-out -flto=auto -ffat-lto-objects, $(FOPTS))

tools/tracing/rtla/src/timerlat.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ void timerlat_analyze(struct osnoise_tool *tool, bool stopped)
213213
void timerlat_free(struct osnoise_tool *tool)
214214
{
215215
struct timerlat_params *params = to_timerlat_params(tool->params);
216-
int nr_cpus, i;
216+
int nr_cpus = sysconf(_SC_NPROCESSORS_CONF);
217+
int i;
217218

218219
timerlat_aa_destroy();
219220
if (dma_latency_fd >= 0)

0 commit comments

Comments
 (0)