From nobody Thu Dec 18 09:59:08 2025 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29A0619CC24 for ; Wed, 18 Dec 2024 11:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734522977; cv=none; b=TJJVaUuDwio1GUV/DVaeE27HIh9Q3FYykjVtvIuOmEWFND8xfuyQWj/xwVcVBzK40YbFHFMDBaz8950N7HjPWabfWt9d4rgLbdWI5GmPoweLvX1jZrpXeZwHdHrfMzAgS/WrzIz95v1r2j60dtj0Vg2XDybDjGQBkfjPCnVfbP8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734522977; c=relaxed/simple; bh=KZa0o3cth01TaTGeQ4zWl8phZHJpX9P1YG1XZNPuIZQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Y4Eq9fkd9z/79meQTTXLaXOto5C5S1PSctk1wfhjokwthYnpD5s2vzepD5dXJKR/iWUkBR9SqLhhXK5EklyyDChvn3YkEDucbehWnQX6fwUuwQHUHuMUnlX38qPPG6RzhOG68fIqdabo9LcwJzI907J6T4q+8tnS9Fpw+yfvHeI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Xk6ApJBP; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Xk6ApJBP" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso61917815e9.0 for ; Wed, 18 Dec 2024 03:56:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734522974; x=1735127774; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=sU8TRl5Hia5/9m0MCf6RTQFt9vY1tSkFnfXtAKlr66o=; b=Xk6ApJBPsKrfVohCKl/XzOZp9SPLN6DrJM78t+ISDcYo6NUvK7EWShSZA3PP5n2ju9 QpIgC3FeCk5JE4tlEJWFdVGThAS4l1ixFPpVxE2NMViY2ieTN36h5tSFNF4ni4nD72tF tFM8eXtJ2L3ziHPw8W6+S/FzQbklTbFp0Bl7AKWVloMS0lF5vhw19vnNScGxA+bJQ7YN NedXaij0bf35t23MKnClKsdjCJBkT9MZll58bvwB5Lz7deEi48k6HglJ/yrfyfbkNOZD cBKMzxRaYNnwQLiUehWiqDiW36QyKOYdKRIfI3aoLGep0yAsTCrtSqnlLXneDheeinRt tKJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734522974; x=1735127774; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sU8TRl5Hia5/9m0MCf6RTQFt9vY1tSkFnfXtAKlr66o=; b=A4absWb5aEAEHSgLX2Fv9T36kybIB2elGWC8VJ8XgqUr2wzckjTU1Q7wj6VSJC1ylD xVxSB1nkdgva02fxBmEBdzRKCBA0Zb3TqNQ/2ZNEPa2EAIRXF6BXTLf/cObjyxFU3MQY BPoa7dG/xrji8zvYSVqbvo7rmtGy7/MLfvvw/y6PJJ5NJUFZErPKM4KCLT63MVdXHizZ Bky/LZRWGFn+xXtRM/gf3EK75A5EbWqnUq1IWxGlGlJDJ0wu8cm4U4RGee59kigJet2p yDCgTyluccty572wWFoMs9eH4VbllslV98c92q9XgOjoDe4+GK1x/shnQngo/JnUwyVz vN4g== X-Forwarded-Encrypted: i=1; AJvYcCXG9QA/Bb9mLmGZTUpSXOeFOTHjSoZmCULv4uNSOoyjp/5PsNhHQnHm2CcDxAxRtOc2lPF5joMZn2EFLho=@vger.kernel.org X-Gm-Message-State: AOJu0YzujEDtg2/BvQJox7K8GhIQrGRUA6Rzx1+uas+eTHmgleGaLIHW Fo5nrcvR4/GzdVEgx+E5UmTVbtP1TrcXmIZScUN1p4tB/JWAKq+a/ZoUfMEjeQA= X-Gm-Gg: ASbGncvmVI+VfGiOCkH2HzDLVFkpS4hi4OnwUTTcQpM+IvXLnYPNWtzkIgj12+LffrV FLSGAzsXtTUMBjMh6P+iYMc4josaxk6/PXrLmJO4NHEV4fS7LjQz492PhQwTfYCsNc7XuYyeq/Z 4kJXpjlF6ws9wxiJzMHFMZTMa6LN6sy3qMtRK3vdWZiZq8KTBkpT9Z7hjxlPhmz72fGC+d1Y2jx g+U3oUO/jvjr4xtpdwy7OPjkpQBpkUCOkJibiVGQx7B7X0wmPUanbLE X-Google-Smtp-Source: AGHT+IH9gLkQ299AhfHqHgypTkbxG+ZiziTPZ7k6f7s4gIbsplCWdD5KQXHgEmp+HnCsoA3HTliHIQ== X-Received: by 2002:a5d:5f88:0:b0:385:ec6e:e87a with SMTP id ffacd0b85a97d-388e4d8ecbcmr2399415f8f.43.1734522974570; Wed, 18 Dec 2024 03:56:14 -0800 (PST) Received: from pop-os.. ([145.224.66.247]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-388c806cbd8sm13669043f8f.109.2024.12.18.03.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Dec 2024 03:56:14 -0800 (PST) From: James Clark To: linux-perf-users@vger.kernel.org, namhyung@kernel.org, acme@kernel.org, irogers@google.com Cc: James Clark , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , Yicong Yang , linux-kernel@vger.kernel.org Subject: [PATCH] perf cpumap: Fix die and cluster IDs Date: Wed, 18 Dec 2024 11:55:51 +0000 Message-Id: <20241218115552.912517-1-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Now that filename__read_int() returns -errno instead of -1 these statements need to be updated otherwise error values will be used as die IDs. This appears as a -2 die ID when the platform doesn't export one: $ perf stat --per-core -a -- true S36-D-2-C0 1 9.45 msec cpu-clock And the session topology test fails: $ perf test -vvv topology CPU 0, core 0, socket 36 CPU 1, core 1, socket 36 CPU 2, core 2, socket 36 CPU 3, core 3, socket 36 FAILED tests/topology.c:137 Cpu map - Die ID doesn't match ---- end(-1) ---- 38: Session topology : FAI= LED! Fixes: 05be17eed774 ("tool api fs: Correctly encode errno for read/write op= en failures") Signed-off-by: James Clark Acked-by: Namhyung Kim --- tools/perf/util/cpumap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c index 27094211edd8..5c329ad614e9 100644 --- a/tools/perf/util/cpumap.c +++ b/tools/perf/util/cpumap.c @@ -293,7 +293,7 @@ struct aggr_cpu_id aggr_cpu_id__die(struct perf_cpu cpu= , void *data) =20 die =3D cpu__get_die_id(cpu); /* There is no die_id on legacy system. */ - if (die =3D=3D -1) + if (die < 0) die =3D 0; =20 /* @@ -322,7 +322,7 @@ struct aggr_cpu_id aggr_cpu_id__cluster(struct perf_cpu= cpu, void *data) struct aggr_cpu_id id; =20 /* There is no cluster_id on legacy system. */ - if (cluster =3D=3D -1) + if (cluster < 0) cluster =3D 0; =20 id =3D aggr_cpu_id__die(cpu, data); --=20 2.34.1