Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3282850pxj; Tue, 1 Jun 2021 01:28:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFqdufQdnZEnGhhKZlpzq59sUUJNrKjehpe498gYucTZnVuRXnZC/spWVnJZeFYlNloEn7 X-Received: by 2002:a17:906:2892:: with SMTP id o18mr6544429ejd.124.1622536095209; Tue, 01 Jun 2021 01:28:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622536095; cv=none; d=google.com; s=arc-20160816; b=Ap4r4Wh5pX5Ofl4SazlfH8PWgPLUehdNYFTiSIUiZa59IfwkbjKqxBEbKEMPc+M+/9 UpRShJpzVn46YWDcHGEKRcvcJn8tm2K2jXJza6SwV83/afLzfAakMfQw8eSk/ZTcVqKz g/+ZGcSNY2DhwIadCk1DL/RBuoBq+vUG8SP0GXYtWVVhCNsvGOjNb1wiHqrLcF9PxN8T C00DPBcgYlnTc5hzDakDT1IU3cZ5sUsLhQn1qsdshcP0YWew5lb2BJeLaTc/a0enB9T5 TISIejPqblaZFc9zIeeIPFGfVP4CHFbl/t/iaarNgv/3PYEl0dM1tQBlhtzARTK+/GfO yBNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=k2z10kHvXwh0VlWb//vEH7qdG2w+rH+BOKMSkAeptuo=; b=e27EWO4V8lYATqs0VxKkibIF+zUhT1l6TwVcpxbxxu3E9L6KmR7UTIEGtOgZtFY6EO vFkGz7TNpOfoMz1nh4e/y6A62sgds5IaMTwqZ/l6TQdLqOB0ZGq54r6HsPWatrJny7ky T/SGfFl7uEIqiYuTtZ2M7/ingHpmYfwh2lrflij0R7KJvOicqfnC+o4j7QO8Qx6Bas/J iKdVw+E0PK9BEpHZsuUwVwqf4hpctnAzVRozVAUxs3DphVYVUR2VuP01dwrQEbLyf5AK KVI/GUnDN/RS/FUabqvHFq88uBWqFiPF8CtzHfL3vhXvzXxnhhyJ+OsxLuduoZCfGewz UgeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JxNSuwOn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb22si1931682ejc.345.2021.06.01.01.27.53; Tue, 01 Jun 2021 01:28:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=JxNSuwOn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233412AbhFAI0e (ORCPT + 99 others); Tue, 1 Jun 2021 04:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233300AbhFAI0d (ORCPT ); Tue, 1 Jun 2021 04:26:33 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84618C06174A for ; Tue, 1 Jun 2021 01:24:52 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id u24so6717982edy.11 for ; Tue, 01 Jun 2021 01:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=k2z10kHvXwh0VlWb//vEH7qdG2w+rH+BOKMSkAeptuo=; b=JxNSuwOnVwr5zWbPShFowZKsvvro/a6F4DoBJ6KmXQHabMzL8if52GI5mSsrW34g8g JDB1uOq3ZUASaZX4npfzfbyaPnVHzbDftKoLMFk0dPA46BdIpSXWaeQobY4ywCSlGu4z Sq8Y1d3WdPf/dE1vksKs9/oIrwlGIS6H+75YAGSpJ+6KvG98yVc6GIwtgpBzQjRAlL9w Zrf/t9qy/TOpltWXCO5d0mWHlZPE7CGaq2M7ZHsfByvtadrOFlOJLTMCzUMGCsVAM5+9 f0ETQXKQZtYSQ2KrDTL1V+VfKWJAwzvwSPJTrj8r5JfPyv+jUzLybLfBy3xFhsk5AKbG dIbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=k2z10kHvXwh0VlWb//vEH7qdG2w+rH+BOKMSkAeptuo=; b=jnNPb9QBU1iL9ufAiyAPphpMCJ+IPIo3Gp6o4eLBWmsL9VF/om/eHNdJdevZOcZUf2 57A7iFufsu6R5Iwvg23eZFXP7Bccii8fhoiBIGcX864oMdI9z+6fLdlb2H4FaFYaQjh7 ibOJtjc/CJ2/MJSEZyn82PVAfL/CTITD6+gbt+L18LM438slNufXnonolcCq0F/iFaNn ifVGLUp7b6BXm8Ey/iPzlsRXakcX4rc3uVk49KZNvkjRlqBOPk6kfBXJOt9/216zxleL Mye7jg6656ELghQVaygf+aeIzF2siZbIkf75xRWOfNljM5Ju+o/EbFHwDy5cV7Vg8Axz 8vng== X-Gm-Message-State: AOAM533xJ/7tjZvIJV8ZMSEluYbIc/EUnoSM1umeDz+xOYCwUdWokWJ4 XNRst+rJ4jhoobGI5lMtOocw9amQSbBHpr5LiT3C X-Received: by 2002:aa7:c584:: with SMTP id g4mr11564961edq.335.1622535890905; Tue, 01 Jun 2021 01:24:50 -0700 (PDT) MIME-Version: 1.0 References: <20210531202044.426578-1-morbo@google.com> In-Reply-To: From: Bill Wendling Date: Tue, 1 Jun 2021 01:24:39 -0700 Message-ID: Subject: Re: [PATCH] pgo: rename the raw profile file to vmlinux.profraw To: Nathan Chancellor Cc: Kees Cook , Jonathan Corbet , Masahiro Yamada , Linux Doc Mailing List , LKML , Linux Kbuild mailing list , clang-built-linux , Andrew Morton , Nick Desaulniers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 31, 2021 at 1:29 PM Nathan Chancellor wrote: > > On 5/31/2021 1:20 PM, Bill Wendling wrote: > > Future PGO features may create other files in /sys/kernel/debug/pgo. So > > rename the kernel's raw profile data file to "vmlinux.profraw" to make > > which part of the kernel the file is for more explicit. > > > > Note that future files in /sys/kernel/debug/pgo should follow a similar > > naming convention. > > > > Signed-off-by: Bill Wendling > > Guess this clears up my confusion around the module patches :) > To clarify, Jarmo did those patches on his own. I just wanted to clarify the naming convention. :-) -bw > Reviewed-by: Nathan Chancellor > > > --- > > Documentation/dev-tools/pgo.rst | 6 +++--- > > kernel/pgo/Kconfig | 7 ++++--- > > kernel/pgo/fs.c | 2 +- > > 3 files changed, 8 insertions(+), 7 deletions(-) > > > > diff --git a/Documentation/dev-tools/pgo.rst b/Documentation/dev-tools/pgo.rst > > index b7f11d8405b7..0200449c4843 100644 > > --- a/Documentation/dev-tools/pgo.rst > > +++ b/Documentation/dev-tools/pgo.rst > > @@ -76,7 +76,7 @@ The PGO kernel support creates the following files in debugfs: > > ``/sys/kernel/debug/pgo/reset`` > > Global reset file: resets all coverage data to zero when written to. > > > > -``/sys/kernel/debug/profraw`` > > +``/sys/kernel/debug/pgo/vmlinux.profraw`` > > The raw PGO data that must be processed with ``llvm_profdata``. > > > > > > @@ -108,7 +108,7 @@ using the result to optimize the kernel: > > > > .. code-block:: sh > > > > - $ cp -a /sys/kernel/debug/pgo/profraw /tmp/vmlinux.profraw > > + $ cp -a /sys/kernel/debug/pgo/vmlinux.profraw /tmp/vmlinux.profraw > > > > 5) (Optional) Download the raw profile data to the HOST machine. > > > > @@ -120,7 +120,7 @@ using the result to optimize the kernel: > > > > Note that multiple raw profile data files can be merged during this step. > > > > -7) Rebuild the kernel using the profile data (PGO disabled) > > +7) Rebuild the kernel using the processed profile data (PGO disabled) > > > > .. code-block:: sh > > > > diff --git a/kernel/pgo/Kconfig b/kernel/pgo/Kconfig > > index 76a640b6cf6e..d2053df1111c 100644 > > --- a/kernel/pgo/Kconfig > > +++ b/kernel/pgo/Kconfig > > @@ -17,10 +17,11 @@ config PGO_CLANG > > > > Run a representative workload for your application on a kernel > > compiled with this option and download the raw profile file from > > - /sys/kernel/debug/pgo/profraw. This file needs to be processed with > > - llvm-profdata. It may be merged with other collected raw profiles. > > + /sys/kernel/debug/pgo/vmlinux.profraw. This file needs to be > > + processed with llvm-profdata. It may be merged with other collected > > + raw profiles. > > > > - Copy the resulting profile file into vmlinux.profdata, and enable > > + Copy the processed profile file into vmlinux.profdata, and enable > > KCFLAGS=-fprofile-use=vmlinux.profdata to produce an optimized > > kernel. > > > > diff --git a/kernel/pgo/fs.c b/kernel/pgo/fs.c > > index 449f16beb2cf..ef985159dad3 100644 > > --- a/kernel/pgo/fs.c > > +++ b/kernel/pgo/fs.c > > @@ -365,7 +365,7 @@ static int __init pgo_init(void) > > if (!directory) > > goto err_remove; > > > > - if (!debugfs_create_file("profraw", 0600, directory, NULL, > > + if (!debugfs_create_file("vmlinux.profraw", 0600, directory, NULL, > > &prf_fops)) > > goto err_remove; > > > >