[PATCH 22/22] man2: Add uprobe syscall page

Jiri Olsa posted 22 patches 7 months, 4 weeks ago
There is a newer version of this series
[PATCH 22/22] man2: Add uprobe syscall page
Posted by Jiri Olsa 7 months, 4 weeks ago
Adding man page for new uprobe syscall.

Cc: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 man/man2/uprobe.2    | 49 ++++++++++++++++++++++++++++++++++++++++++++
 man/man2/uretprobe.2 |  2 ++
 2 files changed, 51 insertions(+)
 create mode 100644 man/man2/uprobe.2

diff --git a/man/man2/uprobe.2 b/man/man2/uprobe.2
new file mode 100644
index 000000000000..2b01a5ab5f3e
--- /dev/null
+++ b/man/man2/uprobe.2
@@ -0,0 +1,49 @@
+.\" Copyright (C) 2024, Jiri Olsa <jolsa@kernel.org>
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH uprobe 2 (date) "Linux man-pages (unreleased)"
+.SH NAME
+uprobe
+\-
+execute pending entry uprobes
+.SH SYNOPSIS
+.nf
+.B int uprobe(void);
+.fi
+.SH DESCRIPTION
+.BR uprobe ()
+is an alternative to breakpoint instructions
+for triggering entry uprobe consumers.
+.P
+Calls to
+.BR uprobe ()
+are only made from the user-space trampoline provided by the kernel.
+Calls from any other place result in a
+.BR SIGILL .
+.SH RETURN VALUE
+The return value is architecture-specific.
+.SH ERRORS
+.TP
+.B SIGILL
+.BR uprobe ()
+was called by a user-space program.
+.SH VERSIONS
+The behavior varies across systems.
+.SH STANDARDS
+None.
+.SH HISTORY
+TBD
+.P
+.BR uprobe ()
+was initially introduced for the x86_64 architecture
+where it was shown to be faster than breakpoint traps.
+It might be extended to other architectures.
+.SH CAVEATS
+.BR uprobe ()
+exists only to allow the invocation of entry uprobe consumers.
+It should
+.B never
+be called directly.
+.SH SEE ALSO
+.BR uretprobe (2)
diff --git a/man/man2/uretprobe.2 b/man/man2/uretprobe.2
index bbbfb0c59335..bb8bf4e32e5d 100644
--- a/man/man2/uretprobe.2
+++ b/man/man2/uretprobe.2
@@ -45,3 +45,5 @@ exists only to allow the invocation of return uprobe consumers.
 It should
 .B never
 be called directly.
+.SH SEE ALSO
+.BR uprobe (2)
-- 
2.49.0
Re: [PATCH 22/22] man2: Add uprobe syscall page
Posted by Alejandro Colomar 7 months, 3 weeks ago
Hi Jiri,

On Mon, Apr 21, 2025 at 11:44:22PM +0200, Jiri Olsa wrote:
> Adding man page for new uprobe syscall.
> 
> Cc: Alejandro Colomar <alx@kernel.org>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
>  man/man2/uprobe.2    | 49 ++++++++++++++++++++++++++++++++++++++++++++
>  man/man2/uretprobe.2 |  2 ++
>  2 files changed, 51 insertions(+)
>  create mode 100644 man/man2/uprobe.2
> 
> diff --git a/man/man2/uprobe.2 b/man/man2/uprobe.2
> new file mode 100644
> index 000000000000..2b01a5ab5f3e
> --- /dev/null
> +++ b/man/man2/uprobe.2
> @@ -0,0 +1,49 @@
> +.\" Copyright (C) 2024, Jiri Olsa <jolsa@kernel.org>
> +.\"
> +.\" SPDX-License-Identifier: Linux-man-pages-copyleft
> +.\"
> +.TH uprobe 2 (date) "Linux man-pages (unreleased)"
> +.SH NAME
> +uprobe
> +\-
> +execute pending entry uprobes
> +.SH SYNOPSIS
> +.nf
> +.B int uprobe(void);
> +.fi
> +.SH DESCRIPTION
> +.BR uprobe ()
> +is an alternative to breakpoint instructions
> +for triggering entry uprobe consumers.

What are breakpoint instructions?

