From nobody Mon Feb 9 10:26:24 2026 Received: from mail-dy1-f201.google.com (mail-dy1-f201.google.com [74.125.82.201]) (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 CABDD335BA for ; Sat, 24 Jan 2026 00:16:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769213785; cv=none; b=RFDGaehtr0SKipa0H4HsaTK/tZoAeMRDyCtsPBN2Hfs7DpgTx4q86dWNsSQoD3EvnUK7eJtKp9VwBBEgUaSeFlAZXQUbpxvf4HOEBIVmATD4O3x/QmxhqUkSlKwEG5ZlpyE9/fy2oWCqQTS3FAoo4l8QCXPUhM6nGUwsSWCW5z4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769213785; c=relaxed/simple; bh=WWbTmbdSLorrseRj7mprNfnA5YwkHHLrYNGP7YB9W+A=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=N3rV+cYQ0gbc853VHYEE5egu/EsR3Ue+qBWK/1jSHBBD2I+xOSB06IWXwPdj0UNxdX+nGo9H5NtqmhcuxH6oIdGOvCUcS5fgcmdYhGwTiYb2hwXEvsNgY0w9CJNIMdC61y3M3sQqclufl2WvPDbCPiRoHHqxpWj3B2WnwSPwnD0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=VyphcaEH; arc=none smtp.client-ip=74.125.82.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="VyphcaEH" Received: by mail-dy1-f201.google.com with SMTP id 5a478bee46e88-2b74766fae7so939589eec.0 for ; Fri, 23 Jan 2026 16:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769213783; x=1769818583; darn=vger.kernel.org; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=hsppo8YRwJ65Q6pcz9zCc1oZe5VMY/WbrSPn1MsLzfk=; b=VyphcaEHqNg8eypULshX/PW/OboFx616JpyqJMIBq2lQSfYzPxIsr8LBerEk4DnOEz GWnaAsWxiJIBcs3/aARmI1wcolUJ6q92JdE/jFsUdUD/VSVNuqSVExNYqlY838xAuXuP 1hcwKr+fMeTV1QW6KHInzmES/t5q7yqukINjGPa7E5v8J808SWpG00AumfZMJdcxGqDP shUQg3ZkSz1ikwh9chOA+AovEnm6DXZOKI85c8bZZkOfB5dgfapmOaE8adDhFuYmGzs2 O64Vgs/tTi6IvXyDVMYVI8jj5h3X5wHGhDWsjXLeHXP9NoA1fwgsklv7yw2lVQF+hh4y pwLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769213783; x=1769818583; h=to:from:subject:message-id:references:mime-version:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hsppo8YRwJ65Q6pcz9zCc1oZe5VMY/WbrSPn1MsLzfk=; b=PdM7F9jYHZIOY8dOIWic4lNtEsATDMzm8UL7QB3Pr/1XBRvnE/H3/bcoec+2kXG5MM qj8qlUua4Ufo5uskEOyPxKyFe0reeToiXQfK+JUIepn2W8dWr9oAUzno+9lkCMKiUboZ zsaiQ44lnG6+6CrRB+Dno9VvTIgr4NeYg2oYTMAN72V5IJAxttI21keDcbUazULR5GEn CKxczuEd057uuSy6cNVVjB3kA7Mt/ku6pJhFXTFLBlGIxw+K0JA5MIVeDRIIE1lq48BZ khjZoab1MX07I0lBZKEPzlVTZbLnjMT9+oChuuP+MLd8EFNhm3KwN4zYkkVHgsS/6Dzk ELkQ== X-Forwarded-Encrypted: i=1; AJvYcCWd6+cIpg6+28EKmYfBuqclXU/gme+fpJ8On4s2iUYvU+//8L2M+hauddSAulsAt9FYWv1CEy/mbpFPmjI=@vger.kernel.org X-Gm-Message-State: AOJu0YxfJ1SXD5PXYsop5eJaS/+QaEACq3bt9XYOXPGDSt0+g7XnJ1Mt bwlN88rHQZYCHW1NUC7AHPLop+/k9U1c3rSjKbUKhpBJKpUQ97Rl3ut+UXdfTDLNFypBuoppacB e+bZK5Mg9dA== X-Received: from dybpt23.prod.google.com ([2002:a05:7301:4097:b0:2b6:f58c:f252]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7301:fa84:b0:2b7:98d:7b54 with SMTP id 5a478bee46e88-2b739992976mr2667626eec.14.1769213783002; Fri, 23 Jan 2026 16:16:23 -0800 (PST) Date: Fri, 23 Jan 2026 16:16:11 -0800 In-Reply-To: <20260124001611.1332019-1-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260124001611.1332019-1-irogers@google.com> X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260124001611.1332019-4-irogers@google.com> Subject: [PATCH v1 3/3] perf thread-stack: Switch thread_stack__init to use e_machine From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Shimin Guo , Andi Kleen , Leo Yan , Yujie Liu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The architecture type is used to set the retpoline state. Rather than use the arch string switch to using the ELF machine that's readily available within the thread. Signed-off-by: Ian Rogers --- tools/perf/util/thread-stack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/thread-stack.c b/tools/perf/util/thread-stack.c index c6a0a27b12c2..dac76d03f741 100644 --- a/tools/perf/util/thread-stack.c +++ b/tools/perf/util/thread-stack.c @@ -157,10 +157,10 @@ static int thread_stack__init(struct thread_stack *ts= , struct thread *thread, =20 if (thread__maps(thread) && maps__machine(thread__maps(thread))) { struct machine *machine =3D maps__machine(thread__maps(thread)); - const char *arch =3D perf_env__arch(machine->env); + uint16_t e_machine =3D thread__e_machine(thread, machine); =20 ts->kernel_start =3D machine__kernel_start(machine); - if (!strcmp(arch, "x86")) + if (e_machine =3D=3D EM_X86_64 || e_machine =3D=3D EM_386) ts->rstate =3D X86_RETPOLINE_POSSIBLE; } else { ts->kernel_start =3D 1ULL << 63; --=20 2.52.0.457.g6b5491de43-goog