Re: [PATCH 00/20] objtool: UACCESS validation v3

From: Linus Torvalds
Date: Thu Mar 07 2019 - 12:46:00 EST

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.

Yeah, I'm not really seeing a lot of upside to PROFILE_ALL_BRANCHES.

Particularly since it doesn't actually profile all branches at all. It
only basically profiles "if ()" statements, which obviously misses
loops etc, but then also _does_ hit things where people turned loops
into "if (unlikely()) loop()", which happens in (for example)
low-level locking code etc that often has a fast-case "first try"
thing followed by a slow-case "ok, let's loop for it" thing.

So I think PROFILE_ALL_BRANCHES tends to have very random coverage.
I'd love to get rid of it, because it seems so random.