> +.P
> +Calls to
> +.BR uprobe ()
> +are only made from the user-space trampoline provided by the kernel.
> +Calls from any other place result in a
> +.BR SIGILL .
> +.SH RETURN VALUE
> +The return value is architecture-specific.
> +.SH ERRORS
> +.TP
> +.B SIGILL
> +.BR uprobe ()
> +was called by a user-space program.
> +.SH VERSIONS
> +The behavior varies across systems.
> +.SH STANDARDS
> +None.
> +.SH HISTORY
> +TBD
> +.P
> +.BR uprobe ()
> +was initially introduced for the x86_64 architecture
> +where it was shown to be faster than breakpoint traps.
> +It might be extended to other architectures.
> +.SH CAVEATS
> +.BR uprobe ()
> +exists only to allow the invocation of entry uprobe consumers.
> +It should
> +.B never
> +be called directly.
> +.SH SEE ALSO
> +.BR uretprobe (2)

The pages are almost identical.  Should we document both pages in the
same page?

> diff --git a/man/man2/uretprobe.2 b/man/man2/uretprobe.2
> index bbbfb0c59335..bb8bf4e32e5d 100644
> --- a/man/man2/uretprobe.2
> +++ b/man/man2/uretprobe.2
> @@ -45,3 +45,5 @@ exists only to allow the invocation of return uprobe consumers.
>  It should
>  .B never
>  be called directly.
> +.SH SEE ALSO
> +.BR uprobe (2)
> -- 
> 2.49.0


How about something like the diff below?


Have a lovely day!
Alex

---
diff --git i/man/man2/uretprobe.2 w/man/man2/uretprobe.2
index bbbfb0c59..df0e5d92e 100644
--- i/man/man2/uretprobe.2
+++ w/man/man2/uretprobe.2
@@ -2,22 +2,28 @@
 .\"
 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
 .\"
-.TH uretprobe 2 (date) "Linux man-pages (unreleased)"
+.TH uprobe 2 (date) "Linux man-pages (unreleased)"
 .SH NAME
+uprobe,
 uretprobe
 \-
-execute pending return uprobes
+execute pending entry or return uprobes
 .SH SYNOPSIS
 .nf
+.B int uprobe(void);
 .B int uretprobe(void);
 .fi
 .SH DESCRIPTION
+.BR uprobe ()
+is an alternative to breakpoint instructions
+for triggering entry uprobe consumers.
+.P
 .BR uretprobe ()
 is an alternative to breakpoint instructions
 for triggering return uprobe consumers.
 .P
 Calls to
-.BR uretprobe ()
+these system calls
 are only made from the user-space trampoline provided by the kernel.
 Calls from any other place result in a
 .BR SIGILL .
@@ -26,22 +32,28 @@ .SH RETURN VALUE
 .SH ERRORS
 .TP
 .B SIGILL
-.BR uretprobe ()
-was called by a user-space program.
+These system calls
+were called by a user-space program.
 .SH VERSIONS
 The behavior varies across systems.
 .SH STANDARDS
 None.
 .SH HISTORY
+.TP
+.BR uprobe ()
+TBD
+.TP
+.BR uretprobe ()
 Linux 6.11.
 .P
-.BR uretprobe ()
-was initially introduced for the x86_64 architecture
-where it was shown to be faster than breakpoint traps.
-It might be extended to other architectures.
+These system calls
+were initially introduced for the x86_64 architecture
+where they were shown to be faster than breakpoint traps.
+They might be extended to other architectures.
 .SH CAVEATS
-.BR uretprobe ()
-exists only to allow the invocation of return uprobe consumers.
-It should
+These system calls
+exist only to allow the invocation of
+entry or return uprobe consumers.
+They should
 .B never
 be called directly.


$ MANWIDTH=64 diffman-git
--- HEAD:man/man2/uretprobe.2
+++ ./man/man2/uretprobe.2
@@ -1,24 +1,30 @@
-uretprobe(2)          System Calls Manual          uretprobe(2)
+uprobe(2)             System Calls Manual             uprobe(2)
 
 NAME
-       uretprobe - execute pending return uprobes
+       uprobe,  uretprobe - execute pending entry or return up‐
+       robes
 
 SYNOPSIS
+       int uprobe(void);
        int uretprobe(void);
 
 DESCRIPTION
+       uprobe() is an alternative  to  breakpoint  instructions
+       for triggering entry uprobe consumers.
+
        uretprobe() is an alternative to breakpoint instructions
        for triggering return uprobe consumers.
 
