linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
@ 2024-08-21 19:23 Sedat Dilek
  2024-08-21 19:37 ` Sedat Dilek
  2024-08-22 14:26 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 22+ messages in thread
From: Sedat Dilek @ 2024-08-21 19:23 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
	Namhyung Kim, Ian Rogers
  Cc: linux-perf-users, linux-kernel, Nathan Chancellor

[-- Attachment #1: Type: text/plain, Size: 5927 bytes --]

Hi,

yesterday I jumped to Linux v6.11-rc4+.

Today, I played with perf.

I use the SLIM LLVM toolchains from kernel.org.

Link: https://mirrors.edge.kernel.org/pub/tools/llvm/files/

LLVM-18 is OK.

LLVM-19 produces ERRORS.

[ REPRODUCER ]

##LLVM_MVER="18"
LLVM_MVER="19"

# Debian LLVM
##LLVM_TOOLCHAIN_PATH="/usr/lib/llvm-${LLVM_MVER}/bin"
# Selfmade LLVM
LLVM_TOOLCHAIN_PATH="/opt/llvm/bin"
if [ -d ${LLVM_TOOLCHAIN_PATH} ]; then
   export PATH="${LLVM_TOOLCHAIN_PATH}:${PATH}"
fi

PYTHON_VER="3.12"
MAKE="make"
MAKE_OPTS="V=1 -j1 HOSTCC=clang-$LLVM_MVER HOSTLD=ld.lld
HOSTAR=llvm-ar CC=clang-$LLVM_MVER LD=ld.lld AR=llvm-ar
STRIP=llvm-strip"
##MAKE_OPTS="$MAKE_OPTS NO_LIBTRACEEVENT=1"
##MAKE_OPTS="$MAKE_OPTS NO_LIBDEBUGINFOD=1"

echo "LLVM MVER ........ $LLVM_MVER"
echo "Path settings .... $PATH"
echo "Python version ... $PYTHON_VER"
echo "make line ........ $MAKE $MAKE_OPTS"

LANG=C LC_ALL=C make -C tools/perf clean 2>&1 | tee ../make-log_perf-clean.txt

LANG=C LC_ALL=C $MAKE $MAKE_OPTS -C tools/perf
PYTHON=python${PYTHON_VER} install-bin 2>&1 | tee
../make-log_perf-install_bin_python${PYTHON_VER}_llvm${LLVM_MVER}.txt

[ ERRORS ]

  '/usr/bin/python3.12' util/setup.py \
 --quiet build_ext; \
cp python_ext_build/lib/perf*.so python/
/home/dileks/src/linux/git/tools/perf/util/python.c:816:15: error:
cast from 'PyObject *(*)(struct pyrf_evsel *, PyObject *, PyObject *)'
(aka 'struct _object *(*)(str
uct pyrf_evsel *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible funct
ion type [-Werror,-Wcast-function-type-mismatch]
 816 |                 .ml_meth  = (PyCFunction)pyrf_evsel__open,
     |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1050:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1050 |                 .ml_meth  = (PyCFunction)pyrf_evlist__mmap,
     |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1056:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1056 |                 .ml_meth  = (PyCFunction)pyrf_evlist__open,
     |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1062:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1062 |                 .ml_meth  = (PyCFunction)pyrf_evlist__poll,
     |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1068:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1068 |                 .ml_meth  = (PyCFunction)pyrf_evlist__get_pollfd,
     |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1074:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1074 |                 .ml_meth  = (PyCFunction)pyrf_evlist__add,
     |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1080:15: error:
cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
*)' (aka 'struct _object *(*)(s
truct pyrf_evlist *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible fu
nction type [-Werror,-Wcast-function-type-mismatch]
1080 |                 .ml_meth  = (PyCFunction)pyrf_evlist__read_on_cpu,
     |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dileks/src/linux/git/tools/perf/util/python.c:1244:15: error:
cast from 'PyObject *(*)(struct pyrf_evsel *, PyObject *, PyObject *)'
(aka 'struct _object *(*)(st
ruct pyrf_evsel *, struct _object *, struct _object *)') to
'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
_object *)') converts to incompatible func
tion type [-Werror,-Wcast-function-type-mismatch]
1244 |                 .ml_meth  = (PyCFunction) pyrf__tracepoint,
     |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 errors generated.
error: command '/opt/llvm/bin/clang-19' failed with exit code 1
cp: cannot stat 'python_ext_build/lib/perf*.so': No such file or directory
make[2]: *** [Makefile.perf:737:
python/perf.cpython-312-x86_64-linux-gnu.so] Error 1
make[1]: *** [Makefile.perf:290: sub-make] Error 2
make: *** [Makefile:113: install-bin] Error 2
make: Leaving directory '/home/dileks/src/linux/git/tools/perf'

INFO: Full build-log is attached.

Any known issue?

Thanks,

Best regards,
-Sedat-

[-- Attachment #2: make-log_perf-install_bin_python3.12_llvm19.txt.zst --]
[-- Type: application/zstd, Size: 17399 bytes --]

[-- Attachment #3: make-log_perf-install_bin_python3.12_llvm19.txt.zst.sha256 --]
[-- Type: application/octet-stream, Size: 118 bytes --]

a3a5d9c0c8ad4eba56a3de91b2defc0c85b35e581a9e082ba536cd3295f633e8  make-log_perf-install_bin_python3.12_llvm19.txt.zst

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-21 19:23 [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3 Sedat Dilek
@ 2024-08-21 19:37 ` Sedat Dilek
  2024-08-21 20:37   ` Namhyung Kim
  2024-08-22 14:26 ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 22+ messages in thread
From: Sedat Dilek @ 2024-08-21 19:37 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar,
	Namhyung Kim, Ian Rogers
  Cc: linux-perf-users, linux-kernel, Nathan Chancellor

As a workaround:

dileks@iniza:~/src/linux/git$ git diff
diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index 142e9d447ce7..db45e6fe7a21 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" ]
+    cflags += ["-Wno-cast-function-type-mismatch" ]
+
else:
    cflags += ['-Wno-cast-function-type' ]

dileks@iniza:~/src/linux/git$ ~/bin/perf -vv
perf version 6.11.0-rc4
                dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
   dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
        syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
               libbfd: [ OFF ]  # HAVE_LIBBFD_SUPPORT
           debuginfod: [ on  ]  # HAVE_DEBUGINFOD_SUPPORT
               libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
              libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
              libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
            libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
             libslang: [ on  ]  # HAVE_SLANG_SUPPORT
            libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
            libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
   libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
          libcapstone: [ on  ]  # HAVE_LIBCAPSTONE_SUPPORT
                 zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
                 lzma: [ on  ]  # HAVE_LZMA_SUPPORT
            get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
                  bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
                  aio: [ on  ]  # HAVE_AIO_SUPPORT
                 zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
              libpfm4: [ on  ]  # HAVE_LIBPFM
        libtraceevent: [ on  ]  # HAVE_LIBTRACEEVENT
        bpf_skeletons: [ on  ]  # HAVE_BPF_SKEL
 dwarf-unwind-support: [ on  ]  # HAVE_DWARF_UNWIND_SUPPORT
           libopencsd: [ OFF ]  # HAVE_CSTRACE_SUPPORT

-Sedat-

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-21 19:37 ` Sedat Dilek
@ 2024-08-21 20:37   ` Namhyung Kim
  2024-08-22 15:34     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 22+ messages in thread
From: Namhyung Kim @ 2024-08-21 20:37 UTC (permalink / raw)
  To: sedat.dilek
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

Hello,

On Wed, Aug 21, 2024 at 12:37 PM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> As a workaround:
>
> dileks@iniza:~/src/linux/git$ git diff
> diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
> index 142e9d447ce7..db45e6fe7a21 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" ]
> +    cflags += ["-Wno-cast-function-type-mismatch" ]
> +
> else:
>     cflags += ['-Wno-cast-function-type' ]
>

Thanks for the fix.  I wasn't aware of the issue and the fix
looks good to me.  I'll add it to perf-tools if nobody objects.

Thanks,
Namhyung


> dileks@iniza:~/src/linux/git$ ~/bin/perf -vv
> perf version 6.11.0-rc4
>                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
>    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
>         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
>                libbfd: [ OFF ]  # HAVE_LIBBFD_SUPPORT
>            debuginfod: [ on  ]  # HAVE_DEBUGINFOD_SUPPORT
>                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
>               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
>               libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
>             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
>              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
>             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
>             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
>    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
>           libcapstone: [ on  ]  # HAVE_LIBCAPSTONE_SUPPORT
>                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
>                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
>             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
>                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
>                   aio: [ on  ]  # HAVE_AIO_SUPPORT
>                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
>               libpfm4: [ on  ]  # HAVE_LIBPFM
>         libtraceevent: [ on  ]  # HAVE_LIBTRACEEVENT
>         bpf_skeletons: [ on  ]  # HAVE_BPF_SKEL
>  dwarf-unwind-support: [ on  ]  # HAVE_DWARF_UNWIND_SUPPORT
>            libopencsd: [ OFF ]  # HAVE_CSTRACE_SUPPORT
>
> -Sedat-

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-21 19:23 [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3 Sedat Dilek
  2024-08-21 19:37 ` Sedat Dilek
