Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp2022084lqe; Tue, 9 Apr 2024 07:31:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKF9rz/IQSUax/RvuRNMMp45GOmGX+XsXJu5qfoEH/ABHTynhHG81YPtBh/2nVFsEsp5ZyjDei/NatBr25EiDj4N/mfdmyQicgkdhPzA== X-Google-Smtp-Source: AGHT+IGg5XDcMrD0RrZ38VVHR5+YvRVwGOyjbqbekZ8oxrrt4xbb7mYiEwyQrxB5UA26HQpz0ol3 X-Received: by 2002:a50:d71b:0:b0:56d:fc3a:2039 with SMTP id t27-20020a50d71b000000b0056dfc3a2039mr7938241edi.8.1712673110379; Tue, 09 Apr 2024 07:31:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712673110; cv=pass; d=google.com; s=arc-20160816; b=UIhNxci1oYqIkNrpYQDpSjwnvipDKqhRTzdoqBlq4jPa10lzKfShHb86ZbhNErwnUG XArrKVAxvqpcYgv1Kn/HFfqYjyoL/tmFsvE2KWVL/mmVhAdz4iT10QTrfEGIvUUsSV4y f/7jncWCNyKAwMsI89r0gfXSZoLa88KYy4BwWn+udKgrlTHcMnCdddHpTGMMv5o9psH8 wDoKvY2GZMkCfNtaEOK5sIMXlh9TZ3PR+XfNHEN+PToTMePzLUR47Hw5Ps+ezmdEFxwj TLlKrjYEf3xL3TWeLEDz3JYE5UK2lL5uV+bDglQDMZzBtsCocD5geMv3OQZ96hNo9XTA qL8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=R7hxhePU8XPTc5gDoG76FE8KHVtaRtmr05YqGj9Ou5U=; fh=B95So6EH96t4lsC9uOIVrzpn1AOvN6cRcGbIENRCH5A=; b=dzbzVnYhJCiwMoOmPSpVIbXf6o2AGT+OKCtekHteWVYQ7krceE+wXUUJ1QOZ+DA5Ih wZh37yfzdOq5MIEkPHj9VrHTUQSZ5MdCgdjWmwL/LeWerT1UtaevKby14bxhiQSUkuBy 4d2Y0IcS1v9jt0JByQ90CL5DbpLYnjjuRfYXVMNWTgUlxcvfg6PhBaW4srvcHlQvQFbV FBU3H12vF7FBHDe7umaPc0Okmf6GEJ5iotm9pP1MevlydQBAJWkRWtbH51ySg4NEvJGS V+GM2MZtFUs/oKtXj3FcUVk2qXDAkzGtZhOqVBzHgSLHEgtjZM9A0V2n9ELYn/sEKB5I QDZw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-137096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137096-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id f23-20020a50a6d7000000b0056e075465b0si4684164edc.301.2024.04.09.07.31.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 07:31:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-137096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-137096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-137096-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DBE211F261F8 for ; Tue, 9 Apr 2024 14:31:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 368233BBD4; Tue, 9 Apr 2024 14:30:56 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8EF2101EC; Tue, 9 Apr 2024 14:30:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712673055; cv=none; b=gfARgFd+/s7KkoH74eiWA0Rk7u1/fRFhDcO01ZKqZJy54FPSFQIqZIcCa0vWn1jCTMDwveount5kvl/SRfjN6xjgp1l8L27E8dFUNq/TSlx4a3w/xZ7KisxHsfSQE9wYRYCfmuFQvn+WBVqHnBjxnmvKseHWRQ2MUGSqTaA5y0o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712673055; c=relaxed/simple; bh=Jc48hF8Bi2QJFLufyPe696cWZVDXbPnfhf6kpwJkW9E=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IL0rrqes6PwpjaLbJMHk6jcTT5txbXosW7qi4dHEHnO9LhtCoMEh4cX9N7FB8CE0+zxwIG1pL/OVJ7aAQA/rNvdEWlpG0y/nf+C2IhfR+RUWhCU2Lfwp3Kim/TtjM9dsGlETlZPWSWZowzm5yaz5tP/vJ+r82kCOzhU534cz3+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 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) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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