From: "Niklas Hambüchen" <mail@nh2.me>
To: "Dmitry V. Levin" <ldv@altlinux.org>
Cc: mtk.manpages@gmail.com, linux-kernel@vger.kernel.org,
cleverca22@gmail.com, linux-man@vger.kernel.org
Subject: Re: [PATCH] ptrace.2: Improve clarity for multi-threaded tracers
Date: Sun, 21 Apr 2019 16:57:04 +0200 [thread overview]
Message-ID: <cea5f7cb-c6be-080e-3d1a-335da4b74b39@nh2.me> (raw)
In-Reply-To: <20190217221523.GA9233@altlinux.org>
[-- Attachment #1.1: Type: text/plain, Size: 1771 bytes --]
Hey Dmitry,
On 2019-02-17 23:15, Dmitry V. Levin wrote:
>> A tracee first needs to be attached to the tracer.
>> -Attachment and subsequent commands are per thread:
>> -in a multithreaded process,
>> +Attachment and subsequent commands are per thread,
>> +on both the tracer and tracee side.
>> +Issuing a tracing command from a thread that is not the tracer of the given
>> +.I pid
>> +will result in an
>> +.B ESRCH
>> +error.
>
> This is confusing. What do you mean by a tracing command?
> Is PTRACE_TRACEME a tracing command? PTRACE_ATTACH? PTRACE_SEIZE?
I was referring to the same command as in other places in the man page, as in the existing sentences
Most ptrace commands [...] require the tracee to be in a ptrace-stop, otherwise they fail with ESRCH.
or
(for commands which require a stopped tracee)
Would thus "ptrace command" be better than "tracing command" here?
>> .B ESRCH
>> The specified process does not exist, or is not currently being traced
>> -by the caller, or is not stopped
>> +by the calling thread, or is not stopped
>> (for requests that require a stopped tracee).
>> .SH CONFORMING TO
>> SVr4, 4.3BSD.
>
> I agree the current text can be made more clear on the subject,
> but, unfortunately, proposed change makes the description more confusing.
Do you mean "calling thread" is more confusing than "caller"?
If yes, what would you suggest instead?
My intent here was to, for anybody who encounters ESRCH and looks it up in an effort to see what's going on, make clear that threads are important here.
Or should I switch to `task_struct` terminology? That wouldn't be userspace terminology though, and the rest of the man page also talks about threads.
Niklas
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2019-04-21 14:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <48bb7c89-abb9-1e88-fee3-fb42d4032d12@nh2.me>
2019-02-17 16:34 ` [PATCH] ptrace.2: Improve clarity for multi-threaded tracers Niklas Hambüchen
2019-02-17 22:15 ` Dmitry V. Levin
2019-02-25 15:51 ` Michael Kerrisk (man-pages)
2019-04-21 14:58 ` Niklas Hambüchen
2019-04-21 14:57 ` Niklas Hambüchen [this message]
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=cea5f7cb-c6be-080e-3d1a-335da4b74b39@nh2.me \
--to=mail@nh2.me \
--cc=cleverca22@gmail.com \
--cc=ldv@altlinux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).