@ 2024-08-22 14:26 ` Arnaldo Carvalho de Melo
  2024-08-22 15:09   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-22 14:26 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Wed, Aug 21, 2024 at 09:23:36PM +0200, Sedat Dilek wrote:
> Hi,
> 
> yesterday I jumped to Linux v6.11-rc4+.
> 
> Today, I played with perf.
> 
> I use the SLIM LLVM toolchains from kernel.org.
> 
> Link: https://mirrors.edge.kernel.org/pub/tools/llvm/files/
> 
> LLVM-18 is OK.
> 
> LLVM-19 produces ERRORS.
> 
> [ REPRODUCER ]
> 
> ##LLVM_MVER="18"
> LLVM_MVER="19"
> 
> # Debian LLVM
> ##LLVM_TOOLCHAIN_PATH="/usr/lib/llvm-${LLVM_MVER}/bin"
> # Selfmade LLVM
> LLVM_TOOLCHAIN_PATH="/opt/llvm/bin"
> if [ -d ${LLVM_TOOLCHAIN_PATH} ]; then
>    export PATH="${LLVM_TOOLCHAIN_PATH}:${PATH}"
> fi
> 
> PYTHON_VER="3.12"
> MAKE="make"
> MAKE_OPTS="V=1 -j1 HOSTCC=clang-$LLVM_MVER HOSTLD=ld.lld
> HOSTAR=llvm-ar CC=clang-$LLVM_MVER LD=ld.lld AR=llvm-ar
> STRIP=llvm-strip"
> ##MAKE_OPTS="$MAKE_OPTS NO_LIBTRACEEVENT=1"
> ##MAKE_OPTS="$MAKE_OPTS NO_LIBDEBUGINFOD=1"
> 
> echo "LLVM MVER ........ $LLVM_MVER"
> echo "Path settings .... $PATH"
> echo "Python version ... $PYTHON_VER"
> echo "make line ........ $MAKE $MAKE_OPTS"
> 
> LANG=C LC_ALL=C make -C tools/perf clean 2>&1 | tee ../make-log_perf-clean.txt
> 
> LANG=C LC_ALL=C $MAKE $MAKE_OPTS -C tools/perf
> PYTHON=python${PYTHON_VER} install-bin 2>&1 | tee
> ../make-log_perf-install_bin_python${PYTHON_VER}_llvm${LLVM_MVER}.txt
> 
> [ ERRORS ]
> 
>   '/usr/bin/python3.12' util/setup.py \
>  --quiet build_ext; \
> cp python_ext_build/lib/perf*.so python/
> /home/dileks/src/linux/git/tools/perf/util/python.c:816:15: error:
> cast from 'PyObject *(*)(struct pyrf_evsel *, PyObject *, PyObject *)'
> (aka 'struct _object *(*)(str
> uct pyrf_evsel *, struct _object *, struct _object *)') to
> 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
> _object *)') converts to incompatible funct
> ion type [-Werror,-Wcast-function-type-mismatch]
>  816 |                 .ml_meth  = (PyCFunction)pyrf_evsel__open,
>      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/include/python3.12/object.h:/* PyObject_HEAD defines the initial segment of every PyObject. */
/usr/include/python3.12/object.h:#define PyObject_HEAD                   PyObject ob_base;

And:

struct pyrf_evsel {
        PyObject_HEAD

        struct evsel evsel;
};

So the cast is ok, I think we should disable that
-Wcast-function-type-mismatch for util/python.o when building with
clang.

Lemme try to cook a patch for you to test...

- Arnaldo

> /home/dileks/src/linux/git/tools/perf/util/python.c:1050:15: error:
> cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
> *)' (aka 'struct _object *(*)(s
> truct pyrf_evlist *, struct _object *, struct _object *)') to
> 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
> _object *)') converts to incompatible fu
> nction type [-Werror,-Wcast-function-type-mismatch]
> 1050 |                 .ml_meth  = (PyCFunction)pyrf_evlist__mmap,
>      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/dileks/src/linux/git/tools/perf/util/python.c:1056:15: error:
> cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
> *)' (aka 'struct _object *(*)(s
> truct pyrf_evlist *, struct _object *, struct _object *)') to
> 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
> _object *)') converts to incompatible fu
> nction type [-Werror,-Wcast-function-type-mismatch]
> 1056 |                 .ml_meth  = (PyCFunction)pyrf_evlist__open,
>      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/dileks/src/linux/git/tools/perf/util/python.c:1062:15: error:
> cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
> *)' (aka 'struct _object *(*)(s
> truct pyrf_evlist *, struct _object *, struct _object *)') to
> 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
> _object *)') converts to incompatible fu
> nction type [-Werror,-Wcast-function-type-mismatch]
> 1062 |                 .ml_meth  = (PyCFunction)pyrf_evlist__poll,
>      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/dileks/src/linux/git/tools/perf/util/python.c:1068:15: error:
> cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
> *)' (aka 'struct _object *(*)(s
> truct pyrf_evlist *, struct _object *, struct _object *)') to
> 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
> _object *)') converts to incompatible fu
> nction type [-Werror,-Wcast-function-type-mismatch]
> 1068 |                 .ml_meth  = (PyCFunction)pyrf_evlist__get_pollfd,
>      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/dileks/src/linux/git/tools/perf/util/python.c:1074:15: error:
> cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
> *)' (aka 'struct _object *(*)(s
> truct pyrf_evlist *, struct _object *, struct _object *)') to
> 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
> _object *)') converts to incompatible fu
> nction type [-Werror,-Wcast-function-type-mismatch]
> 1074 |                 .ml_meth  = (PyCFunction)pyrf_evlist__add,
>      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/dileks/src/linux/git/tools/perf/util/python.c:1080:15: error:
> cast from 'PyObject *(*)(struct pyrf_evlist *, PyObject *, PyObject
> *)' (aka 'struct _object *(*)(s
> truct pyrf_evlist *, struct _object *, struct _object *)') to
> 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
> _object *)') converts to incompatible fu
> nction type [-Werror,-Wcast-function-type-mismatch]
> 1080 |                 .ml_meth  = (PyCFunction)pyrf_evlist__read_on_cpu,
>      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/dileks/src/linux/git/tools/perf/util/python.c:1244:15: error:
> cast from 'PyObject *(*)(struct pyrf_evsel *, PyObject *, PyObject *)'
> (aka 'struct _object *(*)(st
> ruct pyrf_evsel *, struct _object *, struct _object *)') to
> 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct
> _object *)') converts to incompatible func
> tion type [-Werror,-Wcast-function-type-mismatch]
> 1244 |                 .ml_meth  = (PyCFunction) pyrf__tracepoint,
>      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 8 errors generated.
> error: command '/opt/llvm/bin/clang-19' failed with exit code 1
> cp: cannot stat 'python_ext_build/lib/perf*.so': No such file or directory
> make[2]: *** [Makefile.perf:737:
> python/perf.cpython-312-x86_64-linux-gnu.so] Error 1
> make[1]: *** [Makefile.perf:290: sub-make] Error 2
> make: *** [Makefile:113: install-bin] Error 2
> make: Leaving directory '/home/dileks/src/linux/git/tools/perf'
> 
> INFO: Full build-log is attached.
> 
> Any known issue?
> 
> Thanks,
> 
> Best regards,
> -Sedat-




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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 14:26 ` Arnaldo Carvalho de Melo
@ 2024-08-22 15:09   ` Arnaldo Carvalho de Melo
  2024-08-22 17:02     ` Sedat Dilek
  0 siblings, 1 reply; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-22 15:09 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 11:26:16AM -0300, Arnaldo Carvalho de Melo wrote:
