[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+icZUUfk6bMCo+JXUy=5g-4qt20rDNR3b=HC9Ln_47UozXEDQ@mail.gmail.com>
Date: Thu, 22 Aug 2024 20:19:50 +0200
From: Sedat Dilek <sedat.dilek@...il.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Namhyung Kim <namhyung@...nel.org>, Ian Rogers <irogers@...gle.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>
Subject: Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
On Thu, Aug 22, 2024 at 8:17 PM Arnaldo Carvalho de Melo
<acme@...nel.org> wrote:
>
> On Thu, Aug 22, 2024 at 07:59:13PM +0200, Sedat Dilek wrote:
> > On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
> > <acme@...nel.org> wrote:
> > >
> > > On Thu, Aug 22, 2024 at 07:31:55PM +0200, Sedat Dilek wrote:
> > > > On Thu, Aug 22, 2024 at 7:19 PM Arnaldo Carvalho de Melo
> > > > <acme@...nel.org> wrote:
> > > > >
> > > > > On Thu, Aug 22, 2024 at 02:12:46PM -0300, Arnaldo Carvalho de Melo wrote:
> > > > > > On Thu, Aug 22, 2024 at 07:02:52PM +0200, Sedat Dilek wrote:
> > > > > > > On Thu, Aug 22, 2024 at 5:10 PM Arnaldo Carvalho de Melo <acme@...nel.org> wrote:
> > > > > > > > +++ b/tools/perf/util/setup.py
> > > > > > > > @@ -17,7 +17,7 @@ src_feature_tests = getenv('srctree') + '/tools/build/feature'
> > > > > >
> > > > > > > > def clang_has_option(option):
> > > > > > > > cc_output = Popen([cc, cc_options + option, path.join(src_feature_tests, "test-hello.c") ], stderr=PIPE).stderr.readlines()
> > > > > > > > - return [o for o in cc_output if ((b"unknown argument" in o) or (b"is not supported" in o))] == [ ]
> > > > > > > > + return [o for o in cc_output if ((b"unknown argument" in o) or (b"is not supported" in o) or (b"unknown warning option" in o))] == [ ]
> > > > > > > > if cc_is_clang:
> > > > > > > > from sysconfig import get_config_vars
> > > > > > > > @@ -63,6 +63,8 @@ cflags = getenv('CFLAGS', '').split()
> > > > > > > > cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls' ]
> > > > > > > > if cc_is_clang:
> > > > > > > > cflags += ["-Wno-unused-command-line-argument" ]
> > > > > > > > + if clang_has_option("-Wno-cast-function-type-mismatch"):
> > > > > > > > + cflags += ["-Wno-cast-function-type-mismatch" ]
> > > > > > > > else:
> > > > > > > > cflags += ['-Wno-cast-function-type' ]
> > > > > >
> > > > > > > I tried with your diff with SLIM LLVM toolchains 18 and 19.
> > > > > >
> > > > > > > Both work - see attached build-logs.
> > > > > >
> > > > > > > Yes, are right that LLVM/Clang v19 was first introducing:
> > > > > >
> > > > > > > -Wcast-function-type-mismatch / -Wno-cast-function-type-mismatch
> > > > > >
> > > > > > > [4] says for LLVM 18.1.8:
> > > > > >
> > > > > > > -Wcast-function-type
> > > > > > > -Wcast-function-type-strict
> > > > > >
> > > > > > > Feel free to add my Reported-by/Tested-by credentials if you sent a full patch.
> > > > > >
> > > > > > Thanks for the report and test of the fix, I'll add both tags,
> > > > >
> > > > > So below is the part that deals with disabling the warning if present,
> > > > > the other patch supporting checking warning options I merged as a prep
> > > > > patch.
> > > > >
> > > > > Thanks!
> > > > >
> > > > > - Arnaldo
> > > > >
> > > > > From 155212c965b5b23a90b8558449dbfd1c60dad934 Mon Sep 17 00:00:00 2001
> > > > > From: Arnaldo Carvalho de Melo <acme@...hat.com>
> > > > > Date: Thu, 22 Aug 2024 14:13:49 -0300
> > > > > Subject: [PATCH 1/1] perf python: Disable -Wno-cast-function-type-mismatch if
> > > > > present on clang
> > > > >
> > > > > The -Wcast-function-type-mismatch option was introduced in clang 19 and
> > > > > its enabled by default, since we use -Werror, and python bindings do
> > > > > casts that are valid but trips this warning, disable it if present.
> > > > >
> > > > > Reported-by: Sedat Dilek <sedat.dilek@...il.com>
> > > > > Tested-by: Sedat Dilek <sedat.dilek@...il.com>
> > > > > Cc: Ian Rogers <irogers@...gle.com>
> > > > > Cc: Ingo Molnar <mingo@...hat.com>
> > > > > Cc: Namhyung Kim <namhyung@...nel.org>
> > > > > Cc: Nathan Chancellor <nathan@...nel.org>
> > > > > Cc: Peter Zijlstra <peterz@...radead.org>
> > > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
> > > > > ---
> > > > > tools/perf/util/setup.py | 2 ++
> > > > > 1 file changed, 2 insertions(+)
> > > > >
> > > > > diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
> > > > > index 26c0f2614fe92eb6..649550e9b7aa8c8f 100644
> > > > > --- a/tools/perf/util/setup.py
> > > > > +++ b/tools/perf/util/setup.py
> > > > > @@ -63,6 +63,8 @@ cflags = getenv('CFLAGS', '').split()
> > > > > cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls' ]
> > > > > if cc_is_clang:
> > > > > cflags += ["-Wno-unused-command-line-argument" ]
> > > > > + if clang_has_option("-Wno-cast-function-type-mismatch"):
> > > > > + cflags += ["-Wno-cast-function-type-mismatch" ]
> > > > > else:
> > > > > cflags += ['-Wno-cast-function-type' ]
> > > > >
> > > > > --
> > > > > 2.46.0
> > > > >
> > > >
> > > > Thanks for the patch, Arnanldo.
> > > >
> > > > @Nathan Chancellor
> > > > What was the b4 magic to retrieve a patch included in a ML thread?
> > > >
> > > > I tried:
> > > >
> > > > link="https://lore.kernel.org/all/CA+icZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@mail.gmail.com/"
> > > >
> > > > b4 am $link
> > > > Grabbing thread from
> > > > lore.kernel.org/all/CA%2BicZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@...l.gmail.com/t.mbox.gz
> > > > Analyzing 9 messages in the thread
> > > > No patches found.
> > >
> > > I use:
> > >
> > > ⬢[acme@...lbox perf-tools-next]$ b4 am -ctsl --cc-trailers CA+icZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5+zQNQGUxK7+2aw@...l.gmail.com
> > > Grabbing thread from lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@...l.gmail.com/t.mbox.gz
> > > Analyzing 10 messages in the thread
> > > No patches found.
> > > ⬢[acme@...lbox perf-tools-next]$
> > >
> > > Using the Message-ID for your message, which normally is enough, but I
> > > think I didn't separate the patch from the rest of the message with ---.
> > >
> > > Lemme try...
> > >
> > > ---
> > >
> > > From 155212c965b5b23a90b8558449dbfd1c60dad934 Mon Sep 17 00:00:00 2001
> > > From: Arnaldo Carvalho de Melo <acme@...hat.com>
> > > Date: Thu, 22 Aug 2024 14:13:49 -0300
> > > Subject: [PATCH 1/1] perf python: Disable -Wno-cast-function-type-mismatch if
> > > present on clang
> > >
> > > The -Wcast-function-type-mismatch option was introduced in clang 19 and
> > > its enabled by default, since we use -Werror, and python bindings do
> > > casts that are valid but trips this warning, disable it if present.
> > >
> > > Reported-by: Sedat Dilek <sedat.dilek@...il.com>
> > > Tested-by: Sedat Dilek <sedat.dilek@...il.com>
> > > Cc: Ian Rogers <irogers@...gle.com>
> > > Cc: Ingo Molnar <mingo@...hat.com>
> > > Cc: Namhyung Kim <namhyung@...nel.org>
> > > Cc: Nathan Chancellor <nathan@...nel.org>
> > > Cc: Peter Zijlstra <peterz@...radead.org>
> > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
> > > ---
> > > tools/perf/util/setup.py | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
> > > index 26c0f2614fe92eb6..649550e9b7aa8c8f 100644
> > > --- a/tools/perf/util/setup.py
> > > +++ b/tools/perf/util/setup.py
> > > @@ -63,6 +63,8 @@ cflags = getenv('CFLAGS', '').split()
> > > cflags += ['-fno-strict-aliasing', '-Wno-write-strings', '-Wno-unused-parameter', '-Wno-redundant-decls' ]
> > > if cc_is_clang:
> > > cflags += ["-Wno-unused-command-line-argument" ]
> > > + if clang_has_option("-Wno-cast-function-type-mismatch"):
> > > + cflags += ["-Wno-cast-function-type-mismatch" ]
> > > else:
> > > cflags += ['-Wno-cast-function-type' ]
> > >
> > > --
> > > 2.46.0
> > >
> >
> > Hmm, OK.
> >
> > My first posting:
> > https://lore.kernel.org/all/CA+icZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@mail.gmail.com/
> >
> > $ b4 am -ctsl --cc-trailers
> > CA+icZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5+zQNQGUxK7+2aw@...l.gmail.com
> > Grabbing thread from
> > lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@...l.gmail.com/t.mbox.gz
> > Checking for newer revisions
> > Grabbing search results from lore.kernel.org
> > Analyzing 11 messages in the thread
> > No patches found.
> >
> > Did you drop that part by accident or intentionally from the patch?
>
> I mentioned that:
>
> > > > > the other patch supporting checking warning options I merged as a prep
> > > > > patch.
>
> Please take a look at tmp.perf-tools-next at:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git
>
> ⬢[acme@...lbox perf-tools-next]$ git log perf-tools-next/tmp.perf-tools-next -2 --oneline
> 155212c965b5b23a (perf-tools-next/tmp.perf-tools-next, perf-tools-next.korg/tmp.perf-tools-next, acme.korg/tmp.perf-tools-next) perf python: Disable -Wno-cast-function-type-mismatch if present on clang
> b81162302001f411 perf python: Allow checking for the existence of warning options in clang
> ⬢[acme@...lbox perf-tools-next]$
>
> One patch introduces a mechanism, the other uses it.
>
> - Arnaldo
OK, I see.
$ git log --oneline tags/v6.11-rc4..
eb942ec78d54 (HEAD -> for-6.11/perf-python-clang19-fixes-acme) perf
python: Disable -Wno-cast-function-type-mismatch if present on clang
579d6e9735d4 perf python: Allow checking for the existence of warning
options in clang
-Sedat-
Powered by blists - more mailing lists