public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Denys Vlasenko <vda.linux@googlemail.com>
To: Tejun Heo <tj@kernel.org>
Cc: oleg@redhat.com, jan.kratochvil@redhat.com,
	linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
	akpm@linux-foundation.org, indan@nul.nu, bdonlan@gmail.com,
	pedro@codesourcery.com
Subject: Re: [PATCH 2/5] ptrace: implement PTRACE_SEIZE
Date: Sat, 18 Jun 2011 09:55:37 +0200	[thread overview]
Message-ID: <201106180955.37531.vda.linux@googlemail.com> (raw)
In-Reply-To: <1308043218-23619-3-git-send-email-tj@kernel.org>

On Tuesday 14 June 2011 11:20, Tejun Heo wrote:
   #define PTRACE_EVENT_FORK    1
   #define PTRACE_EVENT_VFORK   2
   #define PTRACE_EVENT_CLONE   3
>  #define PTRACE_EVENT_EXEC	4
>  #define PTRACE_EVENT_VFORK_DONE	5
>  #define PTRACE_EVENT_EXIT	6
> +#define PTRACE_EVENT_STOP	7

Er... these constants were corresponding exactly to
bit positions in ptrace options which enable them:

#define PTRACE_O_TRACESYSGOOD   0x00000001
#define PTRACE_O_TRACEFORK      0x00000002
#define PTRACE_O_TRACEVFORK     0x00000004
#define PTRACE_O_TRACECLONE     0x00000008
#define PTRACE_O_TRACEEXEC      0x00000010
#define PTRACE_O_TRACEVFORKDONE 0x00000020
#define PTRACE_O_TRACEEXIT      0x00000040

For example, PTRACE_O_TRACEEXEC is 4th bit, PTRACE_EVENT_EXEC is 4.

If we'd define PTRACE_EVENT_STOP as 7, any future added
PTRACE_O_foo bit with value 0x00000080 will be unable
to follow this convention.

I propose to define PTRACE_EVENT_STOP as 64 instead, leaving 64 low
PTRACE_EVENT_foo constants for possible future PTRACE_O_foo bits.

[32 should be enough too, but I feel paranoid today :)]

-- 
vda


  reply	other threads:[~2011-06-18  7:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-14  9:20 [PATCHSET ptrace] ptrace: implement PTRACE_SEIZE/INTERRUPT and group stop notification, take#5 Tejun Heo
2011-06-14  9:20 ` [PATCH 1/5] job control: introduce JOBCTL_TRAP_STOP and use it for group stop trap Tejun Heo
2011-06-14  9:20 ` [PATCH 2/5] ptrace: implement PTRACE_SEIZE Tejun Heo
2011-06-18  7:55   ` Denys Vlasenko [this message]
2011-06-18  7:59     ` Denys Vlasenko
2011-06-18  8:35       ` Tejun Heo
2011-06-18  8:57         ` Denys Vlasenko
2011-06-18  9:04           ` Tejun Heo
2011-06-18  8:30     ` Tejun Heo
2011-06-18  8:58       ` Denys Vlasenko
2011-06-14  9:20 ` [PATCH 3/5] ptrace: implement PTRACE_INTERRUPT Tejun Heo
2011-06-14  9:20 ` [PATCH 4/5] ptrace: implement TRAP_NOTIFY and use it for group stop events Tejun Heo
2011-06-16 19:51   ` Oleg Nesterov
2011-06-17 15:12     ` Tejun Heo
2011-06-17 18:31       ` Oleg Nesterov
2011-06-14  9:20 ` [PATCH 5/5] ptrace: implement PTRACE_LISTEN Tejun Heo
2011-09-23 11:17   ` Matt Fleming
2011-09-23 12:26     ` Oleg Nesterov
2011-06-16 19:44 ` [PATCHSET ptrace] ptrace: implement PTRACE_SEIZE/INTERRUPT and group stop notification, take#5 Oleg Nesterov

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=201106180955.37531.vda.linux@googlemail.com \
    --to=vda.linux@googlemail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bdonlan@gmail.com \
    --cc=indan@nul.nu \
    --cc=jan.kratochvil@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=pedro@codesourcery.com \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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