> So the cast is ok, I think we should disable that
> -Wcast-function-type-mismatch for util/python.o when building with
> clang.
 
> Lemme try to cook a patch for you to test...

Can you try the patch below? Notice that there was already a patch
disabling that for !clang (gcc) for a similar reason:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b7a313d84e853049062011d78cb04b6decd12f5c

------------------------------------------------------------------------------------------
perf tools: Fix python extension build for gcc 8
The gcc 8 compiler won't compile the python extension code with the
following errors (one example):

  python.c:830:15: error: cast between incompatible  function types from              \
  ‘PyObject * (*)(struct pyrf_evsel *, PyObject *, PyObject *)’                       \
  uct _object * (*)(struct pyrf_evsel *, struct _object *, struct _object *)’} to     \
  ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _objeuct \
  _object *)’} [-Werror=cast-function-type]
     .ml_meth  = (PyCFunction)pyrf_evsel__open,

The problem with the PyMethodDef::ml_meth callback is that its type is
determined based on the PyMethodDef::ml_flags value, which we set as
METH_VARARGS | METH_KEYWORDS.
<SNIP>
------------------------------------------------------------------------------------------

Can you please check with both clang versions? I just checked with clang
18 as available in in Fedora 40 and it failed in the first, naïve patch,
that simply adds that -Wno- variant:

  GEN     /tmp/build/perf-tools-next/python/perf.cpython-312-x86_64-linux-gnu.so
error: unknown warning option '-Wno-cast-function-type-mismatch'; did you mean '-Wno-cast-function-type-strict'? [-Werror,-Wunknown-warning-option]
error: command '/usr/bin/clang' failed with exit code 1
cp: cannot stat '/tmp/build/perf-tools-next/python_ext_build/lib/perf*.so': No such file or directory

we need to check if clang has that option, we have infra for that, the
patch below works, please try it.

If it works with clang 19 I'll add two patches, one enhancing
clang_has_option and the other using it for this warning only present in
clang 19.

- Arnaldo

diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
index 142e9d447ce721e3..649550e9b7aa8c8f 100644
--- a/tools/perf/util/setup.py
+++ 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' ]
 

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-21 20:37   ` Namhyung Kim
@ 2024-08-22 15:34     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-22 15:34 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: sedat.dilek, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Wed, Aug 21, 2024 at 01:37:25PM -0700, Namhyung Kim wrote:
> Hello,
> 
> On Wed, Aug 21, 2024 at 12:37 PM Sedat Dilek <sedat.dilek@gmail.com> wrote:
> >
> > As a workaround:
> >
> > dileks@iniza:~/src/linux/git$ git diff
> > diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
> > index 142e9d447ce7..db45e6fe7a21 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" ]
> > +    cflags += ["-Wno-cast-function-type-mismatch" ]
> > +
> > else:
> >     cflags += ['-Wno-cast-function-type' ]
> >
> 
> Thanks for the fix.  I wasn't aware of the issue and the fix
> looks good to me.  I'll add it to perf-tools if nobody objects.

It doesn't work, please see the alternative patch I sent, if you try
that in a clang that doesn't have that warning option, it will fail,
i.e. clang 18 fails with the above patch.

- Arnaldo
 
> Thanks,
> Namhyung
> 
> 
> > dileks@iniza:~/src/linux/git$ ~/bin/perf -vv
> > perf version 6.11.0-rc4
> >                 dwarf: [ on  ]  # HAVE_DWARF_SUPPORT
> >    dwarf_getlocations: [ on  ]  # HAVE_DWARF_GETLOCATIONS_SUPPORT
> >         syscall_table: [ on  ]  # HAVE_SYSCALL_TABLE_SUPPORT
> >                libbfd: [ OFF ]  # HAVE_LIBBFD_SUPPORT
> >            debuginfod: [ on  ]  # HAVE_DEBUGINFOD_SUPPORT
> >                libelf: [ on  ]  # HAVE_LIBELF_SUPPORT
> >               libnuma: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> > numa_num_possible_cpus: [ on  ]  # HAVE_LIBNUMA_SUPPORT
> >               libperl: [ on  ]  # HAVE_LIBPERL_SUPPORT
> >             libpython: [ on  ]  # HAVE_LIBPYTHON_SUPPORT
> >              libslang: [ on  ]  # HAVE_SLANG_SUPPORT
> >             libcrypto: [ on  ]  # HAVE_LIBCRYPTO_SUPPORT
> >             libunwind: [ on  ]  # HAVE_LIBUNWIND_SUPPORT
> >    libdw-dwarf-unwind: [ on  ]  # HAVE_DWARF_SUPPORT
> >           libcapstone: [ on  ]  # HAVE_LIBCAPSTONE_SUPPORT
> >                  zlib: [ on  ]  # HAVE_ZLIB_SUPPORT
> >                  lzma: [ on  ]  # HAVE_LZMA_SUPPORT
> >             get_cpuid: [ on  ]  # HAVE_AUXTRACE_SUPPORT
> >                   bpf: [ on  ]  # HAVE_LIBBPF_SUPPORT
> >                   aio: [ on  ]  # HAVE_AIO_SUPPORT
> >                  zstd: [ on  ]  # HAVE_ZSTD_SUPPORT
> >               libpfm4: [ on  ]  # HAVE_LIBPFM
> >         libtraceevent: [ on  ]  # HAVE_LIBTRACEEVENT
> >         bpf_skeletons: [ on  ]  # HAVE_BPF_SKEL
> >  dwarf-unwind-support: [ on  ]  # HAVE_DWARF_UNWIND_SUPPORT
> >            libopencsd: [ OFF ]  # HAVE_CSTRACE_SUPPORT
> >
> > -Sedat-

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 15:09   ` Arnaldo Carvalho de Melo
@ 2024-08-22 17:02     ` Sedat Dilek
  2024-08-22 17:12       ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 22+ messages in thread
From: Sedat Dilek @ 2024-08-22 17:02 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

[-- Attachment #1: Type: text/plain, Size: 4504 bytes --]

On Thu, Aug 22, 2024 at 5:10 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> On Thu, Aug 22, 2024 at 11:26:16AM -0300, Arnaldo Carvalho de Melo wrote:
> > So the cast is ok, I think we should disable that
> > -Wcast-function-type-mismatch for util/python.o when building with
> > clang.
>
> > Lemme try to cook a patch for you to test...
>
> Can you try the patch below? Notice that there was already a patch
> disabling that for !clang (gcc) for a similar reason:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b7a313d84e853049062011d78cb04b6decd12f5c
>
> ------------------------------------------------------------------------------------------
> perf tools: Fix python extension build for gcc 8
> The gcc 8 compiler won't compile the python extension code with the
> following errors (one example):
>
>   python.c:830:15: error: cast between incompatible  function types from              \
>   ‘PyObject * (*)(struct pyrf_evsel *, PyObject *, PyObject *)’                       \
>   uct _object * (*)(struct pyrf_evsel *, struct _object *, struct _object *)’} to     \
>   ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _objeuct \
>   _object *)’} [-Werror=cast-function-type]
>      .ml_meth  = (PyCFunction)pyrf_evsel__open,
>
> The problem with the PyMethodDef::ml_meth callback is that its type is
> determined based on the PyMethodDef::ml_flags value, which we set as
> METH_VARARGS | METH_KEYWORDS.
> <SNIP>
> ------------------------------------------------------------------------------------------
>
> Can you please check with both clang versions? I just checked with clang
> 18 as available in in Fedora 40 and it failed in the first, naïve patch,
> that simply adds that -Wno- variant:
>
>   GEN     /tmp/build/perf-tools-next/python/perf.cpython-312-x86_64-linux-gnu.so
> error: unknown warning option '-Wno-cast-function-type-mismatch'; did you mean '-Wno-cast-function-type-strict'? [-Werror,-Wunknown-warning-option]
> error: command '/usr/bin/clang' failed with exit code 1
> cp: cannot stat '/tmp/build/perf-tools-next/python_ext_build/lib/perf*.so': No such file or directory
>
> we need to check if clang has that option, we have infra for that, the
> patch below works, please try it.
>
> If it works with clang 19 I'll add two patches, one enhancing
> clang_has_option and the other using it for this warning only present in
> clang 19.
>
> - Arnaldo
>
> diff --git a/tools/perf/util/setup.py b/tools/perf/util/setup.py
> index 142e9d447ce721e3..649550e9b7aa8c8f 100644
> --- a/tools/perf/util/setup.py
> +++ 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.

BR,
-Sedat-

[1] https://mirrors.edge.kernel.org/pub/tools/llvm/
[2] https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-18.1.8-x86_64.tar.xz
[3] https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-19.1.0-rc3-x86_64.tar.xz
[4] https://releases.llvm.org/18.1.8/tools/clang/docs/DiagnosticsReference.html
[5] https://clang.llvm.org/docs/DiagnosticsReference.html

[-- Attachment #2: make-log_perf-install_bin_python3.12_llvm18_acme-diff.txt.zst --]
[-- Type: application/zstd, Size: 17316 bytes --]

[-- Attachment #3: make-log_perf-install_bin_python3.12_llvm19_acme-diff.txt.zst --]
[-- Type: application/zstd, Size: 17286 bytes --]

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 17:02     ` Sedat Dilek
@ 2024-08-22 17:12       ` Arnaldo Carvalho de Melo
  2024-08-22 17:19         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-22 17:12 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

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@kernel.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,

Best regards,

- Arnaldo
 
> Thanks.
> 
> BR,
> -Sedat-
> 
> [1] https://mirrors.edge.kernel.org/pub/tools/llvm/
> [2] https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-18.1.8-x86_64.tar.xz
> [3] https://mirrors.edge.kernel.org/pub/tools/llvm/files/llvm-19.1.0-rc3-x86_64.tar.xz
> [4] https://releases.llvm.org/18.1.8/tools/clang/docs/DiagnosticsReference.html
> [5] https://clang.llvm.org/docs/DiagnosticsReference.html




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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 17:12       ` Arnaldo Carvalho de Melo
@ 2024-08-22 17:19         ` Arnaldo Carvalho de Melo
  2024-08-22 17:31           ` Sedat Dilek
  0 siblings, 1 reply; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-22 17:19 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

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@kernel.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@redhat.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@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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


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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 17:19         ` Arnaldo Carvalho de Melo
@ 2024-08-22 17:31           ` Sedat Dilek
  2024-08-22 17:40             ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 22+ messages in thread
