From nobody Sat Feb 7 12:40:44 2026 Received: from mail-dy1-f202.google.com (mail-dy1-f202.google.com [74.125.82.202]) (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 73D3C2D0622 for ; Fri, 23 Jan 2026 22:22:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769206954; cv=none; b=uwATpVwqQ4fznqNN3sBJzndH/CYRax/ty+9Hm58ynjXA1DnG6PUaCwU89UBzG1D0ZI3skmD5yY20cSerNTJizfZEqVhNdYDR0k0843WKYMSJEaMe14YbQna8ODpjB/nQbh6FkEVhLelzQ3LbTQbK1veIaiS1mC/LUJGIGQTwYmw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769206954; c=relaxed/simple; bh=kC9AZtpAHUdBYY6O6Nxkfi+ezy8yHcBLFEIPAVk6JdQ=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Content-Type; b=e0tquUqzbwp/WEkZ6vrxbZh91IeJf0goY7XoWhI/Vzwaa01XdkzoSmUE9rnaq82rqqvE8AXm0KUFMBfHHDbdvO6o1xNb1KTYZOBtJ9Dlh0M5OgmPJlaHlxmjcPHoFlKvl9ygbxEjiGLQFPj8mnGC1dRONcCebyaPTXR+7xg+Ufk= 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=QjRB6D3B; arc=none smtp.client-ip=74.125.82.202 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="QjRB6D3B" Received: by mail-dy1-f202.google.com with SMTP id 5a478bee46e88-2b713fa927dso1630166eec.0 for ; Fri, 23 Jan 2026 14:22:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1769206953; x=1769811753; 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=M71H9eDQwgF4ql2WlmE8laY3Y552yAYpetkw1WK6z+k=; b=QjRB6D3B1yyIHL6WKTP04dcfdQQVfMZDVevlH55HFOqk6PzzIAQWVJNgjjcHcUAY3k 7dYaGrvNTUBto1zon0GcrWDYvuPc4naloDtxOesX0GOePUtVwiabh3d/UXqGzLo4V6oQ qJVd/+/8LNT6WhWI0wVxkUCrPrLaRPhBx9qe/KdUIZah8Yu2NPxeUSI5FloLJwKfz1MG AvuGLOuVpZ917g854P/F7Nl6n/GlDajJn21JfSL6L2DuP9ZAoq/SkGXPiLu3wRJU/XZZ FdIcuxZ9FxjkU2/RFdUQ+eeoGKSrokhsJyShKt36OzZjXgaxk8d63dw7TJA+lXIVlhaj aBaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769206953; x=1769811753; 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=M71H9eDQwgF4ql2WlmE8laY3Y552yAYpetkw1WK6z+k=; b=pLJVE/bbubDdZvGDrXSAC2ttshkW4QAGtIIWitQo0ET/wtOuX+KlP5VJEEgXOjuc2c QJUuqnM0Ccma8Z1NQrHBLREfAxbnS6c/NSLipUt0olMeFHDNMGLZzpIccuotoOEpnVRN 7surL429BP+PTpKTWuiXfHd4OoVTAmQPO/9phazZfD6Cztr0ysnTUnokmyBcP6ZyMvTD gZammEWNgIUeczoJDyCzRuFDWDyo6SQbxmaxA9b5MC4twQGXqs2e+Uq27GA8js/ZXpCY FTroKUdySrp+4EMI0CF+/imfB7mvaVXXrXUjOJPc2pTUqBxa3Ek7PO+tE86DVSFLgOcO kAfQ== X-Forwarded-Encrypted: i=1; AJvYcCWqgb7rgNStN0xAsCo9P3LKsVWW+s6F/dU8uJEm516JWrBnz1UEzYZymIOc0jJXqKASBn29kasgsKRrSNI=@vger.kernel.org X-Gm-Message-State: AOJu0YyvnYvFM3Ow688hTPwHcENzr4lrCznQxKRv2tQ1sk6AnNXecsDS Q9+1PxQPdu5qK+zEH/9JpCkgalWVxw5vb0wJyEKNVdh+VIvGjSUrim2EAditDC425CoMm2sqTsV Z8jBh6ZwGcQ== X-Received: from dyjm31.prod.google.com ([2002:a05:7300:169f:b0:2b6:fdc8:cdf6]) (user=irogers job=prod-delivery.src-stubby-dispatcher) by 2002:a05:7300:8622:b0:2b0:6a03:f08c with SMTP id 5a478bee46e88-2b72471588cmr4230043eec.5.1769206952582; Fri, 23 Jan 2026 14:22:32 -0800 (PST) Date: Fri, 23 Jan 2026 14:22:09 -0800 In-Reply-To: <20260123222209.1181249-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: <20260123222209.1181249-1-irogers@google.com> X-Mailer: git-send-email 2.52.0.457.g6b5491de43-goog Message-ID: <20260123222209.1181249-5-irogers@google.com> Subject: [PATCH v1 4/4] perf unwind-libdw: Wire up e_flags for CSKY From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , James Clark , Guo Ren , Tianyou Li , Athira Rajeev , Stephen Brennan , Aditya Bodkhe , Chun-Tse Shao , Swapnil Sapkal , Howard Chu , Sergei Trofimovich , Shimin Guo , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Wire up the e_flags now it can be read for a thread. The e_flags encode the CSKY ABI level and this can impact which perf registers need setting up for unwinding. Signed-off-by: Ian Rogers --- tools/perf/util/unwind-libdw.c | 9 +++++---- tools/perf/util/unwind-libdw.h | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c index 3fdcfa06bf22..05e8e68bd49c 100644 --- a/tools/perf/util/unwind-libdw.c +++ b/tools/perf/util/unwind-libdw.c @@ -213,7 +213,6 @@ static bool memory_read(Dwfl *dwfl __maybe_unused, Dwar= f_Addr addr, Dwarf_Word * { struct dwfl_ui_thread_info *dwfl_ui_ti =3D arg; struct unwind_info *ui =3D dwfl_ui_ti->ui; - uint16_t e_machine =3D thread__e_machine(ui->thread, ui->machine, /*e_fla= gs=3D*/NULL); struct stack_dump *stack =3D &ui->sample->user_stack; u64 start, end; int offset; @@ -223,7 +222,7 @@ static bool memory_read(Dwfl *dwfl __maybe_unused, Dwar= f_Addr addr, Dwarf_Word * return false; =20 ret =3D perf_reg_value(&start, ui->sample->user_regs, - perf_arch_reg_sp(e_machine)); + perf_arch_reg_sp(ui->e_machine)); if (ret) return false; =20 @@ -260,7 +259,7 @@ static bool libdw_set_initial_registers(Dwfl_Thread *th= read, void *arg) int max_dwarf_reg =3D 0; bool ret; uint16_t e_machine =3D ui->e_machine; - int e_flags =3D 0; + int e_flags =3D ui->e_flags; uint64_t ip_perf_reg =3D perf_arch_reg_ip(e_machine); Dwarf_Word val =3D 0; =20 @@ -348,7 +347,8 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg, { struct maps *maps =3D thread__maps(thread); struct machine *machine =3D maps__machine(maps); - uint16_t e_machine =3D thread__e_machine(thread, machine, /*e_flags=3D*/N= ULL); + uint32_t e_flags =3D 0; + uint16_t e_machine =3D thread__e_machine(thread, machine, &e_flags); struct dwfl_ui_thread_info *dwfl_ui_ti; static struct unwind_info *ui; Dwfl *dwfl; @@ -370,6 +370,7 @@ int unwind__get_entries(unwind_entry_cb_t cb, void *arg, .arg =3D arg, .max_stack =3D max_stack, .e_machine =3D e_machine, + .e_flags =3D e_flags, .best_effort =3D best_effort }; =20 diff --git a/tools/perf/util/unwind-libdw.h b/tools/perf/util/unwind-libdw.h index 3dec0ab8bd50..6423bf5a2492 100644 --- a/tools/perf/util/unwind-libdw.h +++ b/tools/perf/util/unwind-libdw.h @@ -20,6 +20,7 @@ struct unwind_info { void *arg; int max_stack; int idx; + uint32_t e_flags; uint16_t e_machine; bool best_effort; struct unwind_entry entries[]; --=20 2.52.0.457.g6b5491de43-goog