Re: how to build 2.6.x based kernel with perf ?

2014-12-12 Thread Jason Vas Dias
Here's a patch that fixes the issue for me . Also attached to
Red Hat bugzilla : https://bugzilla.redhat.com/show_bug.cgi?id=1173649


On 12/12/14, Jason Vas Dias  wrote:
> Good day -
> I am trying to build the latest RHEL kernel from the source RPM,
> but this fails because the "perf" component cannot build .
> The build gets as far as building the modules and debug flavour
> of the kernel, but fails for the 'perf' target with :
>
>
> + make -j4 -C tools/perf -s V=1 prefix=/usr all
> CHK -fstack-protector-all
> CHK -Wstack-protector
> CHK -Wvolatile-register-var
> CHK -D_FORTIFY_SOURCE=2
> CHK bionic
> :1:31: error: android/api-level.h: No such file or directory
> : In function 'main':
> :5: error: '__ANDROID_API__' undeclared (first use in this function)
> :5: error: (Each undeclared identifier is reported only once
> :5: error: for each function it appears in.)
> CHK libelf
> CHK libdw
> CHK -DLIBELF_MMAP
> CHK -DHAVE_ELF_GETPHDRNUM
> CHK -DLIBELF_MMAP
> CHK libunwind
> CHK libaudit
> cc1: warnings being treated as errors
> : In function 'main':
> :5: error: implicit declaration of function 'printf'
> :5: error: incompatible implicit declaration of built-in
> function 'printf'
> config/Makefile:240: No libaudit.h found, disables 'trace' tool,
> please install audit-libs-devel or libaudit-dev
> CHK libslang
> CHK gtk2
> CHK -DHAVE_GTK_INFO_BAR
> CHK perl
> CHK python
> CHK python version
> CHK libbfd
> CHK -DHAVE_STRLCPY
> /tmp/ccOCUfYU.o: In function `main':
> :(.text+0x14): undefined reference to `strlcpy'
> collect2: ld returned 1 exit status
> CHK -DHAVE_ON_EXIT
> CHK -DBACKTRACE_SUPPORT
> CHK libnuma
> :1:18: error: numa.h: No such file or directory
> :2:20: error: numaif.h: No such file or directory
> cc1: warnings being treated as errors
> : In function 'main':
> :6: error: implicit declaration of function 'numa_available'
> :6: error: nested extern declaration of 'numa_available'
> config/Makefile:422: No numa.h found, disables 'perf bench numa mem'
> benchmark, please install numa-libs-devel or libnuma-dev
> * new build flags or prefix
> PERF_VERSION = 2.6.32-504.1.3.el6.x86_64.debug
> * new build flags or cross compiler
> cc1: warnings being treated as errors
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:113:
> error: no previous prototype for 'breakpoint'
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:119:
> error: no previous prototype for 'alloc_arg'
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:
> In function 'find_cmdline':
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:183:
> error: return discards qualifiers from pointer target type
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:186:
> error: return discards qualifiers from pointer target type
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:195:
> error: return discards qualifiers from pointer target type
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:
> In function 'type_size':
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:1243:
> error: missing initializer
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:1243:
> error: (near initialization for 'table[9].type')
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:
> In function 'event_read_fields':
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:1519:
> error: signed and unsigned type in conditional expression
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:
> In function 'arg_num_eval':
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:2076:
> error: enumeration value 'PRINT_HEX' not handled in switch
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:2076:
> error: enumeration value 'PRINT_DYNAMIC_ARRAY' not handled in switc
> /home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:2076:
> error: enumeration value 'PRINT_FUNC' not handled in switch
> /home/jvasdias

how to build 2.6.x based kernel with perf ?

2014-12-12 Thread Jason Vas Dias
Good day -
I am trying to build the latest RHEL kernel from the source RPM,
but this fails because the "perf" component cannot build .
The build gets as far as building the modules and debug flavour
of the kernel, but fails for the 'perf' target with :


+ make -j4 -C tools/perf -s V=1 prefix=/usr all
CHK -fstack-protector-all
CHK -Wstack-protector
CHK -Wvolatile-register-var
CHK -D_FORTIFY_SOURCE=2
CHK bionic
:1:31: error: android/api-level.h: No such file or directory
: In function 'main':
:5: error: '__ANDROID_API__' undeclared (first use in this function)
:5: error: (Each undeclared identifier is reported only once
:5: error: for each function it appears in.)
CHK libelf
CHK libdw
CHK -DLIBELF_MMAP
CHK -DHAVE_ELF_GETPHDRNUM
CHK -DLIBELF_MMAP
CHK libunwind
CHK libaudit
cc1: warnings being treated as errors
: In function 'main':
:5: error: implicit declaration of function 'printf'
:5: error: incompatible implicit declaration of built-in
function 'printf'
config/Makefile:240: No libaudit.h found, disables 'trace' tool,
please install audit-libs-devel or libaudit-dev
CHK libslang
CHK gtk2
CHK -DHAVE_GTK_INFO_BAR
CHK perl
CHK python
CHK python version
CHK libbfd
CHK -DHAVE_STRLCPY
/tmp/ccOCUfYU.o: In function `main':
:(.text+0x14): undefined reference to `strlcpy'
collect2: ld returned 1 exit status
CHK -DHAVE_ON_EXIT
CHK -DBACKTRACE_SUPPORT
CHK libnuma
:1:18: error: numa.h: No such file or directory
:2:20: error: numaif.h: No such file or directory
cc1: warnings being treated as errors
: In function 'main':
:6: error: implicit declaration of function 'numa_available'
:6: error: nested extern declaration of 'numa_available'
config/Makefile:422: No numa.h found, disables 'perf bench numa mem'
benchmark, please install numa-libs-devel or libnuma-dev
* new build flags or prefix
PERF_VERSION = 2.6.32-504.1.3.el6.x86_64.debug
* new build flags or cross compiler
cc1: warnings being treated as errors
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:113:
error: no previous prototype for 'breakpoint'
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:119:
error: no previous prototype for 'alloc_arg'
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:
In function 'find_cmdline':
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:183:
error: return discards qualifiers from pointer target type
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:186:
error: return discards qualifiers from pointer target type
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:195:
error: return discards qualifiers from pointer target type
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:
In function 'type_size':
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:1243:
error: missing initializer
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:1243:
error: (near initialization for 'table[9].type')
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:
In function 'event_read_fields':
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:1519:
error: signed and unsigned type in conditional expression
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:
In function 'arg_num_eval':
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:2076:
error: enumeration value 'PRINT_HEX' not handled in switch
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:2076:
error: enumeration value 'PRINT_DYNAMIC_ARRAY' not handled in switc
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:2076:
error: enumeration value 'PRINT_FUNC' not handled in switch
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:
In function 'arg_eval':
/home/jvasdias/rpmbuild/BUILD/kernel-2.6.32-504.1.3.el6/linux-2.6.32-504.1.3.el6.x86_64/tools/lib/traceevent/event-parse.c:2235:
error: enumeration value 'PRINT_HEX' not handled in switch
/home/jvasdias/rpmbuild/B