From: Sedat Dilek @ 2024-08-22 17:31 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 7:19 PM Arnaldo Carvalho de Melo
<acme@kernel.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@kernel.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@redhat.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@gmail.com>
> Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@mail.gmail.com/t.mbox.gz
Analyzing 9 messages in the thread
No patches found.

-Sedat-

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 17:31           ` Sedat Dilek
@ 2024-08-22 17:40             ` Arnaldo Carvalho de Melo
  2024-08-22 17:59               ` Sedat Dilek
  0 siblings, 1 reply; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-22 17:40 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

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@kernel.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@kernel.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@redhat.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@gmail.com>
> > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > Cc: Ian Rogers <irogers@google.com>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Cc: Nathan Chancellor <nathan@kernel.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@mail.gmail.com/t.mbox.gz
> Analyzing 9 messages in the thread
> No patches found.

I use:

⬢[acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers CA+icZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5+zQNQGUxK7+2aw@mail.gmail.com
Grabbing thread from lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@mail.gmail.com/t.mbox.gz
Analyzing 10 messages in the thread
No patches found.
⬢[acme@toolbox 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@redhat.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@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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


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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 17:40             ` Arnaldo Carvalho de Melo
@ 2024-08-22 17:59               ` Sedat Dilek
  2024-08-22 18:17                 ` Namhyung Kim
  2024-08-22 18:17                 ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 22+ messages in thread
From: Sedat Dilek @ 2024-08-22 17:59 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
<acme@kernel.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@kernel.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@kernel.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@redhat.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@gmail.com>
> > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > Cc: Ian Rogers <irogers@google.com>
> > > Cc: Ingo Molnar <mingo@redhat.com>
> > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@mail.gmail.com/t.mbox.gz
> > Analyzing 9 messages in the thread
> > No patches found.
>
> I use:
>
> ⬢[acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers CA+icZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5+zQNQGUxK7+2aw@mail.gmail.com
> Grabbing thread from lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@mail.gmail.com/t.mbox.gz
> Analyzing 10 messages in the thread
> No patches found.
> ⬢[acme@toolbox 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@redhat.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@gmail.com>
> Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> Cc: Ian Rogers <irogers@google.com>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Namhyung Kim <namhyung@kernel.org>
> Cc: Nathan Chancellor <nathan@kernel.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@mail.gmail.com
Grabbing thread from
lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@mail.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?

 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))] == [
]

Thank for all.

-Sedat-

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 17:59               ` Sedat Dilek
@ 2024-08-22 18:17                 ` Namhyung Kim
  2024-08-22 18:20                   ` Arnaldo Carvalho de Melo
  2024-08-22 18:17                 ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 22+ messages in thread
From: Namhyung Kim @ 2024-08-22 18:17 UTC (permalink / raw)
  To: sedat.dilek
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 10:59 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
> <acme@kernel.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@kernel.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@kernel.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@redhat.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@gmail.com>
> > > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > Cc: Ian Rogers <irogers@google.com>
> > > > Cc: Ingo Molnar <mingo@redhat.com>
> > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@mail.gmail.com/t.mbox.gz
> > > Analyzing 9 messages in the thread
> > > No patches found.
> >
> > I use:
> >
> > ⬢[acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers CA+icZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5+zQNQGUxK7+2aw@mail.gmail.com
> > Grabbing thread from lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@mail.gmail.com/t.mbox.gz
> > Analyzing 10 messages in the thread
> > No patches found.
> > ⬢[acme@toolbox 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@redhat.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@gmail.com>
> > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > Cc: Ian Rogers <irogers@google.com>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Cc: Nathan Chancellor <nathan@kernel.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Can we also add 'Fixes' tag to make this picked by stable kernels?

Thanks,
Namhyung

> > ---
> >  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@mail.gmail.com
> Grabbing thread from
> lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@mail.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?
>
>  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))] == [
> ]
>
> Thank for all.
>
> -Sedat-

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 17:59               ` Sedat Dilek
  2024-08-22 18:17                 ` Namhyung Kim
@ 2024-08-22 18:17                 ` Arnaldo Carvalho de Melo
  2024-08-22 18:19                   ` Sedat Dilek
  1 sibling, 1 reply; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-22 18:17 UTC (permalink / raw)
  To: Sedat Dilek
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

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@kernel.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@kernel.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@kernel.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@redhat.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@gmail.com>
> > > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > Cc: Ian Rogers <irogers@google.com>
> > > > Cc: Ingo Molnar <mingo@redhat.com>
> > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@mail.gmail.com/t.mbox.gz
> > > Analyzing 9 messages in the thread
> > > No patches found.
> >
> > I use:
> >
> > ⬢[acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers CA+icZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5+zQNQGUxK7+2aw@mail.gmail.com
> > Grabbing thread from lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@mail.gmail.com/t.mbox.gz
> > Analyzing 10 messages in the thread
> > No patches found.
> > ⬢[acme@toolbox 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@redhat.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@gmail.com>
> > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > Cc: Ian Rogers <irogers@google.com>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Namhyung Kim <namhyung@kernel.org>
> > Cc: Nathan Chancellor <nathan@kernel.org>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@mail.gmail.com
> Grabbing thread from
> lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@mail.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@toolbox 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@toolbox perf-tools-next]$

One patch introduces a mechanism, the other uses it.

- Arnaldo

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 18:17                 ` Arnaldo Carvalho de Melo
@ 2024-08-22 18:19                   ` Sedat Dilek
  0 siblings, 0 replies; 22+ messages in thread
From: Sedat Dilek @ 2024-08-22 18:19 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, Namhyung Kim, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 8:17 PM Arnaldo Carvalho de Melo
<acme@kernel.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@kernel.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@kernel.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@kernel.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@redhat.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@gmail.com>
> > > > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > > Cc: Ian Rogers <irogers@google.com>
> > > > > Cc: Ingo Molnar <mingo@redhat.com>
> > > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@mail.gmail.com/t.mbox.gz
> > > > Analyzing 9 messages in the thread
> > > > No patches found.
> > >
> > > I use:
> > >
> > > ⬢[acme@toolbox perf-tools-next]$ b4 am -ctsl --cc-trailers CA+icZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5+zQNQGUxK7+2aw@mail.gmail.com
> > > Grabbing thread from lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@mail.gmail.com/t.mbox.gz
> > > Analyzing 10 messages in the thread
> > > No patches found.
> > > ⬢[acme@toolbox 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@redhat.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@gmail.com>
> > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > Cc: Ian Rogers <irogers@google.com>
> > > Cc: Ingo Molnar <mingo@redhat.com>
> > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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@mail.gmail.com
> > Grabbing thread from
> > lore.kernel.org/all/CA%2BicZUURwYd8nJSdMU7KW6nFjubi-VD2f-a5%2BzQNQGUxK7%2B2aw@mail.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@toolbox 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@toolbox 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-

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 18:17                 ` Namhyung Kim
@ 2024-08-22 18:20                   ` Arnaldo Carvalho de Melo
  2024-08-22 18:29                     ` Sedat Dilek
  2024-08-22 20:11                     ` Namhyung Kim
  0 siblings, 2 replies; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-22 18:20 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: sedat.dilek, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 11:17:21AM -0700, Namhyung Kim wrote:
> > On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
> > <acme@kernel.org> wrote:
> > > From 155212c965b5b23a90b8558449dbfd1c60dad934 Mon Sep 17 00:00:00 2001
> > > From: Arnaldo Carvalho de Melo <acme@redhat.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@gmail.com>
> > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > Cc: Ian Rogers <irogers@google.com>
> > > Cc: Ingo Molnar <mingo@redhat.com>
> > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> Can we also add 'Fixes' tag to make this picked by stable kernels?

Fixes what? This isn't a regression, clang 19 isn't available for Fedora
40, the most recent.

- Arnaldo

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 18:20                   ` Arnaldo Carvalho de Melo
@ 2024-08-22 18:29                     ` Sedat Dilek
  2024-08-22 20:11                     ` Namhyung Kim
  1 sibling, 0 replies; 22+ messages in thread
