Re: [PATCH v3 02/35] compiler-capability-analysis: Add infrastructure for Clang's capability analysis

Steven Rostedt
2025-09-18T16:13:25Z

On Thu, 18 Sep 2025 09:03:17 -0700
Bart Van Assche <bvanassche@acm.org> wrote:

> On 9/18/25 8:58 AM, Ian Rogers wrote:
> > On Thu, Sep 18, 2025 at 7:05 AM Marco Elver <elver@google.com> wrote:
> >> +config WARN_CAPABILITY_ANALYSIS
> >> + bool "Compiler capability-analysis warnings"
> >> + depends on CC_IS_CLANG && CLANG_VERSION >= 220000
> >> + # Branch profiling re-defines "if", which messes with the compiler's
> >> + # ability to analyze __cond_acquires(..), resulting in false positives.
> >> + depends on !TRACE_BRANCH_PROFILING
> >
> > Err, wow! What and huh, and why? Crikes. I'm amazed you found such an
> > option exists. I must be very naive to have never heard of it and now
> > I wonder if it is needed and load bearing?
>
> (+Steven)
>
> This is an old option. I think this commit introduced it:
>
> commit 52f232cb720a7babb752849cbc2cab2d24021209
> Author: Steven Rostedt <rostedt@goodmis.org>
> Date: Wed Nov 12 00:14:40 2008 -0500
>
> tracing: likely/unlikely branch annotation tracer
>

I still use it every year (enable it during December for a few weeks on my
workstation and server) and post the results publicly. When I get time, I
try to fix (add / remove) likely/unlikely statements. Unfortunately, I
haven't had time to look deeper at them.

https://rostedt.org/branches/current/

This year I missed December and ended up running it in January instead.

-- Steve