summaryrefslogtreecommitdiff
path: root/tools/perf/util/smt.c
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2019-06-05 01:50:44 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-06-10 22:20:11 +0300
commit0ccdb8407a4660f6dbc5977bc060917d2c3e7986 (patch)
treed61c5d3ac8428f3d54deebcf1238703ae98f739d /tools/perf/util/smt.c
parente05a899718f094e2c87d99115c5b1191405a9fd0 (diff)
downloadlinux-0ccdb8407a4660f6dbc5977bc060917d2c3e7986.tar.xz
perf tools: Apply new CPU topology sysfs attributes
The existing "thread_siblings" and "thread_siblings_list" attribute will be deprecated. Use the new CPU topology sysfs attributes, "core_cpus" and "core_cpus_list", which are synonymous with the deprecated attributes. Check the new name first. If not available, use the deprecated name to be compatible with old kernel. Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Reviewed-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <ak@linux.intel.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1559688644-106558-5-git-send-email-kan.liang@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/smt.c')
-rw-r--r--tools/perf/util/smt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/perf/util/smt.c b/tools/perf/util/smt.c
index 453f6f6f29f3..3b791ef2cd50 100644
--- a/tools/perf/util/smt.c
+++ b/tools/perf/util/smt.c
@@ -23,8 +23,12 @@ int smt_on(void)
char fn[256];
snprintf(fn, sizeof fn,
- "devices/system/cpu/cpu%d/topology/thread_siblings",
- cpu);
+ "devices/system/cpu/cpu%d/topology/core_cpus", cpu);
+ if (access(fn, F_OK) == -1) {
+ snprintf(fn, sizeof fn,
+ "devices/system/cpu/cpu%d/topology/thread_siblings",
+ cpu);
+ }
if (sysfs__read_str(fn, &str, &strlen) < 0)
continue;
/* Entry is hex, but does not have 0x, so need custom parser */