From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C8D522EFDA4; Wed, 29 Apr 2026 18:54:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777488899; cv=none; b=P0fti1RAy+qPSSpdkXEEn9EyxMM0UlXnbJmdT4NPrN39UCGnUqAlRiqFWuxx7VLJg6F60OGCoLrrCW2moFWg4eL84d0NVNeQUbm7YBpjom9glmMcGNjsY0x11X+GZNnMvqr9DNbTA/9NPMF4w63wK0/ll5zNAkMY5L7zM3DmzZw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777488899; c=relaxed/simple; bh=cHlnP9nNZLu9/uqqABygV8ieWNDMxnbOd7qtRJLxecY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Eqf2timJyMjAxW1CzeMPaOAUaaZc+0wwyhCX5IYAjTm98wfUvfiBjv/vDvLa08g09ku4f+PDnw110wL7HNj5yCWFpAnvRz/WGG9fBKiYrbTUxEDyEv2lbtBC20cPrPAQG7mafEgNhKvLOLa93bAxisOpOrLxonHlbmPNWLK2xw0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eIbZVLuy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eIbZVLuy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4AFCC19425; Wed, 29 Apr 2026 18:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777488899; bh=cHlnP9nNZLu9/uqqABygV8ieWNDMxnbOd7qtRJLxecY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eIbZVLuy8A7jpExFrOOi5Vw1auoYpfQbBeatuGausg7UCgpqIwrc5yI1fFILMFuFM 41DpLtr2yZN8REAbzky8Kr6NnhxnyBY6aq0lw8LZ2oekGonF0MS0gD2BEZjjK+XbBJ lTkDvuI7QmUO5oY8WMqdauOO8ed+hzCsY+gwHJiL6bZ51Y9lpeZcNX2SyycPmytkCW 5NumxxFcTt5yIVwBLr2s6mdz1ugvc5goc0FTOorj52rnqHAKXYSxCLG5LbyHl4i1TS KvycgHnrb1tGuFIr3xijy1pHcncf2/ni6pPYfqM4UvhEa/pQuM1vDyMfH/zil3a2rp zqnOLuyA7wucA== Date: Wed, 29 Apr 2026 14:55:12 -0400 From: Steven Rostedt To: Mathieu Desnoyers Cc: LKML , Linux Trace Kernel , Masami Hiramatsu , Jens Remus , Josh Poimboeuf , Peter Zijlstra , Ingo Molnar , Jiri Olsa , Arnaldo Carvalho de Melo , Namhyung Kim , Thomas Gleixner , Andrii Nakryiko , Indu Bhagat , "Jose E. Marchesi" , Beau Belgrave , Linus Torvalds , Andrew Morton , Florian Weimer , Kees Cook , Carlos O'Donell , Sam James , Dylan Hatch , Borislav Petkov , Dave Hansen , David Hildenbrand , "H. Peter Anvin" , "Liam R. Howlett" , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Suren Baghdasaryan , Vlastimil Babka , Heiko Carstens , Vasily Gorbik Subject: Re: [RFC][PATCH] unwind: Add stacktrace_setup system call Message-ID: <20260429145512.461e09fe@gandalf.local.home> In-Reply-To: References: <20260429114355.6c712e6a@gandalf.local.home> X-Mailer: Claws Mail 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 29 Apr 2026 14:42:52 -0400 Mathieu Desnoyers wrote: > On 2026-04-29 11:43, Steven Rostedt wrote: > [...] > > AFAIU this is a functional iteration of my prior RFC here: > > https://lore.kernel.org/lkml/2fa31347-3021-4604-bec3-e5a2d57b77b5@efficios.com/ > > perhaps it would be valuable to refer to that thread ? Thanks, I actually decided to start this from scratch as I took a slightly different approach than yours. But you're right, I should have mentioned it anyway. > > > } > > + > > +/** > > + * sys_stacktrace_setup - register an address for user space stacktrace walking. > > + * @op: Type of operation to perform > > + * @addr_start: The virtual address of the stacktrace information > > + * @addr_length: The length of the stacktrace information > > + * @text_start: The virtual address of the text that @addr_start represents > > + * @text_length: The length of teh text > > the > > also, perhaps add @flags just in case ? This allows changing the > behavior without having to insert entirely new set of ops. I thought about it and decided it was somewhat redundant to the ops. After working on the futex code, I thought following that API was a better approach. > > > + * > > + * This system call is used by dynamic library utilities to inform the kernel > > Out of curiosity: what would happen if the application chooses to invoke > this system call to register sframe for the main executable ? Should it be > allowed ? I haven't tried, and should look at the code. Ideally, no two sframes sections should cover the same code. I think it should error out if it does. If the main executable doesn't have a sframe section, I don't see why this shouldn't be allowed to add one. > > > + * of meta data that it loaded that can be used by the kernel to know how > > + * to stack walk the given text locations. > > + * > > + * Currently only sframes are supported, but in the future, this may be used > > + * to tell the kernel about JIT code which will most likely have a different > > + * format. > > + * > > + * The type command may be extended and parameters may be used for other > > + * purposes. > > "type" or "op" ? Bah, I originally had called it "type" and then renamed it to "op" (to be consistent with the futex commands). I missed updating this. Thanks for catching that. -- Steve