Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp233696imu; Mon, 26 Nov 2018 20:18:38 -0800 (PST) X-Google-Smtp-Source: AFSGD/UYilr6W74DNr6jff8QZQ0uaYHP8tERc8slopTBDks+pLfEQsL8kU/6n8Csii7yUNyL0n8y X-Received: by 2002:a17:902:6b46:: with SMTP id g6mr30778622plt.21.1543292318370; Mon, 26 Nov 2018 20:18:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543292318; cv=none; d=google.com; s=arc-20160816; b=qY+tEQ7JUGOs4XqFIJYwHDFsVfe/nxlolJEoaswBjuxG+hZBXYwOw4cE1gYiH/oN+g +ou6cIuDEkMjbVMBI1HrIuI3sHnnuLnBhYzo2ifMyzorfeuEIBlA3dWvZVDBnuOcIT79 WYmDYxuSCR2AwNtWfLPuoEGYIb2dnOfrP6Cb7nr8WsQP/xTCZwMlNJma9xDrCxiCJTf5 USqCKfk+ae2JV80iBx7O/HOpLTt7nlpTKLRc/w/a8mC6hFyAvjXpu0BXovOJ/fxuOwB6 P+4ypu6m8qNDJT6xaRAed++9t7FM6u9kD/KZjUXL629XJp5Jy2+K64AGEldDT3QNkkPc dANw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=AnAA9d5lj26MqwZspsX9y+cinXzGYBDjjOVysyTCWgo=; b=AwZzBGC+e3c+4sL2LErzVePnC86JvF5uA51dyghK0mXdXTafKkLKcaJm+dCC6+bEdu G6caaYTvx0jKX6AcOUZ0J4ziG2BpAJruShyPvDJJmeob50EyxkppBdYNkPVEj+7B0+i7 fIIzDmLEoPs5K0SpcWW5s9ggqdXhs1WekuI3W6Fj8pjv3aW8jB5MbNFzXtsnGOS0jr+L hF1nMV6WQU6tkxZI46ARMV6qK7TYOzeXLa/X1LAMWWlpk8FmI2foYJAzhHne7DkWm2KK 3eUvgLPyMYTR2nw8aRK10Y8+AFDf0jFeQFyNYYZdBmJl9JhoK/nA82cAx54ig++zXNrG KQjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 61si2663116plz.117.2018.11.26.20.18.21; Mon, 26 Nov 2018 20:18:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728147AbeK0OpV (ORCPT + 99 others); Tue, 27 Nov 2018 09:45:21 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:57970 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727571AbeK0OpV (ORCPT ); Tue, 27 Nov 2018 09:45:21 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 395AC72CC59; Tue, 27 Nov 2018 06:48:50 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 1DBBE7CD0D7; Tue, 27 Nov 2018 06:48:49 +0300 (MSK) Date: Tue, 27 Nov 2018 06:48:49 +0300 From: "Dmitry V. Levin" To: Elvira Khabirova , Oleg Nesterov Cc: Steven Rostedt , Ingo Molnar , Andy Lutomirski , Eugene Syromyatnikov , linux-kernel@vger.kernel.org, strace-devel@lists.strace.io, linux-api@vger.kernel.org Subject: Re: [PATCH RESEND v3 1/3] ptrace: pass type of a syscall-stop in ptrace_message Message-ID: <20181127034849.GA4319@altlinux.org> References: <20181125022150.46258a20@akathisia> <20181125022227.55e8caf7@akathisia> <20181126145643.GD1660@redhat.com> <20181127035357.0b381323@akathisia> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <20181127035357.0b381323@akathisia> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 27, 2018 at 03:53:57AM +0100, Elvira Khabirova wrote: > On Mon, 26 Nov 2018 15:56:43 +0100, Oleg Nesterov wrote: > > On 11/25, Elvira Khabirova wrote: > > > > > > + * These values are stored in task->ptrace_message by tracehook_repo= rt_syscall_* > > > + * to describe current syscall-stop. > > > + * > > > + * Values for these constants are chosen so that they do not appear > > > + * in task->ptrace_message by other means. > > > + */ > > > +#define PTRACE_EVENTMSG_SYSCALL_ENTRY 0x80000000U > > > +#define PTRACE_EVENTMSG_SYSCALL_EXIT 0x90000000U =20 > >=20 > > Stupid question, why not > >=20 > > #define PTRACE_EVENT_SYSCALL_ENTRY 8 > > #define PTRACE_EVENT_SYSCALL_EXIT 9 > >=20 > > right after other PTRACE_EVENT_* constants? >=20 > I thought about adding new events for syscall {entry,exit}. > For tracers, using new events means setting new options and checking > for new values after waitpid(). They will also have to switch from using > PTRACE_SYSCALL to PTRACE_CONT. > Right now (with this version of the patch) tracers can use > PTRACE_GETEVENTMSG without doing any additional configuration. > More importantly, adding these events would require much more complex > modifications of kernel code than this patch does. To be honest, we don't see any way of introducing PTRACE_EVENT_* support in PTRACE_GET_SYSCALL_INFO without adding new fields to struct task_struct. > The only benefit I see from adding these events instead of letting > syscall-stops put a value in ptrace_message is an ability to subscribe > to syscall entries, but not to exits, and vice-versa, and I don't think > it is worth it. --=20 ldv --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJb/L6hAAoJEAVFT+BVnCUIsHYQAO5hqEnDe+1q5233vA7ju+mg Om/u/FfJyARRNmujrPZU8B8RR3nYUj7SdVgdq/AJd22eyL8Vs9RRTw8QjxNDrVGF zCnPL+z63PokV+YK6ohoE/MdR0SWgfQZnP70tY9CdqQIYQh3OxQ0cu9e8ERe9KYS R+AifBUolcTQgftUatw085lCG6hv1+wlas2hAT4JE+Tgq/2wTPPsFChPhYn8SJ30 S+KGWaVVDzLy5l3OJfgoWcV2DYaHEZmtSW18Xv2qeSZHlLzoAPWCUEiUfOhEFieE s+Fmn/ZTvwmnYyxsrPYKFb0YfSTNPrvpdTecyOok/kqo0l4uMqxJ/7RzByIbHWSv qBSBACnLozEUHupAK8XcrbGtoBjNl4Ae6uQ+1NRafUy1R06Bx7nqRhfMqkrrKae/ 5sQTL0P5lCNXiEGP3Hu/SJoUJS5ZgKth8J7XcAuM/YeBC9SMTuNU9ShWgXWetqXT 55GYy/VKV4tM0a8sDFSGYN3As6Uuuj1ztGmElmkycCb1+/GiViarrc/ReTuxDT3H JOocZNybF2kdg0GyuIYFf5/B/Zhn0W/dW2ShFRIoBKC0Anmnz2lY4WbT6ktDweRl hSKSSVh5XEmTnJIlKrNHPZOyiBZRy8HPnGq9+VBEj8i7XT2Ee4sNcJ5S71MNzKUs hmM8TRMvLedvYoEwHSZ9 =oNrp -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c--