2020-01-05 17:03:30

by Gordan Bobic

[permalink] [raw]
Subject: Re: 4.9.208 regression in perf building

It looks like 4.9.208 introduces a build regression for perf:

make -f /builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/build/Makefile.build
dir=. obj=perf
gcc -Wp,-MD,./.builtin-report.o.d,-MT,builtin-report.o
-Wbad-function-cast -Wdeclaration-after-statement -Wformat-security
-Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes
-Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked
-Wredundant-decls -Wshadow -Wstrict-aliasing=3 -Wstrict-prototypes
-Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat
-DHAVE_ARCH_X86_64_SUPPORT -DHAVE_SYSCALL_TABLE
-Iarch/x86/include/generated -DHAVE_PERF_REGS_SUPPORT
-DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -O6 -fno-omit-frame-pointer
-ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all
-D_FORTIFY_SOURCE=2
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf/util/include
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf/arch/x86/include
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/include/uapi
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/include/
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/arch/x86/include/uapi
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/arch/x86/include/
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/arch/x86/
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf/util
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf
-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/lib/
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT
-DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_DWARF_GETLOCATIONS
-DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT
-DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT
-DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT
-DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT
-DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DHAVE_LIBAUDIT_SUPPORT
-DHAVE_LIBCRYPTO_SUPPORT -I/usr/include/slang -DHAVE_SLANG_SUPPORT
-DHAVE_TIMERFD_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT
-DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT
-DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -D"BUILD_STR(s)=#s"
-DTIPDIR="BUILD_STR(share/doc/perf-tip)"
-DDOCDIR="BUILD_STR(/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf/Documentation)"
-c -o builtin-report.o builtin-report.c
builtin-report.c: In function ‘report__setup_sample_type’:
builtin-report.c:296:6: error: ‘dwarf_callchain_users’ undeclared
(first use in this function)
if (dwarf_callchain_users) {
^
builtin-report.c:296:6: note: each undeclared identifier is reported
only once for each function it appears in
mv: cannot stat ‘./.builtin-report.o.tmp’: No such file or directory
make[3]: *** [builtin-report.o] Error 1
make[2]: *** [perf-in.o] Error 2
make[1]: *** [sub-make] Error 2
make: *** [all] Error 2

4,9.207 works fine.


2020-01-05 18:24:37

by Akemi Yagi

[permalink] [raw]
Subject: Re: 4.9.208 regression in perf building

Adding Arnaldo and Jiri to the CC list.

On Sun, Jan 5, 2020 at 9:01 AM Gordan Bobic <[email protected]> wrote:
>
> It looks like 4.9.208 introduces a build regression for perf:
>
> make -f /builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/build/Makefile.build
> dir=. obj=perf

> -c -o builtin-report.o builtin-report.c
> builtin-report.c: In function ‘report__setup_sample_type’:
> builtin-report.c:296:6: error: ‘dwarf_callchain_users’ undeclared
> (first use in this function)
> if (dwarf_callchain_users) {
> ^
> builtin-report.c:296:6: note: each undeclared identifier is reported
> only once for each function it appears in
> mv: cannot stat ‘./.builtin-report.o.tmp’: No such file or directory
> make[3]: *** [builtin-report.o] Error 1
> make[2]: *** [perf-in.o] Error 2
> make[1]: *** [sub-make] Error 2
> make: *** [all] Error 2
>
> 4,9.207 works fine.

The regression was caused by the following patch:

https://lore.kernel.org/lkml/[email protected]/

To fix this, 'dwarf_callchain_users' needs to be declared.

Akemi

2020-01-05 18:30:24

by Sasha Levin

[permalink] [raw]
Subject: Re: 4.9.208 regression in perf building

On Sun, Jan 05, 2020 at 05:01:00PM +0000, Gordan Bobic wrote:
>It looks like 4.9.208 introduces a build regression for perf:
>
>make -f /builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/build/Makefile.build
>dir=. obj=perf
> gcc -Wp,-MD,./.builtin-report.o.d,-MT,builtin-report.o
>-Wbad-function-cast -Wdeclaration-after-statement -Wformat-security
>-Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes
>-Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked
>-Wredundant-decls -Wshadow -Wstrict-aliasing=3 -Wstrict-prototypes
>-Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat
>-DHAVE_ARCH_X86_64_SUPPORT -DHAVE_SYSCALL_TABLE
>-Iarch/x86/include/generated -DHAVE_PERF_REGS_SUPPORT
>-DHAVE_ARCH_REGS_QUERY_REGISTER_OFFSET -O6 -fno-omit-frame-pointer
>-ggdb3 -funwind-tables -Wall -Wextra -std=gnu99 -fstack-protector-all
>-D_FORTIFY_SOURCE=2
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf/util/include
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf/arch/x86/include
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/include/uapi
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/include/
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/arch/x86/include/uapi
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/arch/x86/include/
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/arch/x86/
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf/util
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf
>-I/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/lib/
>-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
>-DHAVE_SYNC_COMPARE_AND_SWAP_SUPPORT
>-DHAVE_PTHREAD_ATTR_SETAFFINITY_NP -DHAVE_DWARF_GETLOCATIONS
>-DHAVE_LIBELF_SUPPORT -DHAVE_LIBELF_MMAP_SUPPORT
>-DHAVE_ELF_GETPHDRNUM_SUPPORT -DHAVE_GELF_GETNOTE_SUPPORT
>-DHAVE_ELF_GETSHDRSTRNDX_SUPPORT -DHAVE_DWARF_SUPPORT
>-DHAVE_LIBBPF_SUPPORT -DHAVE_BPF_PROLOGUE -DHAVE_SDT_EVENT
>-DHAVE_JITDUMP -DHAVE_DWARF_UNWIND_SUPPORT -DHAVE_LIBAUDIT_SUPPORT
>-DHAVE_LIBCRYPTO_SUPPORT -I/usr/include/slang -DHAVE_SLANG_SUPPORT
>-DHAVE_TIMERFD_SUPPORT -DHAVE_LIBBFD_SUPPORT -DHAVE_ZLIB_SUPPORT
>-DHAVE_LZMA_SUPPORT -DHAVE_BACKTRACE_SUPPORT -DHAVE_LIBNUMA_SUPPORT
>-DHAVE_KVM_STAT_SUPPORT -DHAVE_AUXTRACE_SUPPORT -D"BUILD_STR(s)=#s"
>-DTIPDIR="BUILD_STR(share/doc/perf-tip)"
>-DDOCDIR="BUILD_STR(/builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/perf/Documentation)"
> -c -o builtin-report.o builtin-report.c
>builtin-report.c: In function ‘report__setup_sample_type’:
>builtin-report.c:296:6: error: ‘dwarf_callchain_users’ undeclared
>(first use in this function)
> if (dwarf_callchain_users) {
> ^
>builtin-report.c:296:6: note: each undeclared identifier is reported
>only once for each function it appears in
>mv: cannot stat ‘./.builtin-report.o.tmp’: No such file or directory
>make[3]: *** [builtin-report.o] Error 1
>make[2]: *** [perf-in.o] Error 2
>make[1]: *** [sub-make] Error 2
>make: *** [all] Error 2
>
>4,9.207 works fine.

Looks like 59b706ce44db ("perf report: Add warning when libunwind not
compiled in") depends on eabad8c6856f ("perf unwind: Do not look just at
the global callchain_param.record_mode") which is tricky to backport.
I'll just drop 59b706ce44db from 4.9 and 4.4. Thanks for the report!

--
Thanks,
Sasha

2020-01-05 19:38:54

by Jiri Olsa

[permalink] [raw]
Subject: Re: 4.9.208 regression in perf building

On Sun, Jan 05, 2020 at 10:21:25AM -0800, Akemi Yagi wrote:
> Adding Arnaldo and Jiri to the CC list.
>
> On Sun, Jan 5, 2020 at 9:01 AM Gordan Bobic <[email protected]> wrote:
> >
> > It looks like 4.9.208 introduces a build regression for perf:
> >
> > make -f /builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/build/Makefile.build
> > dir=. obj=perf
>
> > -c -o builtin-report.o builtin-report.c
> > builtin-report.c: In function ‘report__setup_sample_type’:
> > builtin-report.c:296:6: error: ‘dwarf_callchain_users’ undeclared
> > (first use in this function)
> > if (dwarf_callchain_users) {
> > ^
> > builtin-report.c:296:6: note: each undeclared identifier is reported
> > only once for each function it appears in
> > mv: cannot stat ‘./.builtin-report.o.tmp’: No such file or directory
> > make[3]: *** [builtin-report.o] Error 1
> > make[2]: *** [perf-in.o] Error 2
> > make[1]: *** [sub-make] Error 2
> > make: *** [all] Error 2
> >
> > 4,9.207 works fine.
>
> The regression was caused by the following patch:
>
> https://lore.kernel.org/lkml/[email protected]/
>
> To fix this, 'dwarf_callchain_users' needs to be declared.

hum, I see it's declared in callchain.h which is included in builtin-report.c
also I can't see that same stuff like you have on line 296.. what sources are you on?

could you please check with latest Arnaldo's perf/core?
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git

thanks,
jirka

2020-01-05 20:07:19

by Akemi Yagi

[permalink] [raw]
Subject: Re: 4.9.208 regression in perf building

On Sun, Jan 5, 2020 at 11:36 AM Jiri Olsa <[email protected]> wrote:
>
> On Sun, Jan 05, 2020 at 10:21:25AM -0800, Akemi Yagi wrote:
> > Adding Arnaldo and Jiri to the CC list.
> >
> > On Sun, Jan 5, 2020 at 9:01 AM Gordan Bobic <[email protected]> wrote:
> > >
> > > It looks like 4.9.208 introduces a build regression for perf:
> > >
> > > make -f /builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/build/Makefile.build
> > > dir=. obj=perf
> >
> > > -c -o builtin-report.o builtin-report.c
> > > builtin-report.c: In function ‘report__setup_sample_type’:
> > > builtin-report.c:296:6: error: ‘dwarf_callchain_users’ undeclared
> > > (first use in this function)
> > > if (dwarf_callchain_users) {
> > > ^
> > > builtin-report.c:296:6: note: each undeclared identifier is reported
> > > only once for each function it appears in
> > > mv: cannot stat ‘./.builtin-report.o.tmp’: No such file or directory
> > > make[3]: *** [builtin-report.o] Error 1
> > > make[2]: *** [perf-in.o] Error 2
> > > make[1]: *** [sub-make] Error 2
> > > make: *** [all] Error 2
> > >
> > > 4,9.207 works fine.
> >
> > The regression was caused by the following patch:
> >
> > https://lore.kernel.org/lkml/[email protected]/
> >
> > To fix this, 'dwarf_callchain_users' needs to be declared.
>
> hum, I see it's declared in callchain.h which is included in builtin-report.c
> also I can't see that same stuff like you have on line 296.. what sources are you on?
>
> could you please check with latest Arnaldo's perf/core?
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
>
> thanks,
> jirka

This is kernel 4.4.208 that was released today.
'dwarf_callchain_users' is not declared in this kernel. I'm afraid it
was missed when the aforementioned patch was backported.

Akemi

2020-01-05 22:26:12

by Jiri Olsa

[permalink] [raw]
Subject: Re: 4.9.208 regression in perf building

On Sun, Jan 05, 2020 at 12:06:07PM -0800, Akemi Yagi wrote:
> On Sun, Jan 5, 2020 at 11:36 AM Jiri Olsa <[email protected]> wrote:
> >
> > On Sun, Jan 05, 2020 at 10:21:25AM -0800, Akemi Yagi wrote:
> > > Adding Arnaldo and Jiri to the CC list.
> > >
> > > On Sun, Jan 5, 2020 at 9:01 AM Gordan Bobic <[email protected]> wrote:
> > > >
> > > > It looks like 4.9.208 introduces a build regression for perf:
> > > >
> > > > make -f /builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/build/Makefile.build
> > > > dir=. obj=perf
> > >
> > > > -c -o builtin-report.o builtin-report.c
> > > > builtin-report.c: In function ‘report__setup_sample_type’:
> > > > builtin-report.c:296:6: error: ‘dwarf_callchain_users’ undeclared
> > > > (first use in this function)
> > > > if (dwarf_callchain_users) {
> > > > ^
> > > > builtin-report.c:296:6: note: each undeclared identifier is reported
> > > > only once for each function it appears in
> > > > mv: cannot stat ‘./.builtin-report.o.tmp’: No such file or directory
> > > > make[3]: *** [builtin-report.o] Error 1
> > > > make[2]: *** [perf-in.o] Error 2
> > > > make[1]: *** [sub-make] Error 2
> > > > make: *** [all] Error 2
> > > >
> > > > 4,9.207 works fine.
> > >
> > > The regression was caused by the following patch:
> > >
> > > https://lore.kernel.org/lkml/[email protected]/
> > >
> > > To fix this, 'dwarf_callchain_users' needs to be declared.
> >
> > hum, I see it's declared in callchain.h which is included in builtin-report.c
> > also I can't see that same stuff like you have on line 296.. what sources are you on?
> >
> > could you please check with latest Arnaldo's perf/core?
> > git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
> >
> > thanks,
> > jirka
>
> This is kernel 4.4.208 that was released today.
> 'dwarf_callchain_users' is not declared in this kernel. I'm afraid it
> was missed when the aforementioned patch was backported.

so 'dwarf_callchain_users' was introduced with:
eabad8c6856f perf unwind: Do not look just at the global callchain_param.record_mode

which wasn't backported to 4.4.y and it seems it will need more
dependencies to be applied properly

however if I revert aforementioned patch:
faece3af8072 perf report: Add warning when libunwind not compiled in

it compiles for me.. actualy I'm not sure why it went to stable,
it's just user info/warning

jirka

2020-01-06 00:44:12

by Jin Yao

[permalink] [raw]
Subject: Re: 4.9.208 regression in perf building



On 1/6/2020 6:25 AM, Jiri Olsa wrote:
> On Sun, Jan 05, 2020 at 12:06:07PM -0800, Akemi Yagi wrote:
>> On Sun, Jan 5, 2020 at 11:36 AM Jiri Olsa <[email protected]> wrote:
>>>
>>> On Sun, Jan 05, 2020 at 10:21:25AM -0800, Akemi Yagi wrote:
>>>> Adding Arnaldo and Jiri to the CC list.
>>>>
>>>> On Sun, Jan 5, 2020 at 9:01 AM Gordan Bobic <[email protected]> wrote:
>>>>>
>>>>> It looks like 4.9.208 introduces a build regression for perf:
>>>>>
>>>>> make -f /builddir/build/BUILD/kernel-4.9.208/linux-4.9.208-1.el7.x86_64/tools/build/Makefile.build
>>>>> dir=. obj=perf
>>>>
>>>>> -c -o builtin-report.o builtin-report.c
>>>>> builtin-report.c: In function ‘report__setup_sample_type’:
>>>>> builtin-report.c:296:6: error: ‘dwarf_callchain_users’ undeclared
>>>>> (first use in this function)
>>>>> if (dwarf_callchain_users) {
>>>>> ^
>>>>> builtin-report.c:296:6: note: each undeclared identifier is reported
>>>>> only once for each function it appears in
>>>>> mv: cannot stat ‘./.builtin-report.o.tmp’: No such file or directory
>>>>> make[3]: *** [builtin-report.o] Error 1
>>>>> make[2]: *** [perf-in.o] Error 2
>>>>> make[1]: *** [sub-make] Error 2
>>>>> make: *** [all] Error 2
>>>>>
>>>>> 4,9.207 works fine.
>>>>
>>>> The regression was caused by the following patch:
>>>>
>>>> https://lore.kernel.org/lkml/[email protected]/
>>>>
>>>> To fix this, 'dwarf_callchain_users' needs to be declared.
>>>
>>> hum, I see it's declared in callchain.h which is included in builtin-report.c
>>> also I can't see that same stuff like you have on line 296.. what sources are you on?
>>>
>>> could you please check with latest Arnaldo's perf/core?
>>> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
>>>
>>> thanks,
>>> jirka
>>
>> This is kernel 4.4.208 that was released today.
>> 'dwarf_callchain_users' is not declared in this kernel. I'm afraid it
>> was missed when the aforementioned patch was backported.
>
> so 'dwarf_callchain_users' was introduced with:
> eabad8c6856f perf unwind: Do not look just at the global callchain_param.record_mode
>
> which wasn't backported to 4.4.y and it seems it will need more
> dependencies to be applied properly
>
> however if I revert aforementioned patch:
> faece3af8072 perf report: Add warning when libunwind not compiled in
>
> it compiles for me.. actualy I'm not sure why it went to stable,
> it's just user info/warning
>
> jirka
>

Yes, agree with Jiri, this patch is only warning for user, but not for
fixing some issues.

Thanks
Jin Yao