Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp180194imu; Mon, 26 Nov 2018 19:09:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/U2uSr9hU8su/X3fsA10ZYQZYTbjcEVPnM1DXyGr7eKSQHkrxXiUIqf7zksP2iR4PWjUC1Y X-Received: by 2002:a63:db48:: with SMTP id x8mr26718863pgi.365.1543288170455; Mon, 26 Nov 2018 19:09:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543288170; cv=none; d=google.com; s=arc-20160816; b=YDymEs2qa76lWfdchsLM498S9HeFYgLKOc2Vd2/ilWvifZbaTHGOPweOwnWYu23wBM XvSJgCTzyHN/uU6jUsN8f/MWswacTcTLz9vmbEVdNClXRbJesG+vHnPaV5HxSl5xmxah 4McvHV8Dh3ziWB+xdfAtnVqHA+2nLs7AeZ+/7HTytRQQa93PNd1opV6K3Z+CfdhjDOkI c9a6bgunP9bDrN6P/sYSR5XAz8mWVFuY36WvbuYZRwoEqrb2t0Ffdb6ELDoG5ZLrp56j szYBt0qQEPCn2zI6TuZgO5N3g6V3L0Xfw8Y9oVMxCdUtXWDbBR8Mw/yMJGHyaPLhBwD0 6+Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=RipMVg307AjhzE4hmaUNsejGwoVoHP2D/KBQxKA0zwk=; b=RP7tkpG+26OHMZ3qORy4cZ+4QZRkwdlerPHdtCG7talpv2MlHDEISuddh8FeiJKQ8h H50UTw9mBQkvd60bqR5ZSYRxy/9yVHQI3mLjky0DRCv6HX1q6rywOTUwHLq3PIuKTzr2 v5un3+fxd7VBe/UgeH2gAoybpgeDH7xG4TvCbNN5LT4vnE5r5F7Vn2OiP5B4K1yw4zAE 4n26IcdCkxfsvKimiQGjAUAE6nuUTzAJmbEGo51WAewvJ3EUdECRru9gkqcJiuJ83ywH 2fXslGbQMqOWz1dLLkUCn1zvdhJCXo02sP+rIblBCpdmZ/OjzIJ/2sSKyWA0eyPhNtKD TWhw== 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 e17si2233964pgj.142.2018.11.26.19.09.15; Mon, 26 Nov 2018 19:09:30 -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 S1728385AbeK0NuX (ORCPT + 99 others); Tue, 27 Nov 2018 08:50:23 -0500 Received: from air.basealt.ru ([194.107.17.39]:54672 "EHLO air.basealt.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727542AbeK0NuX (ORCPT ); Tue, 27 Nov 2018 08:50:23 -0500 Received: by air.basealt.ru (Postfix, from userid 490) id 030A6589AE9; Tue, 27 Nov 2018 02:53:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Received: from akathisia (broadband-46-188-15-144.2com.net [46.188.15.144]) by air.basealt.ru (Postfix) with ESMTPSA id 4C771589AE7; Tue, 27 Nov 2018 02:53:58 +0000 (UTC) Date: Tue, 27 Nov 2018 03:53:57 +0100 From: Elvira Khabirova To: Oleg Nesterov Cc: rostedt@goodmis.org, mingo@redhat.com, linux-kernel@vger.kernel.org, ldv@altlinux.org, esyr@redhat.com, luto@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: <20181127035357.0b381323@akathisia> In-Reply-To: <20181126145643.GD1660@redhat.com> References: <20181125022150.46258a20@akathisia> <20181125022227.55e8caf7@akathisia> <20181126145643.GD1660@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_report_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 > > Stupid question, why not > > #define PTRACE_EVENT_SYSCALL_ENTRY 8 > #define PTRACE_EVENT_SYSCALL_EXIT 9 > > right after other PTRACE_EVENT_* constants? 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. 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.