Received: by 2002:ab2:4a89:0:b0:1f4:a8b6:6e69 with SMTP id w9csp194697lqj; Wed, 10 Apr 2024 07:58:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXxVsr2kp8ePIsMUcZGx4BGC0jnbntXH9ZwQFnvRY0/Lyqye3454x6aBYmH7LTUVTClI9P7iPqkz4umvAqlmjyUK61RrHe7WAAqKitmw== X-Google-Smtp-Source: AGHT+IEth3mJew1oH5FHxEUdLoNO3bVpd7C7JECs5jCM1jqhtnd5MP9O0BYXPFEAvOeZZ2wXqngi X-Received: by 2002:a17:902:e541:b0:1e4:9bce:978e with SMTP id n1-20020a170902e54100b001e49bce978emr4001986plf.23.1712761120842; Wed, 10 Apr 2024 07:58:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712761120; cv=pass; d=google.com; s=arc-20160816; b=rUlkNugdZ3kSp4DODABJnWGkXDm4Mzbrb7vHKGSQF+rNwLR5rKFvOJvAwbcOeO7K2k R95KmlhVGdFCmTd0EpjCchv7MbgRRxxnHLh06fl7xDjLFuK4avKTFpZPKdkPh4TZOl8g XVhxPSu/v2SLVEcBFsfDOa9VcbRh0GwcZYK/qX2XwNzzZGPZJpDjLuODcnQlrzqhko+i F9BKs47dAfNirUchKpZ4trDXASlSNPcg0YvvJDeBaieDNXiww+jvspYx6iTZbszW+J4p rzkaNtyqa24ErKpj5C9XAVyItnaTkxz5rQHrBji0IKQRJ/UAlT6U/qBG5tI6bylHM7zC Hicg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=5aa3hIWZtOiM9o7F/Dz6DxBBPY3BgmfWmAFxkVrBHd8=; fh=HlVgJhF9nZ//hKzAnBGy5O73AU0hvWUTbhkM7F3i9+k=; b=1AtxdXvxbjsBqjpUybUvpxq2rBj+YmUUCw+oPVcFWUT2SLck2ofQ8VlYz5s1ds8ygU sin76BrL4G0rYlK0AsqEc0PygwQW7XhS6AQzgTazVw5anaCugXgrKOt1hJNLKFJ8kvqP o0ZxJR0qTLcvf5XIXo3Iv9o7qohtVpFFffXM0z9APxnKmNX4+gIDwVbgLxcTFxGQGxo9 Xv57QSf0673ljrQVIyJKo8bFhJGEaXzbJ8AoPoE8RmbarlTperLiKBHY99SZNEDhh/r4 g8O9zQT3trisBJt+rN54Uyn4ra1itnlc80ZH31VXsyMm6eA4liqdIcjNmNfTBJQUqQoz kecQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=33iofNrw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-138694-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b7-20020a170902e94700b001dcc8769137si4510303pll.598.2024.04.10.07.58.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 07:58:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-138694-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=33iofNrw; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-138694-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-138694-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 54D66B2AB75 for ; Wed, 10 Apr 2024 14:01:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 878BA15F404; Wed, 10 Apr 2024 13:59:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="33iofNrw" Received: from mail-vs1-f41.google.com (mail-vs1-f41.google.com [209.85.217.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F44815B568 for ; Wed, 10 Apr 2024 13:59:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712757588; cv=none; b=Qq4kxVi7ufck6uulYZRCFRi0F18euDTguIiaYiujoMLB1nRCGh949yZVs9WkKU+r8u9dDFLkBZPUMHCcEy3lmWY+ywfHDmMu0QpcV2B1ItqX+FUv/PVnthQo3OCAiu4kQNCBunHs7i5mR0UZCnNh8ls9JtyucKSo4QaP/ed+bHs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712757588; c=relaxed/simple; bh=6Uqwnw302suIzBJiIBQsZeD3y2gKWEdgNhICFPWo1MY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fXYTFb3D/3IuO4K/rwO7mQ1tQ0YPDlP9IG/1DQFMl3eoeOyYmk9aFJARafwMfWDtERTbF6LjYE3kayT0+TNzq7W7rICxDfoE0Ie3ZPeJtOLdr4Bmi951JFYpfZcbWwbFpedT6NoLrTHXDI26hrzeCpYvFSOkhm6CV+/iO6c31L4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=33iofNrw; arc=none smtp.client-ip=209.85.217.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-vs1-f41.google.com with SMTP id ada2fe7eead31-479e57ff63bso1757224137.1 for ; Wed, 10 Apr 2024 06:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1712757586; x=1713362386; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=5aa3hIWZtOiM9o7F/Dz6DxBBPY3BgmfWmAFxkVrBHd8=; b=33iofNrwnfNauxs8afLTgJHKp+9p4CPgdTobmG0+vYEc6KZmX6vufTcD0bPXCZjdox wXfy76V/viBwIUp7/KscRduZtTKbddgDkdfBjMR+u+DR+jmnHOdYY8wv0+i8TrofTZPg bYBjfuC4Emao2Q1oguAgL/tYrqse0VYyDntA4GbnLyZvoIHhiV/U2etAxX53MTcP0RAw hHI23PTSvu/DcUIK+KOrjgP3XOrNmaNO0Ri+djkKxpspJ4yyRbtA5ti+oMlTzNT8O2hW DO0VcYQpQUJ6JbgtemPCEAdyGV4A+9/RarTwbTGyNl0o8WAqaU7OwYPiO9b2fvXyGss+ 03eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712757586; x=1713362386; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5aa3hIWZtOiM9o7F/Dz6DxBBPY3BgmfWmAFxkVrBHd8=; b=S1kIYVAfslNLXahhFengxykm8oBFCtzwkHejZzcw0lMNxkZsgfSPjBasuS6YskGaf5 UKbi9CSQEZAOzWjjUo1IPghhdPINIPbhp1uY0B8L9yYSp96Oyp3jEmcJ89t0iO0L+Wrr IvX5mZvW2zNnNEFupINxn0jVSnWzsjxS1M6EoRvtrefllkr9OGf0OMLtIoE0cEok3950 T7Qz60rBqnby2RGfCIWtkVvO0TcdayPY0Rbi3EY4kBmHkZfUfDCxaFfK8vkIlAKr0dhG zr6Tahdxebx0IYpwnsYT7oFK/vddswg8XULgIivSYVPHkmMNGam5PzPXk4XmY4f+SyY1 kuRQ== X-Forwarded-Encrypted: i=1; AJvYcCWlKWP9sCarvH7kmWTFkk3REMTgkY60f6jQ0lk/985/yuYtOvCrvnF93JlrXWrdBsEp+CtZwWZSVYkaZ2lwz+2DzuKmPywB4uunzTBk X-Gm-Message-State: AOJu0YzWbbTi4iD/QhR6SOfMSuKp0Wj7sVbXLEmi7fxbpcf1krO1+KW5 u/9SVUcP1R9PYkaDnRO3JYHPie/n2dMus1aTRSyFuzoQ00zJMh9UUt7P/g87hxxlFHbdumlZBT5 t4ponic8BLugcRAW24VxvutvE/agSlUYs6cik X-Received: by 2002:a05:6102:1593:b0:47a:248b:6846 with SMTP id g19-20020a056102159300b0047a248b6846mr2424398vsv.16.1712757585948; Wed, 10 Apr 2024 06:59:45 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240408090205.3714934-1-elver@google.com> <20240410225648.7a815ba873c8d55c44385c24@kernel.org> In-Reply-To: <20240410225648.7a815ba873c8d55c44385c24@kernel.org> From: Marco Elver Date: Wed, 10 Apr 2024 15:59:07 +0200 Message-ID: Subject: Re: [PATCH] tracing: Add new_exec tracepoint To: Masami Hiramatsu Cc: Steven Rostedt , Eric Biederman , Kees Cook , Alexander Viro , Christian Brauner , Jan Kara , Mathieu Desnoyers , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Dmitry Vyukov Content-Type: text/plain; charset="UTF-8" On Wed, 10 Apr 2024 at 15:56, Masami Hiramatsu wrote: > > 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"): > > nit: "new_exec" name a bit stands out compared to other events, and hard to > expect it comes before or after "sched_process_exec". Since "begin_new_exec" > is internal implementation name, IMHO, it should not exposed to user. > What do you think about calling this "sched_prepare_exec" ? I like it, I'll rename it to sched_prepare_exec. Thanks!