mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland McGrath <roland@hack.frob.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	Pedro Alves <palves@redhat.com>, Tom Tromey <tromey@redhat.com>,
	Jan Kratochvil <jan.kratochvil@redhat.com>,
	Tejun Heo <tj@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [RFC/PATCH] Implement new PTRACE_EVENT_SYSCALL_{ENTER,EXIT}
Date: Thu,  9 Jan 2014 13:04:56 -0800 (PST)	[thread overview]
Message-ID: <20140109210456.A3B0574425@topped-with-meat.com> (raw)
In-Reply-To: Oleg Nesterov's message of  Tuesday, 7 January 2014 16:30:36 +0100 <20140107153036.GA4749@redhat.com>

> I won't argue, but it is not clear to me if this is really useful,
> given that the debugger can read the regs.

I do see the utility of having a consistent machine-independent way to get
the syscall number from userspace.  But note that this could be probably
accomplished with just a uapi header change, providing an inline or macro
to extract the syscall number from the regset data.  (It was once the case
that there were some machines where the syscall number is not in any
register and has to be extracted by decoding the instruction.  I'm not sure
if that is still an issue anywhere.)

Also note that adding a separate copy of the syscall number introduces a
new wrinkle into the interface.  This might be considered to be good, bad,
or indifferent, but I think it should at least be considered explicitly.
That is, at the entry stop the syscall number (when it's in a register) can
be changed via ptrace.  So if the number is delivered via ptrace_message,
that's a separate copy of the original number that does not reflect any
changes made via ptrace--so it reflects what userland asked for, as opposed
to what the kernel actually acted on.

I don't have a particular opinion about which way to go with that.
I just wanted all the issues (I'm aware of) to be considered.

I absolutely concur that all new tracing features should work in the
existing style of PTRACE_EVENT_* that a PTRACE_O_* flag enables it and
then it applies for all kinds of running under ptrace.  Things like
PTRACE_SYSCALL that combine what-to-report with how-to-run are terrible
and should never be done again.


Thanks,
Roland

  parent reply	other threads:[~2014-01-09 21:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-06 22:52 Sergio Durigan Junior
2014-01-07 15:30 ` Oleg Nesterov
2014-01-07 16:37   ` Sergio Durigan Junior
2014-01-07 19:12     ` Oleg Nesterov
2014-01-09 18:49   ` Pedro Alves
2014-01-10 13:58     ` Oleg Nesterov
2014-01-19  2:48       ` Sergio Durigan Junior
2014-01-19 15:29         ` Oleg Nesterov
2014-05-14 18:49           ` Pedro Alves
2014-05-15 14:36             ` Denys Vlasenko
2014-05-16 10:30               ` Pedro Alves
2014-01-09 21:04   ` Roland McGrath [this message]
2014-01-19  2:39     ` Sergio Durigan Junior
2014-01-13 13:35 ` Denys Vlasenko
2014-01-19  2:29   ` Sergio Durigan Junior

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=20140109210456.A3B0574425@topped-with-meat.com \
    --to=roland@hack.frob.com \
    --cc=dvlasenk@redhat.com \
    --cc=jan.kratochvil@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=palves@redhat.com \
    --cc=sergiodj@redhat.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tromey@redhat.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

all inboxes | Powered by JetHome®