From: Sedat Dilek @ 2024-08-22 18:29 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Namhyung Kim, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 8:20 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> On Thu, Aug 22, 2024 at 11:17:21AM -0700, Namhyung Kim wrote:
> > > On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
> > > <acme@kernel.org> wrote:
> > > > From 155212c965b5b23a90b8558449dbfd1c60dad934 Mon Sep 17 00:00:00 2001
> > > > From: Arnaldo Carvalho de Melo <acme@redhat.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@gmail.com>
> > > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > Cc: Ian Rogers <irogers@google.com>
> > > > Cc: Ingo Molnar <mingo@redhat.com>
> > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> >
> > Can we also add 'Fixes' tag to make this picked by stable kernels?
>
> Fixes what? This isn't a regression, clang 19 isn't available for Fedora
> 40, the most recent.
>
> - Arnaldo

From [1]:

LLVM Release Schedule - 19.1.x:

Jul 23rd: release/19.x branch created
Jul 26th: 19.1.0-rc1
Aug  6th: 19.1.0-rc2
Aug 20th: 19.1.0-rc3
Sep  3rd: 19.1.0 <--- XXX
Sep 17th: 19.1.1
Oct  1st: 19.1.2
Oct 15th: 19.1.3
Oct 29th: 19.1.4
Nov 12th: 19.1.5
Nov 26th: 19.1.6 (if necessary)

-Sedat-

[1] https://github.com/ClangBuiltLinux/linux/issues/2040

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 18:20                   ` Arnaldo Carvalho de Melo
  2024-08-22 18:29                     ` Sedat Dilek
@ 2024-08-22 20:11                     ` Namhyung Kim
  2024-08-22 20:26                       ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 22+ messages in thread
From: Namhyung Kim @ 2024-08-22 20:11 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: sedat.dilek, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 11:20 AM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> On Thu, Aug 22, 2024 at 11:17:21AM -0700, Namhyung Kim wrote:
> > > On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
> > > <acme@kernel.org> wrote:
> > > > From 155212c965b5b23a90b8558449dbfd1c60dad934 Mon Sep 17 00:00:00 2001
> > > > From: Arnaldo Carvalho de Melo <acme@redhat.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@gmail.com>
> > > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > Cc: Ian Rogers <irogers@google.com>
> > > > Cc: Ingo Molnar <mingo@redhat.com>
> > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> >
> > Can we also add 'Fixes' tag to make this picked by stable kernels?
>
> Fixes what? This isn't a regression, clang 19 isn't available for Fedora
> 40, the most recent.

No, I'm not saying it's a bug.  But we may want to build the old
source code using new clang.

Thanks,
Namhyung

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 20:11                     ` Namhyung Kim
@ 2024-08-22 20:26                       ` Arnaldo Carvalho de Melo
  2024-08-22 20:30                         ` Namhyung Kim
  0 siblings, 1 reply; 22+ messages in thread
From: Arnaldo Carvalho de Melo @ 2024-08-22 20:26 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: sedat.dilek, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 01:11:22PM -0700, Namhyung Kim wrote:
> On Thu, Aug 22, 2024 at 11:20 AM Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
> >
> > On Thu, Aug 22, 2024 at 11:17:21AM -0700, Namhyung Kim wrote:
> > > > On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
> > > > <acme@kernel.org> wrote:
> > > > > From 155212c965b5b23a90b8558449dbfd1c60dad934 Mon Sep 17 00:00:00 2001
> > > > > From: Arnaldo Carvalho de Melo <acme@redhat.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@gmail.com>
> > > > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > > Cc: Ian Rogers <irogers@google.com>
> > > > > Cc: Ingo Molnar <mingo@redhat.com>
> > > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > >
> > > Can we also add 'Fixes' tag to make this picked by stable kernels?
> >
> > Fixes what? This isn't a regression, clang 19 isn't available for Fedora
> > 40, the most recent.
> 
> No, I'm not saying it's a bug.  But we may want to build the old
> source code using new clang.

