[PATCH] compiler.h, tracing: Remove CONFIG_PROFILE_ALL_BRANCHES

From: Ingo Molnar
Date: Fri Apr 19 2019 - 15:12:37 EST



* Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> On Thu, Mar 07, 2019 at 01:18:41PM -0500, Steven Rostedt wrote:
> > On Thu, 7 Mar 2019 09:45:35 -0800
> > Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > > On Thu, Mar 7, 2019 at 9:38 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > > >
> > > > Also; it seems to me that something PT, or maybe even simply:
> > > >
> > > > perf -e branches -e branch-misses
> > > >
> > > > would get you similar or sufficient information.
>
> > I currently have one of my engineers looking at the data and may be
> > sending patches soon. It's basically an entry level way to get into
> > kernel development. Note, no patch will be sent just because of the
> > data from the profiling. The task is to look at and understand the
> > code, and see if it can be optimized (with likely/unlikely or flow
> > changes). It's a way to get a better understanding of the kernel in
> > various locations. It is by no means "profiler said this, lets change
> > it." All changes must be rational, and make sense. The profiler is only
> > used to help find those places.
>
> Can't you just have those same engineers look at perf data? This seems
> like a very expensive and convoluted way of getting something.

So since no-one offered objections to using perf branch profiling instead
(which method allows so much more than CONFIG_PROFILE_ALL_BRANCHES: such
as profiling glibc and other user-space, or allowing to branch-profile
the kernel is an uninstrumented form not distorted by
CONFIG_PROFILE_ALL_BRANCHES code generation artifacts), lemme propose the
attached patch to remove if-tracing.

If the CONFIG_PROFILE_ALL_BRANCHES=y feature is required for anyone it
can still be reverted privately or maintained out of tree - no need to
burden the mainline kernel with this.

I've build tested this and it Looks Perfect Hereâ.

Thanks,

Ingo

=============================>