-       Calls  to  uretprobe() are only made from the user‐space
-       trampoline provided by the kernel.  Calls from any other
-       place result in a SIGILL.
+       Calls to these system calls are only made from the user‐
+       space trampoline provided by the kernel.  Calls from any
+       other place result in a SIGILL.
 
 RETURN VALUE
        The return value is architecture‐specific.
 
 ERRORS
-       SIGILL uretprobe() was called by a user‐space program.
+       SIGILL These  system  calls  were called by a user‐space
+              program.
 
 VERSIONS
        The behavior varies across systems.
@@ -27,16 +33,20 @@
        None.
 
 HISTORY
-       Linux 6.11.
+       uprobe()
+              TBD
+
+       uretprobe()
+              Linux 6.11.
 
-       uretprobe() was initially introduced for the x86_64  ar‐
-       chitecture  where  it was shown to be faster than break‐
-       point traps.  It might be extended  to  other  architec‐
-       tures.
+       These system calls were  initially  introduced  for  the
+       x86_64  architecture  where they were shown to be faster
+       than breakpoint traps.  They might be extended to  other
+       architectures.
 
 CAVEATS
-       uretprobe()  exists  only to allow the invocation of re‐
-       turn uprobe consumers.  It should never  be  called  di‐
-       rectly.
+       These system calls exist only to allow the invocation of
+       entry  or return uprobe consumers.  They should never be
+       called directly.
 
-Linux man‐pages (unreleased) (date)                uretprobe(2)
+Linux man‐pages (unreleased) (date)                   uprobe(2)

-- 
<https://www.alejandro-colomar.es/>
Re: [PATCH 22/22] man2: Add uprobe syscall page
Posted by Jiri Olsa 7 months, 3 weeks ago
On Tue, Apr 22, 2025 at 09:00:17AM +0200, Alejandro Colomar wrote:
> Hi Jiri,
> 
> On Mon, Apr 21, 2025 at 11:44:22PM +0200, Jiri Olsa wrote:
> > Adding man page for new uprobe syscall.
> > 
> > Cc: Alejandro Colomar <alx@kernel.org>
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> >  man/man2/uprobe.2    | 49 ++++++++++++++++++++++++++++++++++++++++++++
> >  man/man2/uretprobe.2 |  2 ++
> >  2 files changed, 51 insertions(+)
> >  create mode 100644 man/man2/uprobe.2
> > 
> > diff --git a/man/man2/uprobe.2 b/man/man2/uprobe.2
> > new file mode 100644
> > index 000000000000..2b01a5ab5f3e
> > --- /dev/null
> > +++ b/man/man2/uprobe.2
> > @@ -0,0 +1,49 @@
> > +.\" Copyright (C) 2024, Jiri Olsa <jolsa@kernel.org>
> > +.\"
> > +.\" SPDX-License-Identifier: Linux-man-pages-copyleft
> > +.\"
> > +.TH uprobe 2 (date) "Linux man-pages (unreleased)"
> > +.SH NAME
> > +uprobe
> > +\-
> > +execute pending entry uprobes
> > +.SH SYNOPSIS
> > +.nf
> > +.B int uprobe(void);
> > +.fi
> > +.SH DESCRIPTION
> > +.BR uprobe ()
> > +is an alternative to breakpoint instructions
> > +for triggering entry uprobe consumers.
> 
> What are breakpoint instructions?

it's int3 instruction to trigger breakpoint (on x86_64)

> 
> > +.P
> > +Calls to
> > +.BR uprobe ()
> > +are only made from the user-space trampoline provided by the kernel.
> > +Calls from any other place result in a
> > +.BR SIGILL .
> > +.SH RETURN VALUE
> > +The return value is architecture-specific.
> > +.SH ERRORS
> > +.TP
> > +.B SIGILL
> > +.BR uprobe ()
> > +was called by a user-space program.
> > +.SH VERSIONS
> > +The behavior varies across systems.
> > +.SH STANDARDS
> > +None.
> > +.SH HISTORY
> > +TBD
> > +.P
> > +.BR uprobe ()
> > +was initially introduced for the x86_64 architecture
> > +where it was shown to be faster than breakpoint traps.
> > +It might be extended to other architectures.
> > +.SH CAVEATS
> > +.BR uprobe ()
> > +exists only to allow the invocation of entry uprobe consumers.
> > +It should
> > +.B never
> > +be called directly.
> > +.SH SEE ALSO
> > +.BR uretprobe (2)
> 
> The pages are almost identical.  Should we document both pages in the
> same page?