Sure, and with the tags we have now, we can signal it by using Closes:
and Cc: stable@kernel.org, without a version, I added those, the tags
section then is this:

    Closes: https://lore.kernel.org/all/CA+icZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@mail.gmail.com
    Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
    Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
    Cc: Ian Rogers <irogers@google.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Cc: Nathan Chancellor <nathan@kernel.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: stable@vger.kernel.org # To allow building with the upcoming clang 19
    Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Ok?

- Arnaldo

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 20:26                       ` Arnaldo Carvalho de Melo
@ 2024-08-22 20:30                         ` Namhyung Kim
  2024-08-23 13:58                           ` Sedat Dilek
  0 siblings, 1 reply; 22+ messages in thread
From: Namhyung Kim @ 2024-08-22 20:30 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: sedat.dilek, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 1:26 PM Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
>
> On Thu, Aug 22, 2024 at 01:11:22PM -0700, Namhyung Kim wrote:
> > On Thu, Aug 22, 2024 at 11:20 AM Arnaldo Carvalho de Melo
> > <acme@kernel.org> wrote:
> > >
> > > On Thu, Aug 22, 2024 at 11:17:21AM -0700, Namhyung Kim wrote:
> > > > > On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
> > > > > <acme@kernel.org> wrote:
> > > > > > From 155212c965b5b23a90b8558449dbfd1c60dad934 Mon Sep 17 00:00:00 2001
> > > > > > From: Arnaldo Carvalho de Melo <acme@redhat.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@gmail.com>
> > > > > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > > > Cc: Ian Rogers <irogers@google.com>
> > > > > > Cc: Ingo Molnar <mingo@redhat.com>
> > > > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > > > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > > >
> > > > Can we also add 'Fixes' tag to make this picked by stable kernels?
> > >
> > > Fixes what? This isn't a regression, clang 19 isn't available for Fedora
> > > 40, the most recent.
> >
> > No, I'm not saying it's a bug.  But we may want to build the old
> > source code using new clang.
>
> Sure, and with the tags we have now, we can signal it by using Closes:
> and Cc: stable@kernel.org, without a version, I added those, the tags
> section then is this:
>
>     Closes: https://lore.kernel.org/all/CA+icZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@mail.gmail.com
>     Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
>     Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
>     Cc: Ian Rogers <irogers@google.com>
>     Cc: Ingo Molnar <mingo@redhat.com>
>     Cc: Namhyung Kim <namhyung@kernel.org>
>     Cc: Nathan Chancellor <nathan@kernel.org>
>     Cc: Peter Zijlstra <peterz@infradead.org>
>     Cc: stable@vger.kernel.org # To allow building with the upcoming clang 19
>     Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
>     Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> Ok?

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-22 20:30                         ` Namhyung Kim
@ 2024-08-23 13:58                           ` Sedat Dilek
  2024-08-23 15:03                             ` Namhyung Kim
  0 siblings, 1 reply; 22+ messages in thread
From: Sedat Dilek @ 2024-08-23 13:58 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

On Thu, Aug 22, 2024 at 10:31 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> On Thu, Aug 22, 2024 at 1:26 PM Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
> >
> > On Thu, Aug 22, 2024 at 01:11:22PM -0700, Namhyung Kim wrote:
> > > On Thu, Aug 22, 2024 at 11:20 AM Arnaldo Carvalho de Melo
> > > <acme@kernel.org> wrote:
> > > >
> > > > On Thu, Aug 22, 2024 at 11:17:21AM -0700, Namhyung Kim wrote:
> > > > > > On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
> > > > > > <acme@kernel.org> wrote:
> > > > > > > From 155212c965b5b23a90b8558449dbfd1c60dad934 Mon Sep 17 00:00:00 2001
> > > > > > > From: Arnaldo Carvalho de Melo <acme@redhat.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@gmail.com>
> > > > > > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > > > > Cc: Ian Rogers <irogers@google.com>
> > > > > > > Cc: Ingo Molnar <mingo@redhat.com>
> > > > > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > > > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > > > > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > > > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > > > >
> > > > > Can we also add 'Fixes' tag to make this picked by stable kernels?
> > > >
> > > > Fixes what? This isn't a regression, clang 19 isn't available for Fedora
> > > > 40, the most recent.
> > >
> > > No, I'm not saying it's a bug.  But we may want to build the old
> > > source code using new clang.
> >
> > Sure, and with the tags we have now, we can signal it by using Closes:
> > and Cc: stable@kernel.org, without a version, I added those, the tags
> > section then is this:
> >
> >     Closes: https://lore.kernel.org/all/CA+icZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@mail.gmail.com
> >     Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
> >     Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> >     Cc: Ian Rogers <irogers@google.com>
> >     Cc: Ingo Molnar <mingo@redhat.com>
> >     Cc: Namhyung Kim <namhyung@kernel.org>
> >     Cc: Nathan Chancellor <nathan@kernel.org>
> >     Cc: Peter Zijlstra <peterz@infradead.org>
> >     Cc: stable@vger.kernel.org # To allow building with the upcoming clang 19
> >     Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> >     Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> >
> > Ok?
>
> Acked-by: Namhyung Kim <namhyung@kernel.org>
>
> Thanks,
> Namhyung

Hey Namhyung,

are you aware of ...?

From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com
Subject: [perf-tools:tmp.perf-tools 1/1] error: command 'clang' failed
with exit code 1
Date: Fri, 23 Aug 2024 18:43:32 +0800 [thread overview]
Message-ID: <202408231822.dWGP67uY-lkp@intel.com> (raw)

https://lore.kernel.org/all/202408231822.dWGP67uY-lkp@intel.com/

That points to commit:

perf tools: Fix a build error with clang 19
https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools.git/commit/?h=tmp.perf-tools&id=cf36d63d7cc9a9770f69f44a10904e9fb0895fa9

That is fine with lLVM/Clang-19, but breaks previous versions like
LLVM-18 as explained in [1].

The REAL fixes are:

perf python: Allow checking for the existence of warning options in clang
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?h=tmp.perf-tools-next&id=b81162302001f41157f6e93654aaccc30e817e2a

perf python: Disable -Wno-cast-function-type-mismatch if present on clang
https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?h=tmp.perf-tools-next&id=155212c965b5b23a90b8558449dbfd1c60dad934

Unsure if the commit-ids will change.

Do you happen to know how to feed the LKP-tests bot?

Best regards,
-Sedat-

[1] https://lore.kernel.org/all/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com/

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

