linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pgo: rename the raw profile file to vmlinux.profraw
@ 2021-05-31 20:20 Bill Wendling
  2021-05-31 20:29 ` Nathan Chancellor
  2021-06-01 19:17 ` Kees Cook
  0 siblings, 2 replies; 5+ messages in thread
From: Bill Wendling @ 2021-05-31 20:20 UTC (permalink / raw)
  To: Kees Cook, Jonathan Corbet, Masahiro Yamada, linux-doc,
	linux-kernel, linux-kbuild, clang-built-linux, Andrew Morton
  Cc: Nathan Chancellor, Nick Desaulniers, Bill Wendling

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 <morbo@google.com>
---
 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;
 
-- 
2.32.0.rc0.204.g9fa02ecfa5-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] pgo: rename the raw profile file to vmlinux.profraw
  2021-05-31 20:20 [PATCH] pgo: rename the raw profile file to vmlinux.profraw Bill Wendling
@ 2021-05-31 20:29 ` Nathan Chancellor
  2021-06-01  8:24   ` Bill Wendling
  2021-06-01 19:17 ` Kees Cook
  1 sibling, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2021-05-31 20:29 UTC (permalink / raw)
  To: Bill Wendling, Kees Cook, Jonathan Corbet, Masahiro Yamada,
	linux-doc, linux-kernel, linux-kbuild, clang-built-linux,
	Andrew Morton
  Cc: Nick Desaulniers

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 <morbo@google.com>

Guess this clears up my confusion around the module patches :)

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>   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;
>   
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pgo: rename the raw profile file to vmlinux.profraw
  2021-05-31 20:29 ` Nathan Chancellor
@ 2021-06-01  8:24   ` Bill Wendling
  2021-06-01 19:13     ` Kees Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Bill Wendling @ 2021-06-01  8:24 UTC (permalink / raw)
  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

On Mon, May 31, 2021 at 1:29 PM Nathan Chancellor <nathan@kernel.org> 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 <morbo@google.com>
>
> 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 <nathan@kernel.org>
>
> > ---
> >   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;
> >
> >

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pgo: rename the raw profile file to vmlinux.profraw
  2021-06-01  8:24   ` Bill Wendling
@ 2021-06-01 19:13     ` Kees Cook
  0 siblings, 0 replies; 5+ messages in thread
From: Kees Cook @ 2021-06-01 19:13 UTC (permalink / raw)
  To: Bill Wendling
  Cc: Nathan Chancellor, Jonathan Corbet, Masahiro Yamada,
	Linux Doc Mailing List, LKML, Linux Kbuild mailing list,
	clang-built-linux, Andrew Morton, Nick Desaulniers, Jarmo Tiitto

On Tue, Jun 01, 2021 at 01:24:39AM -0700, 'Bill Wendling' via Clang Built Linux wrote:
> On Mon, May 31, 2021 at 1:29 PM Nathan Chancellor <nathan@kernel.org> 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 <morbo@google.com>
> >
> > 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. :-)

Is the expectation that there would be 1 file per module in
/sys/kernel/debug/pgo/ after the modules patch?

> 
> -bw
> 
> > Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> >
> > > ---
> > >   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

And if so, these instructions would change (in the future) to something
like:

     $ cp -a /sys/kernel/debug/pgo/*.profraw /tmp/prof/

?

-Kees

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pgo: rename the raw profile file to vmlinux.profraw
  2021-05-31 20:20 [PATCH] pgo: rename the raw profile file to vmlinux.profraw Bill Wendling
  2021-05-31 20:29 ` Nathan Chancellor
@ 2021-06-01 19:17 ` Kees Cook
  1 sibling, 0 replies; 5+ messages in thread
From: Kees Cook @ 2021-06-01 19:17 UTC (permalink / raw)
  To: Jonathan Corbet, clang-built-linux, Bill Wendling, Andrew Morton,
	Kees Cook, linux-doc, Masahiro Yamada, linux-kbuild,
	linux-kernel
  Cc: Kees Cook, Nathan Chancellor, Nick Desaulniers

On Mon, 31 May 2021 13:20:44 -0700, 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.

Applied to for-next/clang/features, thanks!

[1/1] pgo: rename the raw profile file to vmlinux.profraw
      https://git.kernel.org/kees/c/001eaf3fd0e3

-- 
Kees Cook


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-01 19:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31 20:20 [PATCH] pgo: rename the raw profile file to vmlinux.profraw Bill Wendling
2021-05-31 20:29 ` Nathan Chancellor
2021-06-01  8:24   ` Bill Wendling
2021-06-01 19:13     ` Kees Cook
2021-06-01 19:17 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).