great, I was wondering this was an option, looks much better
should we also add uprobe link, like below?

thanks,
jirka


---
diff --git a/man/man2/uprobe.2 b/man/man2/uprobe.2
new file mode 100644
index 000000000000..ea5ccf901591
--- /dev/null
+++ b/man/man2/uprobe.2
@@ -0,0 +1 @@
+.so man2/uretprobe.2
Re: [PATCH 22/22] man2: Add uprobe syscall page
Posted by Alejandro Colomar 7 months, 3 weeks ago
Hi Jiri,

On Tue, Apr 22, 2025 at 04:01:56PM +0200, Jiri Olsa wrote:
> > > +is an alternative to breakpoint instructions
> > > +for triggering entry uprobe consumers.
> > 
> > What are breakpoint instructions?
> 
> it's int3 instruction to trigger breakpoint (on x86_64)

I guess it's something that people who do that stuff understand.
I don't, but I guess your intended audience will be okay with it.  :)

> > The pages are almost identical.  Should we document both pages in the
> > same page?
> 
> great, I was wondering this was an option, looks much better
> should we also add uprobe link, like below?

Yep, sure.  Thanks for the reminder!


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es/>
Re: [PATCH 22/22] man2: Add uprobe syscall page
Posted by Alejandro Colomar 7 months, 2 weeks ago
Hi Jiri,

On Tue, Apr 22, 2025 at 10:45:41PM +0200, Alejandro Colomar wrote:
> On Tue, Apr 22, 2025 at 04:01:56PM +0200, Jiri Olsa wrote:
> > > > +is an alternative to breakpoint instructions
> > > > +for triggering entry uprobe consumers.
> > > 
> > > What are breakpoint instructions?
> > 
> > it's int3 instruction to trigger breakpoint (on x86_64)
> 
> I guess it's something that people who do that stuff understand.
> I don't, but I guess your intended audience will be okay with it.  :)
> 
> > > The pages are almost identical.  Should we document both pages in the
> > > same page?
> > 
> > great, I was wondering this was an option, looks much better
> > should we also add uprobe link, like below?
> 
> Yep, sure.  Thanks for the reminder!

From what I see, I should not yet merge the patch, right?  The kernel
code is under review, right?


Have a lovely night!
Alex

> 
> 
> Have a lovely night!
> Alex
> 
> -- 
> <https://www.alejandro-colomar.es/>



-- 
<https://www.alejandro-colomar.es/>
Re: [PATCH 22/22] man2: Add uprobe syscall page
Posted by Jiri Olsa 7 months, 2 weeks ago
On Thu, May 01, 2025 at 11:26:46PM +0200, Alejandro Colomar wrote:
> Hi Jiri,
> 
> On Tue, Apr 22, 2025 at 10:45:41PM +0200, Alejandro Colomar wrote:
> > On Tue, Apr 22, 2025 at 04:01:56PM +0200, Jiri Olsa wrote:
> > > > > +is an alternative to breakpoint instructions
> > > > > +for triggering entry uprobe consumers.
> > > > 
> > > > What are breakpoint instructions?
> > > 
> > > it's int3 instruction to trigger breakpoint (on x86_64)
> > 
> > I guess it's something that people who do that stuff understand.
> > I don't, but I guess your intended audience will be okay with it.  :)
> > 
> > > > The pages are almost identical.  Should we document both pages in the
> > > > same page?
> > > 
> > > great, I was wondering this was an option, looks much better
> > > should we also add uprobe link, like below?
> > 
> > Yep, sure.  Thanks for the reminder!
> 
> From what I see, I should not yet merge the patch, right?  The kernel
> code is under review, right?

right, we need to figure out other stuff first

thanks,
jirka

> 
> 
> Have a lovely night!
> Alex
> 
> > 
> > 
> > Have a lovely night!
> > Alex
> > 
> > -- 
> > <https://www.alejandro-colomar.es/>
> 
> 
> 
> -- 
> <https://www.alejandro-colomar.es/>