* Re: [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3
  2024-08-23 13:58                           ` Sedat Dilek
@ 2024-08-23 15:03                             ` Namhyung Kim
  0 siblings, 0 replies; 22+ messages in thread
From: Namhyung Kim @ 2024-08-23 15:03 UTC (permalink / raw)
  To: sedat.dilek
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Ingo Molnar, Ian Rogers,
	linux-perf-users, linux-kernel, Nathan Chancellor

Hello,

On Fri, Aug 23, 2024 at 6:58 AM Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Thu, Aug 22, 2024 at 10:31 PM Namhyung Kim <namhyung@kernel.org> wrote:
> >
> > On Thu, Aug 22, 2024 at 1:26 PM Arnaldo Carvalho de Melo
> > <acme@kernel.org> wrote:
> > >
> > > On Thu, Aug 22, 2024 at 01:11:22PM -0700, Namhyung Kim wrote:
> > > > On Thu, Aug 22, 2024 at 11:20 AM Arnaldo Carvalho de Melo
> > > > <acme@kernel.org> wrote:
> > > > >
> > > > > On Thu, Aug 22, 2024 at 11:17:21AM -0700, Namhyung Kim wrote:
> > > > > > > On Thu, Aug 22, 2024 at 7:40 PM Arnaldo Carvalho de Melo
> > > > > > > <acme@kernel.org> wrote:
> > > > > > > > From 155212c965b5b23a90b8558449dbfd1c60dad934 Mon Sep 17 00:00:00 2001
> > > > > > > > From: Arnaldo Carvalho de Melo <acme@redhat.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@gmail.com>
> > > > > > > > Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > > > > > > > Cc: Ian Rogers <irogers@google.com>
> > > > > > > > Cc: Ingo Molnar <mingo@redhat.com>
> > > > > > > > Cc: Namhyung Kim <namhyung@kernel.org>
> > > > > > > > Cc: Nathan Chancellor <nathan@kernel.org>
> > > > > > > > Cc: Peter Zijlstra <peterz@infradead.org>
> > > > > > > > Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > > > > > > > Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > > > > >
> > > > > > Can we also add 'Fixes' tag to make this picked by stable kernels?
> > > > >
> > > > > Fixes what? This isn't a regression, clang 19 isn't available for Fedora
> > > > > 40, the most recent.
> > > >
> > > > No, I'm not saying it's a bug.  But we may want to build the old
> > > > source code using new clang.
> > >
> > > Sure, and with the tags we have now, we can signal it by using Closes:
> > > and Cc: stable@kernel.org, without a version, I added those, the tags
> > > section then is this:
> > >
> > >     Closes: https://lore.kernel.org/all/CA+icZUXoJ6BS3GMhJHV3aZWyb5Cz2haFneX0C5pUMUUhG-UVKQ@mail.gmail.com
> > >     Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
> > >     Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> > >     Cc: Ian Rogers <irogers@google.com>
> > >     Cc: Ingo Molnar <mingo@redhat.com>
> > >     Cc: Namhyung Kim <namhyung@kernel.org>
> > >     Cc: Nathan Chancellor <nathan@kernel.org>
> > >     Cc: Peter Zijlstra <peterz@infradead.org>
> > >     Cc: stable@vger.kernel.org # To allow building with the upcoming clang 19
> > >     Link: https://lore.kernel.org/lkml/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com
> > >     Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > >
> > > Ok?
> >
> > Acked-by: Namhyung Kim <namhyung@kernel.org>
> >
> > Thanks,
> > Namhyung
>
> Hey Namhyung,
>
> are you aware of ...?

Oh.. I tentatively added your original patch to tmp.perf-tools branch.
I'll drop that and go with Arnaldo's fix in perf-tools-next.

Thanks,
Namhyung

>
> From: kernel test robot <lkp@intel.com>
> To: oe-kbuild@lists.linux.dev
> Cc: lkp@intel.com
> Subject: [perf-tools:tmp.perf-tools 1/1] error: command 'clang' failed
> with exit code 1
> Date: Fri, 23 Aug 2024 18:43:32 +0800 [thread overview]
> Message-ID: <202408231822.dWGP67uY-lkp@intel.com> (raw)
>
> https://lore.kernel.org/all/202408231822.dWGP67uY-lkp@intel.com/
>
> That points to commit:
>
> perf tools: Fix a build error with clang 19
> https://git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools.git/commit/?h=tmp.perf-tools&id=cf36d63d7cc9a9770f69f44a10904e9fb0895fa9
>
> That is fine with lLVM/Clang-19, but breaks previous versions like
> LLVM-18 as explained in [1].
>
> The REAL fixes are:
>
> perf python: Allow checking for the existence of warning options in clang
> https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?h=tmp.perf-tools-next&id=b81162302001f41157f6e93654aaccc30e817e2a
>
> perf python: Disable -Wno-cast-function-type-mismatch if present on clang
> https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/commit/?h=tmp.perf-tools-next&id=155212c965b5b23a90b8558449dbfd1c60dad934
>
> Unsure if the commit-ids will change.
>
> Do you happen to know how to feed the LKP-tests bot?
>
> Best regards,
> -Sedat-
>
> [1] https://lore.kernel.org/all/CA+icZUVtHn8X1Tb_Y__c-WswsO0K8U9uy3r2MzKXwTA5THtL7w@mail.gmail.com/

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

end of thread, other threads:[~2024-08-23 15:03 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-21 19:23 [Linux-6.11-rc4] perf BROKEN with LLVM/Clang 19.1.0-rc3 Sedat Dilek
2024-08-21 19:37 ` Sedat Dilek
2024-08-21 20:37   ` Namhyung Kim
2024-08-22 15:34     ` Arnaldo Carvalho de Melo
2024-08-22 14:26 ` Arnaldo Carvalho de Melo
2024-08-22 15:09   ` Arnaldo Carvalho de Melo
2024-08-22 17:02     ` Sedat Dilek
2024-08-22 17:12       ` Arnaldo Carvalho de Melo
2024-08-22 17:19         ` Arnaldo Carvalho de Melo
2024-08-22 17:31           ` Sedat Dilek
2024-08-22 17:40             ` Arnaldo Carvalho de Melo
2024-08-22 17:59               ` Sedat Dilek
2024-08-22 18:17                 ` Namhyung Kim
2024-08-22 18:20                   ` Arnaldo Carvalho de Melo
2024-08-22 18:29                     ` Sedat Dilek
2024-08-22 20:11                     ` Namhyung Kim
2024-08-22 20:26                       ` Arnaldo Carvalho de Melo
2024-08-22 20:30                         ` Namhyung Kim
2024-08-23 13:58                           ` Sedat Dilek
2024-08-23 15:03                             ` Namhyung Kim
2024-08-22 18:17                 ` Arnaldo Carvalho de Melo
2024-08-22 18:19                   ` Sedat Dilek

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).