The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jemarch@gnu.org>
To: Steven Rostedt <rostedt@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	mhiramat@kernel.org, mathieu.desnoyers@efficios.com,
	jremus@linux.ibm.com, jpoimboe@kernel.org, peterz@infradead.org,
	mingo@kernel.org, jolsa@kernel.org, acme@kernel.org,
	namhyung@kernel.org, tglx@linutronix.de, andrii@kernel.org,
	indu.bhagat@oracle.com, beaub@linux.microsoft.com,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	fweimer@redhat.com, kees@kernel.org, codonell@redhat.com,
	sam@gentoo.org, dylanbhatch@google.com, bp@alien8.de,
	dave.hansen@linux.intel.com, david@redhat.com, hpa@zytor.com,
	Liam.Howlett@oracle.com, lorenzo.stoakes@oracle.com,
	mhocko@suse.com, rppt@kernel.org, surenb@google.com,
	vbabka@suse.cz, hca@linux.ibm.com, gor@linux.ibm.com
Subject: Re: [RFC][PATCH] unwind: Add stacktrace_setup system call
Date: Thu, 07 May 2026 14:37:36 +0200	[thread overview]
Message-ID: <87zf2bl7jj.fsf@gnu.org> (raw)
In-Reply-To: <20260429114355.6c712e6a@gandalf.local.home> (message from Steven Rostedt on Wed, 29 Apr 2026 11:43:55 -0400)


> +/**
> + * 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
> + *
> + * This system call is used by dynamic library utilities to inform the kernel
> + * 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.
> + *
> + * Return: 0 if successful, otherwise a negative error.
> + */
> +SYSCALL_DEFINE5(stacktrace_setup, int, op, unsigned long, addr_start,
> +		unsigned long, addr_length, unsigned long, text_start,
> +		unsigned long, text_length)
> +{
> +	switch (op) {
> +	case STACKTRACE_REGISTER_SFRAME:
> +		return sframe_add_section(addr_start, addr_start + addr_length,
> +					  text_start, text_start+text_length);
> +	case STACKTRACE_UNREGISTER_SFRAME:
> +		return sframe_remove_section(addr_start);
> +	}
> +	return -EINVAL;
> +}

FWIW passing start and end of both the tracing data and the text segment
it covers seems reasonable to me.  This covers the case in which the
same tracing data describes several text segments, which can happen with
SFrame and other similar formats.

> diff --git a/scripts/syscall.tbl b/scripts/syscall.tbl
> index 7a42b32b6577..54a99cffeec4 100644
> --- a/scripts/syscall.tbl
> +++ b/scripts/syscall.tbl
> @@ -412,3 +412,4 @@
>  469	common	file_setattr			sys_file_setattr
>  470	common	listns				sys_listns
>  471	common	rseq_slice_yield		sys_rseq_slice_yield
> +472	common	stacktrace_setup		sys_stacktrace_setup

       reply	other threads:[~2026-05-07 21:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260429114355.6c712e6a@gandalf.local.home>
2026-05-07 12:37 ` Jose E. Marchesi [this message]
2026-05-08  1:57   ` [RFC][PATCH] unwind: Add stacktrace_setup system call Steven Rostedt
2026-05-08  7:32     ` Jose E. Marchesi
2026-05-08  7:46 ` Jens Remus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zf2bl7jj.fsf@gnu.org \
    --to=jemarch@gnu.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrii@kernel.org \
    --cc=beaub@linux.microsoft.com \
    --cc=bp@alien8.de \
    --cc=codonell@redhat.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@redhat.com \
    --cc=dylanbhatch@google.com \
    --cc=fweimer@redhat.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hpa@zytor.com \
    --cc=indu.bhagat@oracle.com \
    --cc=jolsa@kernel.org \
    --cc=jpoimboe@kernel.org \
    --cc=jremus@linux.ibm.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=mhocko@suse.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@kernel.org \
    --cc=rppt@kernel.org \
    --cc=sam@gentoo.org \
    --cc=surenb@google.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox