diff mbox series

Documentation: update the description of TracerPid in procfs.rst

Message ID 20221102081517.19770-1-chenlinxuan@uniontech.com (mailing list archive)
State New, archived
Headers show
Series Documentation: update the description of TracerPid in procfs.rst | expand

Commit Message

Chen Linxuan Nov. 2, 2022, 8:15 a.m. UTC
When the tracer of process is outside of current pid namespace, field
`TracerPid` in /proc/<pid>/status will be 0, too, just like this process
not have been traced.

This is because that function `task_pid_nr_ns` used to get the pid of
tracer will return 0 in this situation.

Co-authored-by: Yuan Haisheng <heysion@deepin.com>
Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>
---
 Documentation/filesystems/proc.rst | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jonathan Corbet Nov. 15, 2022, 10:09 p.m. UTC | #1
Chen Linxuan <chenlinxuan@uniontech.com> writes:

> When the tracer of process is outside of current pid namespace, field
> `TracerPid` in /proc/<pid>/status will be 0, too, just like this process
> not have been traced.
>
> This is because that function `task_pid_nr_ns` used to get the pid of
> tracer will return 0 in this situation.
>
> Co-authored-by: Yuan Haisheng <heysion@deepin.com>
> Signed-off-by: Chen Linxuan <chenlinxuan@uniontech.com>
> ---
>  Documentation/filesystems/proc.rst | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
> index 898c99eae8e4..e98e0277f05e 100644
> --- a/Documentation/filesystems/proc.rst
> +++ b/Documentation/filesystems/proc.rst
> @@ -245,7 +245,8 @@ It's slow but very precise.
>   Ngid                        NUMA group ID (0 if none)
>   Pid                         process id
>   PPid                        process id of the parent process
> - TracerPid                   PID of process tracing this process (0 if not)
> + TracerPid                   PID of process tracing this process (0 if not, or
> +                             the tracer is outside of the current pid namespace)

Applied, thanks.

jon
diff mbox series

Patch

diff --git a/Documentation/filesystems/proc.rst b/Documentation/filesystems/proc.rst
index 898c99eae8e4..e98e0277f05e 100644
--- a/Documentation/filesystems/proc.rst
+++ b/Documentation/filesystems/proc.rst
@@ -245,7 +245,8 @@  It's slow but very precise.
  Ngid                        NUMA group ID (0 if none)
  Pid                         process id
  PPid                        process id of the parent process
- TracerPid                   PID of process tracing this process (0 if not)
+ TracerPid                   PID of process tracing this process (0 if not, or
+                             the tracer is outside of the current pid namespace)
  Uid                         Real, effective, saved set, and  file system UIDs
  Gid                         Real, effective, saved set, and  file system GIDs
  FDSize                      number of file descriptor slots currently allocated