From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 583D8CD1284 for ; Tue, 9 Apr 2024 14:31:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C48536B0087; Tue, 9 Apr 2024 10:31:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BF8C56B0088; Tue, 9 Apr 2024 10:31:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B0E706B0089; Tue, 9 Apr 2024 10:31:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 926176B0087 for ; Tue, 9 Apr 2024 10:31:01 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 471EEA0B02 for ; Tue, 9 Apr 2024 14:31:01 +0000 (UTC) X-FDA: 81990230322.20.16B7F7D Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf24.hostedemail.com (Postfix) with ESMTP id 244F8180010 for ; Tue, 9 Apr 2024 14:30:58 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf24.hostedemail.com: domain of "SRS0=qg+T=LO=goodmis.org=rostedt@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=qg+T=LO=goodmis.org=rostedt@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712673059; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R7hxhePU8XPTc5gDoG76FE8KHVtaRtmr05YqGj9Ou5U=; b=77XsF0tN93LT87xcY/Jc/a+KMuMakYJrkRmn21a/61f1nLJgMWqofSczScvOvCnM4yinga xtqIfF/wOkSO8laI+E3L3aDUOcgqeKbr5CuTJtpPWUw0Lu49iLJlcxWO2O9vyx19iBdmKS P4SHIFYhR38jntO5xG50KdDA251POSY= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf24.hostedemail.com: domain of "SRS0=qg+T=LO=goodmis.org=rostedt@kernel.org" designates 145.40.73.55 as permitted sender) smtp.mailfrom="SRS0=qg+T=LO=goodmis.org=rostedt@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712673059; a=rsa-sha256; cv=none; b=gmMq+Us/+YaJ83wLhD7MirmwJmKkBGikKK4KyNMRBi56q8uAhDFPUmhzbKx1+MTpl1jFrd golkkLfKsUw5d5M8oCv8LFUdWzcsohoAgCq6MNfnL7/jYyszJCW5psKWhq3dcIBMIRCQN0 Zs3uRhHzOUpme37MnTQMOJQHppIC66c= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id F0566CE202E; Tue, 9 Apr 2024 14:30:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D54BCC433C7; Tue, 9 Apr 2024 14:30:53 +0000 (UTC) Date: Tue, 9 Apr 2024 10:33:27 -0400 From: Steven Rostedt To: Marco Elver Cc: Eric Biederman , Kees Cook , Alexander Viro , Christian Brauner , Jan Kara , Masami Hiramatsu , Mathieu Desnoyers , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Dmitry Vyukov Subject: Re: [PATCH] tracing: Add new_exec tracepoint Message-ID: <20240409103327.7a9012fa@gandalf.local.home> In-Reply-To: <20240408090205.3714934-1-elver@google.com> References: <20240408090205.3714934-1-elver@google.com> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 244F8180010 X-Stat-Signature: 1cnbxjb9biucwbwtr7ay766e6dup68hn X-HE-Tag: 1712673058-168746 X-HE-Meta: U2FsdGVkX1/IefFA3uTJX4c31L4zBI2gous/wOI085h3uv5eNfNXhgf4iWX99WSQqBNFw5L5CwF0wq1dAMTYHjhOUeSi1WOKnYBZfbhYp4RTCfO0vOw8JyFDY7teAmUm5+VcLU1gL1qXB8IY75Aul0ybE8jZQXlZFM96MJz8JLQdUglGqks6U7ZAKN/tyBXOJVn8Ci82pr/CV0yIqbfzw/uCjfEz866wr/S0WidRGJOEnmUDHCUs7aZoA9hp0WQP7TZEZvUrXiP/hofzW3cZsg88MfgAXb32gjt+IlhSe7qN/O2HcV4N5A1qENeELDrNC2qqaUgxUICrZWxkomtj29oqVW45va8xKRnJZkvq8qPzWaLS/ExtYqN22N+krOh+mw7jywrz2Mumc0YF5OPyW+zBhCUMolcNiGliP4mecKOuynKEFSSpSd79v4kznrc6K9RJlM0CIxuo5+u1Ljk18lOD8cHgfhoQZuQ3lR/qcfSocCeI7qguXIOtVrT+dZhUouMV55MJq0TbKfqR8y2OZDyLhRZDsjQQhsLCI9yGaJQaQUtq82B9NriD79srY7FmSjsy00fx/+ROEzFKJvnCaXi8NRTyw2jg8Irmkirqq1cc18LuV4X2AihOrO6LeQ6Pf//oc4GDAFM256ein2UwSPPTCUDbQS3+UjXCMmzO0ETPWEY5mZoXjmMNM1D+LocZLsPMyNHeiEFBUgszLnLgi3zTpB3yz6b7KShP5ZQiEvFPoN34w7CZQTYEK/eL9l2tFocVQ4Kr7v4PZnkaSasKGw3LfS7AzeX6jtQeoUgfGb/vZ8Ck00k+VeB3Y5insUhg6wOKHVsw5kJ+ijKTHl2x8i2deWJdl9PNpANQxXtImw3bI5L0R7OUaYzwe4xZMOaEeyqL6bu6OB/AYpUjJ0aLm8MzbHNaFYdqDkra26r1JArBgf2CAdjVjMxQ9mwchDn2Pcvt5DCeveF/XNTU/lw hBxVqawX kXU2Vk+biFZgHZOg+ZZDYQypNS//+laFJf1iwihL8JT7iMH3/ngp1zDCg+lLQYkcOiEyzIa6BThaEOeJbhGMfygBBxvwA6POIVCrozlmFzixYLsOiYE4/egAvEJgDoS6Ig+HcRGInS9g6tuAccI7nt72yOjFwYZKqIHb8lyzcx9lJu5/zKC3g47Z7iIKu0rXzBoA7VsPJPI/Qpivf/rH2n4TWRoD4UMRRmoJSsrKXeYTUU/SkB5hThNa1nykuirCFq836xsPKorND+l2nQn2OyarqzDGk0ISANqsARO/lXou3esvU3cZX+M/fFZ7w1d6+ft04sy8Q/RxxvqD0iemJNReW2A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Mon, 8 Apr 2024 11:01:54 +0200 Marco Elver wrote: > Add "new_exec" tracepoint, which is run right after the point of no > return but before the current task assumes its new exec identity. > > Unlike the tracepoint "sched_process_exec", the "new_exec" tracepoint > runs before flushing the old exec, i.e. while the task still has the > original state (such as original MM), but when the new exec either > succeeds or crashes (but never returns to the original exec). > > Being able to trace this event can be helpful in a number of use cases: > > * allowing tracing eBPF programs access to the original MM on exec, > before current->mm is replaced; > * counting exec in the original task (via perf event); > * profiling flush time ("new_exec" to "sched_process_exec"). > > Example of tracing output ("new_exec" and "sched_process_exec"): How common is this? And can't you just do the same with adding a kprobe? -- Steve