Skip to content

Commit 6dd8646

Browse files
captain5050acmel
authored andcommitted
perf tools: Probe non-deprecated sysfs path 1st
Following Documentation/ABI/stable/sysfs-devices-system-cpu the /sys/devices/system/cpu/cpuX/topology/core_cpus is deprecated in favor of thread_siblings, so probe thread_siblings before falling back on core_cpus. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John Garry <john.garry@huawei.com> Cc: Kajol Jain <kjain@linux.ibm.com> Cc: Kan Liang <kan.liang@linux.intel.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Clarke <pc@us.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: https://lore.kernel.org/r/20211124001231.3277836-4-irogers@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 0ce0578 commit 6dd8646

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

tools/perf/util/smt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,10 @@ int smt_on(void)
7979
char fn[256];
8080

8181
snprintf(fn, sizeof fn,
82-
"devices/system/cpu/cpu%d/topology/core_cpus", cpu);
82+
"devices/system/cpu/cpu%d/topology/thread_siblings", cpu);
8383
if (sysfs__read_str(fn, &str, &strlen) < 0) {
8484
snprintf(fn, sizeof fn,
85-
"devices/system/cpu/cpu%d/topology/thread_siblings",
86-
cpu);
85+
"devices/system/cpu/cpu%d/topology/core_cpus", cpu);
8786
if (sysfs__read_str(fn, &str, &strlen) < 0)
8887
continue;
8988
}

0 commit comments

Comments
 (0)