Skip to content

Commit 4ffbe87

Browse files
captain5050acmel
authored andcommitted
perf tools: Fix SMT detection fast read path
sysfs__read_int() returns 0 on success, and so the fast read path was always failing. Fixes: bb62948 ("perf tools: Simplify checking if SMT is active.") Signed-off-by: Ian Rogers <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: John Garry <[email protected]> Cc: Kajol Jain <[email protected]> Cc: Kan Liang <[email protected]> Cc: Konstantin Khlebnikov <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Clarke <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent cba43fc commit 4ffbe87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/util/smt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ int smt_on(void)
1515
if (cached)
1616
return cached_result;
1717

18-
if (sysfs__read_int("devices/system/cpu/smt/active", &cached_result) > 0)
18+
if (sysfs__read_int("devices/system/cpu/smt/active", &cached_result) >= 0)
1919
goto done;
2020

2121
ncpu = sysconf(_SC_NPROCESSORS_CONF);

0 commit comments

Comments
 (0)