[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260127185000.431884-2-swapnil.sapkal@amd.com>
Date: Tue, 27 Jan 2026 18:49:55 +0000
From: Swapnil Sapkal <swapnil.sapkal@....com>
To: <peterz@...radead.org>, <mingo@...hat.com>, <acme@...nel.org>,
<namhyung@...nel.org>, <irogers@...gle.com>, <james.clark@....com>
CC: <mark.rutland@....com>, <alexander.shishkin@...ux.intel.com>,
<jolsa@...nel.org>, <adrian.hunter@...el.com>, <thomas.falcon@...el.com>,
<ashelat@...hat.com>, <yu.c.chen@...el.com>, <sshegde@...ux.ibm.com>,
<gautham.shenoy@....com>, <ravi.bangoria@....com>, <swapnil.sapkal@....com>,
<linux-kernel@...r.kernel.org>, <linux-perf-users@...r.kernel.org>
Subject: [PATCH v1 1/6] perf header: Replace hardcoded max cpus by MAX_NR_CPUS
cpumask and cpulist from cpu-domain header have hardcoded max_cpus value
of 1024. Current systems have more cpus than this value. Replace it with
MAX_NR_CPUS. Also define a macro to represent domain name length.
Fixes: d40c68a49f69 ("perf header: Support CPU DOMAIN relation info")
Reported-by: Shrikanth Hegde <sshegde@...ux.ibm.com>
Signed-off-by: Swapnil Sapkal <swapnil.sapkal@....com>
---
tools/perf/util/header.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index eefd1cd73b6a..31c3bab1b10a 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -76,6 +76,7 @@ static const u64 __perf_magic2 = 0x32454c4946524550ULL;
static const u64 __perf_magic2_sw = 0x50455246494c4532ULL;
#define PERF_MAGIC __perf_magic2
+#define DNAME_LEN 16
const char perf_version_string[] = PERF_VERSION;
@@ -1616,10 +1617,10 @@ static int write_pmu_caps(struct feat_fd *ff,
struct cpu_domain_map **build_cpu_domain_map(u32 *schedstat_version, u32 *max_sched_domains, u32 nr)
{
+ char dname[DNAME_LEN], cpumask[MAX_NR_CPUS];
struct domain_info *domain_info;
struct cpu_domain_map **cd_map;
- char dname[16], cpumask[256];
- char cpulist[1024];
+ char cpulist[MAX_NR_CPUS];
char *line = NULL;
u32 cpu, domain;
u32 dcount = 0;
--
2.43.0
Powered by blists - more mailing lists