public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
@ 2015-08-05  0:38 Petri Gynther
  2015-08-06  7:04 ` [tip:perf/core] " tip-bot for Petri Gynther
  2015-09-04 22:19 ` [PATCH] " Petri Gynther
  0 siblings, 2 replies; 13+ messages in thread
From: Petri Gynther @ 2015-08-05  0:38 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: linux-kernel, Petri Gynther

linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
...
config/Makefile:256: *** No gnu/libc-version.h found, please install
glibc-dev[el].  Stop.
make[1]: *** [all] Error 2
make: *** [perf] Error 2

...
In file included from builtin-sched.c:13:0:
util/cloexec.h:8:12: error: redundant redeclaration of ‘sched_getcpu’
 [-Werror=redundant-decls]
 extern int sched_getcpu(void) __THROW;

mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/sched.h:88:12:
 note: previous declaration of ‘sched_getcpu’ was here
 extern int sched_getcpu (void) __THROW;

uclibc info:
sysroot/usr/include/bits/uClibc_config.h
__UCLIBC_MAJOR__ 0
__UCLIBC_MINOR__ 9
__UCLIBC_SUBLEVEL__ 33

sysroot/usr/include/features.h
__UCLIBC__ 1
__GLIBC__ 2
__GLIBC_MINOR__ 2

Signed-off-by: Petri Gynther <pgynther@google.com>
---
 tools/build/feature/test-glibc.c | 11 +++++++++++
 tools/perf/util/cloexec.h        |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c
index b082034..9367f75 100644
--- a/tools/build/feature/test-glibc.c
+++ b/tools/build/feature/test-glibc.c
@@ -1,8 +1,19 @@
+#include <stdlib.h>
+
+#if !defined(__UCLIBC__)
 #include <gnu/libc-version.h>
+#else
+#define XSTR(s) STR(s)
+#define STR(s) #s
+#endif
 
 int main(void)
 {
+#if !defined(__UCLIBC__)
 	const char *version = gnu_get_libc_version();
+#else
+	const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
+#endif
 
 	return (long)version;
 }
diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h
index 68888c2..3bee677 100644
--- a/tools/perf/util/cloexec.h
+++ b/tools/perf/util/cloexec.h
@@ -4,7 +4,7 @@
 unsigned long perf_event_open_cloexec_flag(void);
 
 #ifdef __GLIBC_PREREQ
-#if !__GLIBC_PREREQ(2, 6)
+#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
 extern int sched_getcpu(void) __THROW;
 #endif
 #endif
-- 
2.5.0.rc2.392.g76e840b


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

* [tip:perf/core] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-08-05  0:38 [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler Petri Gynther
@ 2015-08-06  7:04 ` tip-bot for Petri Gynther
  2015-09-04 22:19 ` [PATCH] " Petri Gynther
  1 sibling, 0 replies; 13+ messages in thread
From: tip-bot for Petri Gynther @ 2015-08-06  7:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, mingo, a.p.zijlstra, pgynther, tglx, acme, hpa

Commit-ID:  f151f53aa4f54a647353e1935e4c6cef7f094dd4
Gitweb:     http://git.kernel.org/tip/f151f53aa4f54a647353e1935e4c6cef7f094dd4
Author:     Petri Gynther <pgynther@google.com>
AuthorDate: Tue, 4 Aug 2015 17:38:01 -0700
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 5 Aug 2015 16:56:16 -0300

perf tools: Fix build errors with mipsel-linux-uclibc compiler

linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
...
config/Makefile:256: *** No gnu/libc-version.h found, please install
glibc-dev[el].  Stop.
make[1]: *** [all] Error 2
make: *** [perf] Error 2

...
In file included from builtin-sched.c:13:0:
util/cloexec.h:8:12: error: redundant redeclaration of ‘sched_getcpu’
 [-Werror=redundant-decls]
 extern int sched_getcpu(void) __THROW;

mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/sched.h:88:12:
 note: previous declaration of ‘sched_getcpu’ was here
 extern int sched_getcpu (void) __THROW;

uclibc info:
sysroot/usr/include/bits/uClibc_config.h
__UCLIBC_MAJOR__ 0
__UCLIBC_MINOR__ 9
__UCLIBC_SUBLEVEL__ 33

sysroot/usr/include/features.h
__UCLIBC__ 1
__GLIBC__ 2
__GLIBC_MINOR__ 2

Signed-off-by: Petri Gynther <pgynther@google.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1438735081-24131-1-git-send-email-pgynther@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/feature/test-glibc.c | 11 +++++++++++
 tools/perf/util/cloexec.h        |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c
index b082034..9367f75 100644
--- a/tools/build/feature/test-glibc.c
+++ b/tools/build/feature/test-glibc.c
@@ -1,8 +1,19 @@
+#include <stdlib.h>
+
+#if !defined(__UCLIBC__)
 #include <gnu/libc-version.h>
+#else
+#define XSTR(s) STR(s)
+#define STR(s) #s
+#endif
 
 int main(void)
 {
+#if !defined(__UCLIBC__)
 	const char *version = gnu_get_libc_version();
+#else
+	const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
+#endif
 
 	return (long)version;
 }
diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h
index 68888c2..3bee677 100644
--- a/tools/perf/util/cloexec.h
+++ b/tools/perf/util/cloexec.h
@@ -4,7 +4,7 @@
 unsigned long perf_event_open_cloexec_flag(void);
 
 #ifdef __GLIBC_PREREQ
-#if !__GLIBC_PREREQ(2, 6)
+#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
 extern int sched_getcpu(void) __THROW;
 #endif
 #endif

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-08-05  0:38 [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler Petri Gynther
  2015-08-06  7:04 ` [tip:perf/core] " tip-bot for Petri Gynther
@ 2015-09-04 22:19 ` Petri Gynther
  2015-09-04 22:45   ` Petri Gynther
  1 sibling, 1 reply; 13+ messages in thread
From: Petri Gynther @ 2015-09-04 22:19 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo; +Cc: linux-kernel

I see that this patch is now in upstream. However, something else has
now broken the perf tool MIPS build:

linux/tools$ git describe
v4.2-7656-g51e771c

linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
mkdir -p  .
make --no-print-directory -C perf O= subdir=
  BUILD:   Doing 'make -j12' parallel build

Auto-detecting system features:
...                         dwarf: [ OFF ]
...                         glibc: [ on  ]
...                          gtk2: [ OFF ]
...                      libaudit: [ OFF ]
...                        libbfd: [ OFF ]
...                        libelf: [ OFF ]
...                       libnuma: [ OFF ]
...                       libperl: [ OFF ]
...                     libpython: [ OFF ]
...                      libslang: [ OFF ]
...                     libunwind: [ OFF ]
...            libdw-dwarf-unwind: [ OFF ]
...                          zlib: [ OFF ]
...                          lzma: [ OFF ]

...

  AR       libperf.a
  LINK     perf
libperf.a(libperf-in.o): In function `parse_regs':
(.text+0x9f5b4): undefined reference to `sample_reg_masks'
libperf.a(libperf-in.o): In function `parse_regs':
(.text+0x9f604): undefined reference to `sample_reg_masks'
libperf.a(libperf-in.o): In function `parse_regs':
(.text+0x9f708): undefined reference to `sample_reg_masks'
collect2: error: ld returned 1 exit status
make[2]: *** [perf] Error 1
make[1]: *** [all] Error 2
make: *** [perf] Error 2

On Tue, Aug 4, 2015 at 5:38 PM, Petri Gynther <pgynther@google.com> wrote:
> linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
> ...
> config/Makefile:256: *** No gnu/libc-version.h found, please install
> glibc-dev[el].  Stop.
> make[1]: *** [all] Error 2
> make: *** [perf] Error 2
>
> ...
> In file included from builtin-sched.c:13:0:
> util/cloexec.h:8:12: error: redundant redeclaration of ‘sched_getcpu’
>  [-Werror=redundant-decls]
>  extern int sched_getcpu(void) __THROW;
>
> mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/sched.h:88:12:
>  note: previous declaration of ‘sched_getcpu’ was here
>  extern int sched_getcpu (void) __THROW;
>
> uclibc info:
> sysroot/usr/include/bits/uClibc_config.h
> __UCLIBC_MAJOR__ 0
> __UCLIBC_MINOR__ 9
> __UCLIBC_SUBLEVEL__ 33
>
> sysroot/usr/include/features.h
> __UCLIBC__ 1
> __GLIBC__ 2
> __GLIBC_MINOR__ 2
>
> Signed-off-by: Petri Gynther <pgynther@google.com>
> ---
>  tools/build/feature/test-glibc.c | 11 +++++++++++
>  tools/perf/util/cloexec.h        |  2 +-
>  2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c
> index b082034..9367f75 100644
> --- a/tools/build/feature/test-glibc.c
> +++ b/tools/build/feature/test-glibc.c
> @@ -1,8 +1,19 @@
> +#include <stdlib.h>
> +
> +#if !defined(__UCLIBC__)
>  #include <gnu/libc-version.h>
> +#else
> +#define XSTR(s) STR(s)
> +#define STR(s) #s
> +#endif
>
>  int main(void)
>  {
> +#if !defined(__UCLIBC__)
>         const char *version = gnu_get_libc_version();
> +#else
> +       const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
> +#endif
>
>         return (long)version;
>  }
> diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h
> index 68888c2..3bee677 100644
> --- a/tools/perf/util/cloexec.h
> +++ b/tools/perf/util/cloexec.h
> @@ -4,7 +4,7 @@
>  unsigned long perf_event_open_cloexec_flag(void);
>
>  #ifdef __GLIBC_PREREQ
> -#if !__GLIBC_PREREQ(2, 6)
> +#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
>  extern int sched_getcpu(void) __THROW;
>  #endif
>  #endif
> --
> 2.5.0.rc2.392.g76e840b
>

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-09-04 22:19 ` [PATCH] " Petri Gynther
@ 2015-09-04 22:45   ` Petri Gynther
  2015-09-04 22:48     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 13+ messages in thread
From: Petri Gynther @ 2015-09-04 22:45 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: linux-kernel, Stephane Eranian

This commit breaks the perf tool MIPS build because MIPS doesn't have
CONFIG_PERF_REGS=y in .config-detected:

commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
Author: Stephane Eranian <eranian@google.com>
Date:   Mon Aug 31 18:41:12 2015 +0200

    perf record: Add ability to name registers to record

On Fri, Sep 4, 2015 at 3:19 PM, Petri Gynther <pgynther@google.com> wrote:
> I see that this patch is now in upstream. However, something else has
> now broken the perf tool MIPS build:
>
> linux/tools$ git describe
> v4.2-7656-g51e771c
>
> linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
> mkdir -p  .
> make --no-print-directory -C perf O= subdir=
>   BUILD:   Doing 'make -j12' parallel build
>
> Auto-detecting system features:
> ...                         dwarf: [ OFF ]
> ...                         glibc: [ on  ]
> ...                          gtk2: [ OFF ]
> ...                      libaudit: [ OFF ]
> ...                        libbfd: [ OFF ]
> ...                        libelf: [ OFF ]
> ...                       libnuma: [ OFF ]
> ...                       libperl: [ OFF ]
> ...                     libpython: [ OFF ]
> ...                      libslang: [ OFF ]
> ...                     libunwind: [ OFF ]
> ...            libdw-dwarf-unwind: [ OFF ]
> ...                          zlib: [ OFF ]
> ...                          lzma: [ OFF ]
>
> ...
>
>   AR       libperf.a
>   LINK     perf
> libperf.a(libperf-in.o): In function `parse_regs':
> (.text+0x9f5b4): undefined reference to `sample_reg_masks'
> libperf.a(libperf-in.o): In function `parse_regs':
> (.text+0x9f604): undefined reference to `sample_reg_masks'
> libperf.a(libperf-in.o): In function `parse_regs':
> (.text+0x9f708): undefined reference to `sample_reg_masks'
> collect2: error: ld returned 1 exit status
> make[2]: *** [perf] Error 1
> make[1]: *** [all] Error 2
> make: *** [perf] Error 2
>
> On Tue, Aug 4, 2015 at 5:38 PM, Petri Gynther <pgynther@google.com> wrote:
>> linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
>> ...
>> config/Makefile:256: *** No gnu/libc-version.h found, please install
>> glibc-dev[el].  Stop.
>> make[1]: *** [all] Error 2
>> make: *** [perf] Error 2
>>
>> ...
>> In file included from builtin-sched.c:13:0:
>> util/cloexec.h:8:12: error: redundant redeclaration of ‘sched_getcpu’
>>  [-Werror=redundant-decls]
>>  extern int sched_getcpu(void) __THROW;
>>
>> mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/sched.h:88:12:
>>  note: previous declaration of ‘sched_getcpu’ was here
>>  extern int sched_getcpu (void) __THROW;
>>
>> uclibc info:
>> sysroot/usr/include/bits/uClibc_config.h
>> __UCLIBC_MAJOR__ 0
>> __UCLIBC_MINOR__ 9
>> __UCLIBC_SUBLEVEL__ 33
>>
>> sysroot/usr/include/features.h
>> __UCLIBC__ 1
>> __GLIBC__ 2
>> __GLIBC_MINOR__ 2
>>
>> Signed-off-by: Petri Gynther <pgynther@google.com>
>> ---
>>  tools/build/feature/test-glibc.c | 11 +++++++++++
>>  tools/perf/util/cloexec.h        |  2 +-
>>  2 files changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c
>> index b082034..9367f75 100644
>> --- a/tools/build/feature/test-glibc.c
>> +++ b/tools/build/feature/test-glibc.c
>> @@ -1,8 +1,19 @@
>> +#include <stdlib.h>
>> +
>> +#if !defined(__UCLIBC__)
>>  #include <gnu/libc-version.h>
>> +#else
>> +#define XSTR(s) STR(s)
>> +#define STR(s) #s
>> +#endif
>>
>>  int main(void)
>>  {
>> +#if !defined(__UCLIBC__)
>>         const char *version = gnu_get_libc_version();
>> +#else
>> +       const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
>> +#endif
>>
>>         return (long)version;
>>  }
>> diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h
>> index 68888c2..3bee677 100644
>> --- a/tools/perf/util/cloexec.h
>> +++ b/tools/perf/util/cloexec.h
>> @@ -4,7 +4,7 @@
>>  unsigned long perf_event_open_cloexec_flag(void);
>>
>>  #ifdef __GLIBC_PREREQ
>> -#if !__GLIBC_PREREQ(2, 6)
>> +#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
>>  extern int sched_getcpu(void) __THROW;
>>  #endif
>>  #endif
>> --
>> 2.5.0.rc2.392.g76e840b
>>

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-09-04 22:45   ` Petri Gynther
@ 2015-09-04 22:48     ` Arnaldo Carvalho de Melo
  2015-09-04 23:01       ` Petri Gynther
  0 siblings, 1 reply; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-04 22:48 UTC (permalink / raw)
  To: Petri Gynther; +Cc: Peter Zijlstra, Ingo Molnar, linux-kernel, Stephane Eranian

Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:
> This commit breaks the perf tool MIPS build because MIPS doesn't have
> CONFIG_PERF_REGS=y in .config-detected:
> 
> commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
> Author: Stephane Eranian <eranian@google.com>
> Date:   Mon Aug 31 18:41:12 2015 +0200
> 
>     perf record: Add ability to name registers to record

There was a fix for another arch that came after this one.. here it is, already
upstream, can you take a look?

commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
Author: Stephane Eranian <eranian@google.com>
Date:   Tue Sep 1 11:30:14 2015 +0200

    perf tools: Fix link time error with sample_reg_masks on non x86
    
    This patch makes perf compile on non x86 platforms by defining a weak
    symbol for sample_reg_masks[] in util/perf_regs.c.
    
    The patch also moves the REG() and REG_END() macros into the
    util/per_regs.h header file. The macros are renamed to
    SMPL_REG/SMPL_REG_END to avoid clashes with other header files.

 
> On Fri, Sep 4, 2015 at 3:19 PM, Petri Gynther <pgynther@google.com> wrote:
> > I see that this patch is now in upstream. However, something else has
> > now broken the perf tool MIPS build:
> >
> > linux/tools$ git describe
> > v4.2-7656-g51e771c
> >
> > linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
> > mkdir -p  .
> > make --no-print-directory -C perf O= subdir=
> >   BUILD:   Doing 'make -j12' parallel build
> >
> > Auto-detecting system features:
> > ...                         dwarf: [ OFF ]
> > ...                         glibc: [ on  ]
> > ...                          gtk2: [ OFF ]
> > ...                      libaudit: [ OFF ]
> > ...                        libbfd: [ OFF ]
> > ...                        libelf: [ OFF ]
> > ...                       libnuma: [ OFF ]
> > ...                       libperl: [ OFF ]
> > ...                     libpython: [ OFF ]
> > ...                      libslang: [ OFF ]
> > ...                     libunwind: [ OFF ]
> > ...            libdw-dwarf-unwind: [ OFF ]
> > ...                          zlib: [ OFF ]
> > ...                          lzma: [ OFF ]
> >
> > ...
> >
> >   AR       libperf.a
> >   LINK     perf
> > libperf.a(libperf-in.o): In function `parse_regs':
> > (.text+0x9f5b4): undefined reference to `sample_reg_masks'
> > libperf.a(libperf-in.o): In function `parse_regs':
> > (.text+0x9f604): undefined reference to `sample_reg_masks'
> > libperf.a(libperf-in.o): In function `parse_regs':
> > (.text+0x9f708): undefined reference to `sample_reg_masks'
> > collect2: error: ld returned 1 exit status
> > make[2]: *** [perf] Error 1
> > make[1]: *** [all] Error 2
> > make: *** [perf] Error 2
> >
> > On Tue, Aug 4, 2015 at 5:38 PM, Petri Gynther <pgynther@google.com> wrote:
> >> linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
> >> ...
> >> config/Makefile:256: *** No gnu/libc-version.h found, please install
> >> glibc-dev[el].  Stop.
> >> make[1]: *** [all] Error 2
> >> make: *** [perf] Error 2
> >>
> >> ...
> >> In file included from builtin-sched.c:13:0:
> >> util/cloexec.h:8:12: error: redundant redeclaration of ‘sched_getcpu’
> >>  [-Werror=redundant-decls]
> >>  extern int sched_getcpu(void) __THROW;
> >>
> >> mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/sched.h:88:12:
> >>  note: previous declaration of ‘sched_getcpu’ was here
> >>  extern int sched_getcpu (void) __THROW;
> >>
> >> uclibc info:
> >> sysroot/usr/include/bits/uClibc_config.h
> >> __UCLIBC_MAJOR__ 0
> >> __UCLIBC_MINOR__ 9
> >> __UCLIBC_SUBLEVEL__ 33
> >>
> >> sysroot/usr/include/features.h
> >> __UCLIBC__ 1
> >> __GLIBC__ 2
> >> __GLIBC_MINOR__ 2
> >>
> >> Signed-off-by: Petri Gynther <pgynther@google.com>
> >> ---
> >>  tools/build/feature/test-glibc.c | 11 +++++++++++
> >>  tools/perf/util/cloexec.h        |  2 +-
> >>  2 files changed, 12 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c
> >> index b082034..9367f75 100644
> >> --- a/tools/build/feature/test-glibc.c
> >> +++ b/tools/build/feature/test-glibc.c
> >> @@ -1,8 +1,19 @@
> >> +#include <stdlib.h>
> >> +
> >> +#if !defined(__UCLIBC__)
> >>  #include <gnu/libc-version.h>
> >> +#else
> >> +#define XSTR(s) STR(s)
> >> +#define STR(s) #s
> >> +#endif
> >>
> >>  int main(void)
> >>  {
> >> +#if !defined(__UCLIBC__)
> >>         const char *version = gnu_get_libc_version();
> >> +#else
> >> +       const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
> >> +#endif
> >>
> >>         return (long)version;
> >>  }
> >> diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h
> >> index 68888c2..3bee677 100644
> >> --- a/tools/perf/util/cloexec.h
> >> +++ b/tools/perf/util/cloexec.h
> >> @@ -4,7 +4,7 @@
> >>  unsigned long perf_event_open_cloexec_flag(void);
> >>
> >>  #ifdef __GLIBC_PREREQ
> >> -#if !__GLIBC_PREREQ(2, 6)
> >> +#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
> >>  extern int sched_getcpu(void) __THROW;
> >>  #endif
> >>  #endif
> >> --
> >> 2.5.0.rc2.392.g76e840b
> >>

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-09-04 22:48     ` Arnaldo Carvalho de Melo
@ 2015-09-04 23:01       ` Petri Gynther
  2015-09-04 23:04         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 13+ messages in thread
From: Petri Gynther @ 2015-09-04 23:01 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Ingo Molnar, linux-kernel, Stephane Eranian

On Fri, Sep 4, 2015 at 3:48 PM, Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
> Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:
>> This commit breaks the perf tool MIPS build because MIPS doesn't have
>> CONFIG_PERF_REGS=y in .config-detected:
>>
>> commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
>> Author: Stephane Eranian <eranian@google.com>
>> Date:   Mon Aug 31 18:41:12 2015 +0200
>>
>>     perf record: Add ability to name registers to record
>
> There was a fix for another arch that came after this one.. here it is, already
> upstream, can you take a look?
>
> commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
> Author: Stephane Eranian <eranian@google.com>
> Date:   Tue Sep 1 11:30:14 2015 +0200
>
>     perf tools: Fix link time error with sample_reg_masks on non x86
>
>     This patch makes perf compile on non x86 platforms by defining a weak
>     symbol for sample_reg_masks[] in util/perf_regs.c.
>
>     The patch also moves the REG() and REG_END() macros into the
>     util/per_regs.h header file. The macros are renamed to
>     SMPL_REG/SMPL_REG_END to avoid clashes with other header files.
>
>

I have the above commit in my tree (as I have the latest Linus' tree
as of right now).
The MIPS build is still broken as I reported.

tools/perf/util/perf_regs.c doesn't get compiled on MIPS because:

CONFIG_PERF_REGS is not set on MIPS
and
tools/perf/util/Build:
libperf-$(CONFIG_PERF_REGS) += perf_regs.o

Converting the above to:
libperf-y += perf_regs.o

leads to other build errors:
...
  CC       util/perf_regs.o
In file included from util/perf_regs.c:2:0:
util/perf_regs.h:26:48: error: expected ‘;’, ‘,’ or ‘)’ before ‘__maybe_unused’
 static inline const char *perf_reg_name(int id __maybe_unused)
                                                ^
util/perf_regs.h:31:44: error: expected ‘;’, ‘,’ or ‘)’ before ‘__maybe_unused’
 static inline int perf_reg_value(u64 *valp __maybe_unused,
                                            ^
  FLEX     util/parse-events-flex.c
util/perf_regs.c:9:5: error: no previous prototype for
‘perf_reg_value’ [-Werror=missing-prototypes]
 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id)
     ^
cc1: all warnings being treated as errors
  CC       util/intel-pt-decoder/intel-pt-log.o
make[4]: *** [util/perf_regs.o] Error 1
make[4]: *** Waiting for unfinished jobs....
  CC       util/intel-pt-decoder/intel-pt-decoder.o
  LD       tests/perf-in.o
  CC       util/intel-pt-decoder/intel-pt-insn-decoder.o
  LD       perf-in.o
  LD       util/intel-pt-decoder/libperf-in.o
make[3]: *** [util] Error 2
make[2]: *** [libperf-in.o] Error 2
make[1]: *** [all] Error 2
make: *** [perf] Error 2


>> On Fri, Sep 4, 2015 at 3:19 PM, Petri Gynther <pgynther@google.com> wrote:
>> > I see that this patch is now in upstream. However, something else has
>> > now broken the perf tool MIPS build:
>> >
>> > linux/tools$ git describe
>> > v4.2-7656-g51e771c
>> >
>> > linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
>> > mkdir -p  .
>> > make --no-print-directory -C perf O= subdir=
>> >   BUILD:   Doing 'make -j12' parallel build
>> >
>> > Auto-detecting system features:
>> > ...                         dwarf: [ OFF ]
>> > ...                         glibc: [ on  ]
>> > ...                          gtk2: [ OFF ]
>> > ...                      libaudit: [ OFF ]
>> > ...                        libbfd: [ OFF ]
>> > ...                        libelf: [ OFF ]
>> > ...                       libnuma: [ OFF ]
>> > ...                       libperl: [ OFF ]
>> > ...                     libpython: [ OFF ]
>> > ...                      libslang: [ OFF ]
>> > ...                     libunwind: [ OFF ]
>> > ...            libdw-dwarf-unwind: [ OFF ]
>> > ...                          zlib: [ OFF ]
>> > ...                          lzma: [ OFF ]
>> >
>> > ...
>> >
>> >   AR       libperf.a
>> >   LINK     perf
>> > libperf.a(libperf-in.o): In function `parse_regs':
>> > (.text+0x9f5b4): undefined reference to `sample_reg_masks'
>> > libperf.a(libperf-in.o): In function `parse_regs':
>> > (.text+0x9f604): undefined reference to `sample_reg_masks'
>> > libperf.a(libperf-in.o): In function `parse_regs':
>> > (.text+0x9f708): undefined reference to `sample_reg_masks'
>> > collect2: error: ld returned 1 exit status
>> > make[2]: *** [perf] Error 1
>> > make[1]: *** [all] Error 2
>> > make: *** [perf] Error 2
>> >
>> > On Tue, Aug 4, 2015 at 5:38 PM, Petri Gynther <pgynther@google.com> wrote:
>> >> linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
>> >> ...
>> >> config/Makefile:256: *** No gnu/libc-version.h found, please install
>> >> glibc-dev[el].  Stop.
>> >> make[1]: *** [all] Error 2
>> >> make: *** [perf] Error 2
>> >>
>> >> ...
>> >> In file included from builtin-sched.c:13:0:
>> >> util/cloexec.h:8:12: error: redundant redeclaration of ‘sched_getcpu’
>> >>  [-Werror=redundant-decls]
>> >>  extern int sched_getcpu(void) __THROW;
>> >>
>> >> mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/sched.h:88:12:
>> >>  note: previous declaration of ‘sched_getcpu’ was here
>> >>  extern int sched_getcpu (void) __THROW;
>> >>
>> >> uclibc info:
>> >> sysroot/usr/include/bits/uClibc_config.h
>> >> __UCLIBC_MAJOR__ 0
>> >> __UCLIBC_MINOR__ 9
>> >> __UCLIBC_SUBLEVEL__ 33
>> >>
>> >> sysroot/usr/include/features.h
>> >> __UCLIBC__ 1
>> >> __GLIBC__ 2
>> >> __GLIBC_MINOR__ 2
>> >>
>> >> Signed-off-by: Petri Gynther <pgynther@google.com>
>> >> ---
>> >>  tools/build/feature/test-glibc.c | 11 +++++++++++
>> >>  tools/perf/util/cloexec.h        |  2 +-
>> >>  2 files changed, 12 insertions(+), 1 deletion(-)
>> >>
>> >> diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c
>> >> index b082034..9367f75 100644
>> >> --- a/tools/build/feature/test-glibc.c
>> >> +++ b/tools/build/feature/test-glibc.c
>> >> @@ -1,8 +1,19 @@
>> >> +#include <stdlib.h>
>> >> +
>> >> +#if !defined(__UCLIBC__)
>> >>  #include <gnu/libc-version.h>
>> >> +#else
>> >> +#define XSTR(s) STR(s)
>> >> +#define STR(s) #s
>> >> +#endif
>> >>
>> >>  int main(void)
>> >>  {
>> >> +#if !defined(__UCLIBC__)
>> >>         const char *version = gnu_get_libc_version();
>> >> +#else
>> >> +       const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
>> >> +#endif
>> >>
>> >>         return (long)version;
>> >>  }
>> >> diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h
>> >> index 68888c2..3bee677 100644
>> >> --- a/tools/perf/util/cloexec.h
>> >> +++ b/tools/perf/util/cloexec.h
>> >> @@ -4,7 +4,7 @@
>> >>  unsigned long perf_event_open_cloexec_flag(void);
>> >>
>> >>  #ifdef __GLIBC_PREREQ
>> >> -#if !__GLIBC_PREREQ(2, 6)
>> >> +#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
>> >>  extern int sched_getcpu(void) __THROW;
>> >>  #endif
>> >>  #endif
>> >> --
>> >> 2.5.0.rc2.392.g76e840b
>> >>

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-09-04 23:01       ` Petri Gynther
@ 2015-09-04 23:04         ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-09-04 23:04 UTC (permalink / raw)
  To: Stephane Eranian; +Cc: Petri Gynther, Peter Zijlstra, Ingo Molnar, linux-kernel

Em Fri, Sep 04, 2015 at 04:01:54PM -0700, Petri Gynther escreveu:
> On Fri, Sep 4, 2015 at 3:48 PM, Arnaldo Carvalho de Melo
> <acme@kernel.org> wrote:
> > Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:
> >> This commit breaks the perf tool MIPS build because MIPS doesn't have
> >> CONFIG_PERF_REGS=y in .config-detected:
> >>
> >> commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
> >> Author: Stephane Eranian <eranian@google.com>
> >> Date:   Mon Aug 31 18:41:12 2015 +0200
> >>
> >>     perf record: Add ability to name registers to record
> >
> > There was a fix for another arch that came after this one.. here it is, already
> > upstream, can you take a look?
> >
> > commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
> > Author: Stephane Eranian <eranian@google.com>
> > Date:   Tue Sep 1 11:30:14 2015 +0200
> >
> >     perf tools: Fix link time error with sample_reg_masks on non x86
> >
> >     This patch makes perf compile on non x86 platforms by defining a weak
> >     symbol for sample_reg_masks[] in util/perf_regs.c.
> >
> >     The patch also moves the REG() and REG_END() macros into the
> >     util/per_regs.h header file. The macros are renamed to
> >     SMPL_REG/SMPL_REG_END to avoid clashes with other header files.
> >
> >
> 
> I have the above commit in my tree (as I have the latest Linus' tree
> as of right now).
> The MIPS build is still broken as I reported.

Stephane, can you please take a look?

- Arnaldo
 
> tools/perf/util/perf_regs.c doesn't get compiled on MIPS because:
> 
> CONFIG_PERF_REGS is not set on MIPS
> and
> tools/perf/util/Build:
> libperf-$(CONFIG_PERF_REGS) += perf_regs.o
> 
> Converting the above to:
> libperf-y += perf_regs.o
> 
> leads to other build errors:
> ...
>   CC       util/perf_regs.o
> In file included from util/perf_regs.c:2:0:
> util/perf_regs.h:26:48: error: expected ‘;’, ‘,’ or ‘)’ before ‘__maybe_unused’
>  static inline const char *perf_reg_name(int id __maybe_unused)
>                                                 ^
> util/perf_regs.h:31:44: error: expected ‘;’, ‘,’ or ‘)’ before ‘__maybe_unused’
>  static inline int perf_reg_value(u64 *valp __maybe_unused,
>                                             ^
>   FLEX     util/parse-events-flex.c
> util/perf_regs.c:9:5: error: no previous prototype for
> ‘perf_reg_value’ [-Werror=missing-prototypes]
>  int perf_reg_value(u64 *valp, struct regs_dump *regs, int id)
>      ^
> cc1: all warnings being treated as errors
>   CC       util/intel-pt-decoder/intel-pt-log.o
> make[4]: *** [util/perf_regs.o] Error 1
> make[4]: *** Waiting for unfinished jobs....
>   CC       util/intel-pt-decoder/intel-pt-decoder.o
>   LD       tests/perf-in.o
>   CC       util/intel-pt-decoder/intel-pt-insn-decoder.o
>   LD       perf-in.o
>   LD       util/intel-pt-decoder/libperf-in.o
> make[3]: *** [util] Error 2
> make[2]: *** [libperf-in.o] Error 2
> make[1]: *** [all] Error 2
> make: *** [perf] Error 2
> 
> 
> >> On Fri, Sep 4, 2015 at 3:19 PM, Petri Gynther <pgynther@google.com> wrote:
> >> > I see that this patch is now in upstream. However, something else has
> >> > now broken the perf tool MIPS build:
> >> >
> >> > linux/tools$ git describe
> >> > v4.2-7656-g51e771c
> >> >
> >> > linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
> >> > mkdir -p  .
> >> > make --no-print-directory -C perf O= subdir=
> >> >   BUILD:   Doing 'make -j12' parallel build
> >> >
> >> > Auto-detecting system features:
> >> > ...                         dwarf: [ OFF ]
> >> > ...                         glibc: [ on  ]
> >> > ...                          gtk2: [ OFF ]
> >> > ...                      libaudit: [ OFF ]
> >> > ...                        libbfd: [ OFF ]
> >> > ...                        libelf: [ OFF ]
> >> > ...                       libnuma: [ OFF ]
> >> > ...                       libperl: [ OFF ]
> >> > ...                     libpython: [ OFF ]
> >> > ...                      libslang: [ OFF ]
> >> > ...                     libunwind: [ OFF ]
> >> > ...            libdw-dwarf-unwind: [ OFF ]
> >> > ...                          zlib: [ OFF ]
> >> > ...                          lzma: [ OFF ]
> >> >
> >> > ...
> >> >
> >> >   AR       libperf.a
> >> >   LINK     perf
> >> > libperf.a(libperf-in.o): In function `parse_regs':
> >> > (.text+0x9f5b4): undefined reference to `sample_reg_masks'
> >> > libperf.a(libperf-in.o): In function `parse_regs':
> >> > (.text+0x9f604): undefined reference to `sample_reg_masks'
> >> > libperf.a(libperf-in.o): In function `parse_regs':
> >> > (.text+0x9f708): undefined reference to `sample_reg_masks'
> >> > collect2: error: ld returned 1 exit status
> >> > make[2]: *** [perf] Error 1
> >> > make[1]: *** [all] Error 2
> >> > make: *** [perf] Error 2
> >> >
> >> > On Tue, Aug 4, 2015 at 5:38 PM, Petri Gynther <pgynther@google.com> wrote:
> >> >> linux/tools$ make ARCH=mips CROSS_COMPILE=mipsel-linux- perf
> >> >> ...
> >> >> config/Makefile:256: *** No gnu/libc-version.h found, please install
> >> >> glibc-dev[el].  Stop.
> >> >> make[1]: *** [all] Error 2
> >> >> make: *** [perf] Error 2
> >> >>
> >> >> ...
> >> >> In file included from builtin-sched.c:13:0:
> >> >> util/cloexec.h:8:12: error: redundant redeclaration of ‘sched_getcpu’
> >> >>  [-Werror=redundant-decls]
> >> >>  extern int sched_getcpu(void) __THROW;
> >> >>
> >> >> mipsel-buildroot-linux-uclibc/sysroot/usr/include/bits/sched.h:88:12:
> >> >>  note: previous declaration of ‘sched_getcpu’ was here
> >> >>  extern int sched_getcpu (void) __THROW;
> >> >>
> >> >> uclibc info:
> >> >> sysroot/usr/include/bits/uClibc_config.h
> >> >> __UCLIBC_MAJOR__ 0
> >> >> __UCLIBC_MINOR__ 9
> >> >> __UCLIBC_SUBLEVEL__ 33
> >> >>
> >> >> sysroot/usr/include/features.h
> >> >> __UCLIBC__ 1
> >> >> __GLIBC__ 2
> >> >> __GLIBC_MINOR__ 2
> >> >>
> >> >> Signed-off-by: Petri Gynther <pgynther@google.com>
> >> >> ---
> >> >>  tools/build/feature/test-glibc.c | 11 +++++++++++
> >> >>  tools/perf/util/cloexec.h        |  2 +-
> >> >>  2 files changed, 12 insertions(+), 1 deletion(-)
> >> >>
> >> >> diff --git a/tools/build/feature/test-glibc.c b/tools/build/feature/test-glibc.c
> >> >> index b082034..9367f75 100644
> >> >> --- a/tools/build/feature/test-glibc.c
> >> >> +++ b/tools/build/feature/test-glibc.c
> >> >> @@ -1,8 +1,19 @@
> >> >> +#include <stdlib.h>
> >> >> +
> >> >> +#if !defined(__UCLIBC__)
> >> >>  #include <gnu/libc-version.h>
> >> >> +#else
> >> >> +#define XSTR(s) STR(s)
> >> >> +#define STR(s) #s
> >> >> +#endif
> >> >>
> >> >>  int main(void)
> >> >>  {
> >> >> +#if !defined(__UCLIBC__)
> >> >>         const char *version = gnu_get_libc_version();
> >> >> +#else
> >> >> +       const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__);
> >> >> +#endif
> >> >>
> >> >>         return (long)version;
> >> >>  }
> >> >> diff --git a/tools/perf/util/cloexec.h b/tools/perf/util/cloexec.h
> >> >> index 68888c2..3bee677 100644
> >> >> --- a/tools/perf/util/cloexec.h
> >> >> +++ b/tools/perf/util/cloexec.h
> >> >> @@ -4,7 +4,7 @@
> >> >>  unsigned long perf_event_open_cloexec_flag(void);
> >> >>
> >> >>  #ifdef __GLIBC_PREREQ
> >> >> -#if !__GLIBC_PREREQ(2, 6)
> >> >> +#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
> >> >>  extern int sched_getcpu(void) __THROW;
> >> >>  #endif
> >> >>  #endif
> >> >> --
> >> >> 2.5.0.rc2.392.g76e840b
> >> >>

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
@ 2015-09-21 16:29 Alexey Brodkin
  2015-09-21 21:06 ` Aaro Koskinen
  0 siblings, 1 reply; 13+ messages in thread
From: Alexey Brodkin @ 2015-09-21 16:29 UTC (permalink / raw)
  To: eranian@google.com
  Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	pgynther@google.com, Vineet Gupta, mingo@redhat.com,
	acme@kernel.org

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2393 bytes --]

Hi Stephane,

> Em Fri, Sep 04, 2015 at 04:01:54PM -0700, Petri Gynther escreveu:
> > On Fri, Sep 4, 2015 at 3:48 PM, Arnaldo Carvalho de Melo
> > <ac...@kernel.org> wrote:
> > > Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:
> > >> This commit breaks the perf tool MIPS build because MIPS doesn't have
> > >> CONFIG_PERF_REGS=y in .config-detected:
> > >>
> > >> commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
> > >> Author: Stephane Eranian <era...@google.com>
> > >> Date:   Mon Aug 31 18:41:12 2015 +0200
> > >>
> > >>     perf record: Add ability to name registers to record
> > >
> > > There was a fix for another arch that came after this one.. here it is, already
> > > upstream, can you take a look?
> > >
> > > commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
> > > Author: Stephane Eranian <era...@google.com>
> > > Date:   Tue Sep 1 11:30:14 2015 +0200
> > >
> > >     perf tools: Fix link time error with sample_reg_masks on non x86
> > >
> > >     This patch makes perf compile on non x86 platforms by defining a weak
> > >     symbol for sample_reg_masks[] in util/perf_regs.c.
> > >
> > >     The patch also moves the REG() and REG_END() macros into the
> > >     util/per_regs.h header file. The macros are renamed to
> > >     SMPL_REG/SMPL_REG_END to avoid clashes with other header files.
> > >
> > >
> > 
> > I have the above commit in my tree (as I have the latest Linus' tree
> > as of right now).
> > The MIPS build is still broken as I reported.
> 
> Stephane, can you please take a look?

The same problem happens when building perf on ARC.
I'm on 4.3-rc2 and that's what I see:
------------------->8-----------------
  LINK     .../linux-4.3-rc2/tools/perf/perf
.../linux-4.3-rc2/tools/perf/libperf.a(libperf-in.o): In function `parse_regs':
.../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:28: undefined reference to `sample_reg_masks'
.../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:45: undefined reference to `sample_reg_masks'
.../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:38: undefined reference to `sample_reg_masks'
collect2: error: ld returned 1 exit status
------------------->8-----------------

Any chance for this to be discussed any further?

--
Alexeyÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-09-21 16:29 Alexey Brodkin
@ 2015-09-21 21:06 ` Aaro Koskinen
  2015-10-04 13:53   ` Alexey Brodkin
  0 siblings, 1 reply; 13+ messages in thread
From: Aaro Koskinen @ 2015-09-21 21:06 UTC (permalink / raw)
  To: Alexey Brodkin, Stephane Eranian, Arnaldo Carvalho de Melo
  Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	pgynther@google.com, Vineet Gupta, mingo@redhat.com,
	acme@kernel.org

Hi,

On Mon, Sep 21, 2015 at 04:29:39PM +0000, Alexey Brodkin wrote:
> > Em Fri, Sep 04, 2015 at 04:01:54PM -0700, Petri Gynther escreveu:
> > > On Fri, Sep 4, 2015 at 3:48 PM, Arnaldo Carvalho de Melo
> > > <ac...@kernel.org> wrote:
> > > > Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:
> > > >> This commit breaks the perf tool MIPS build because MIPS doesn't have
> > > >> CONFIG_PERF_REGS=y in .config-detected:
> > > >>
> > > >> commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
> > > >> Author: Stephane Eranian <era...@google.com>
> > > >> Date:   Mon Aug 31 18:41:12 2015 +0200
> > > >>
> > > >>     perf record: Add ability to name registers to record
> > > >
> > > > There was a fix for another arch that came after this one.. here it is, already
> > > > upstream, can you take a look?
> > > >
> > > > commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
> > > > Author: Stephane Eranian <era...@google.com>
> > > > Date:   Tue Sep 1 11:30:14 2015 +0200
> > > >
> > > >     perf tools: Fix link time error with sample_reg_masks on non x86
> > > >
> > > >     This patch makes perf compile on non x86 platforms by defining a weak
> > > >     symbol for sample_reg_masks[] in util/perf_regs.c.
> > > >
> > > >     The patch also moves the REG() and REG_END() macros into the
> > > >     util/per_regs.h header file. The macros are renamed to
> > > >     SMPL_REG/SMPL_REG_END to avoid clashes with other header files.
> > > >
> > > >
> > > 
> > > I have the above commit in my tree (as I have the latest Linus' tree
> > > as of right now).
> > > The MIPS build is still broken as I reported.
> > 
> > Stephane, can you please take a look?
> 
> The same problem happens when building perf on ARC.
> I'm on 4.3-rc2 and that's what I see:
> ------------------->8-----------------
>   LINK     .../linux-4.3-rc2/tools/perf/perf
> .../linux-4.3-rc2/tools/perf/libperf.a(libperf-in.o): In function `parse_regs':
> .../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:28: undefined reference to `sample_reg_masks'
> .../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:45: undefined reference to `sample_reg_masks'
> .../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:38: undefined reference to `sample_reg_masks'
> collect2: error: ld returned 1 exit status
> ------------------->8-----------------
> 
> Any chance for this to be discussed any further?

Also (with 4.3-rc2) on PA-RISC, PowerPC and SPARC the same errors are
seen. 4.2 builds fine.

A.

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-09-21 21:06 ` Aaro Koskinen
@ 2015-10-04 13:53   ` Alexey Brodkin
  2015-10-05 21:59     ` Petri Gynther
  0 siblings, 1 reply; 13+ messages in thread
From: Alexey Brodkin @ 2015-10-04 13:53 UTC (permalink / raw)
  To: acme@redhat.com, eranian@google.com
  Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
	aaro.koskinen@iki.fi, Vineet.Gupta1@synopsys.com, acme@kernel.org,
	mingo@redhat.com, Vineet Gupta, pgynther@google.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3048 bytes --]

Hello Stephane, Armaldo,

On Tue, 2015-09-22 at 00:06 +0300, Aaro Koskinen wrote:
> Hi,
> 
> On Mon, Sep 21, 2015 at 04:29:39PM +0000, Alexey Brodkin wrote:
> > > Em Fri, Sep 04, 2015 at 04:01:54PM -0700, Petri Gynther escreveu:
> > > > On Fri, Sep 4, 2015 at 3:48 PM, Arnaldo Carvalho de Melo
> > > > <ac...@kernel.org> wrote:
> > > > > Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:
> > > > > > This commit breaks the perf tool MIPS build because MIPS doesn't have
> > > > > > CONFIG_PERF_REGS=y in .config-detected:
> > > > > > 
> > > > > > commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
> > > > > > Author: Stephane Eranian <era...@google.com>
> > > > > > Date:   Mon Aug 31 18:41:12 2015 +0200
> > > > > > 
> > > > > >     perf record: Add ability to name registers to record
> > > > > 
> > > > > There was a fix for another arch that came after this one.. here it is, already
> > > > > upstream, can you take a look?
> > > > > 
> > > > > commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
> > > > > Author: Stephane Eranian <era...@google.com>
> > > > > Date:   Tue Sep 1 11:30:14 2015 +0200
> > > > > 
> > > > >     perf tools: Fix link time error with sample_reg_masks on non x86
> > > > > 
> > > > >     This patch makes perf compile on non x86 platforms by defining a weak
> > > > >     symbol for sample_reg_masks[] in util/perf_regs.c.
> > > > > 
> > > > >     The patch also moves the REG() and REG_END() macros into the
> > > > >     util/per_regs.h header file. The macros are renamed to
> > > > >     SMPL_REG/SMPL_REG_END to avoid clashes with other header files.
> > > > > 
> > > > > 
> > > > 
> > > > I have the above commit in my tree (as I have the latest Linus' tree
> > > > as of right now).
> > > > The MIPS build is still broken as I reported.
> > > 
> > > Stephane, can you please take a look?
> > 
> > The same problem happens when building perf on ARC.
> > I'm on 4.3-rc2 and that's what I see:
> > ------------------->8-----------------
> >   LINK     .../linux-4.3-rc2/tools/perf/perf
> > .../linux-4.3-rc2/tools/perf/libperf.a(libperf-in.o): In function `parse_regs':
> > .../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:28: undefined reference to `sample_reg_masks'
> > .../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:45: undefined reference to `sample_reg_masks'
> > .../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:38: undefined reference to `sample_reg_masks'
> > collect2: error: ld returned 1 exit status
> > ------------------->8-----------------
> > 
> > Any chance for this to be discussed any further?
> 
> Also (with 4.3-rc2) on PA-RISC, PowerPC and SPARC the same errors are
> seen. 4.2 builds fine.

Any chance to take a look at this issue?

It's already 4.3-rc3 so it would be nice to get some fix to try so there will be time
to make sure that new fix doesn't break stuff for other arches.

Regards,
Alexeyÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-10-04 13:53   ` Alexey Brodkin
@ 2015-10-05 21:59     ` Petri Gynther
  2015-10-07 18:58       ` Alexey Brodkin
  0 siblings, 1 reply; 13+ messages in thread
From: Petri Gynther @ 2015-10-05 21:59 UTC (permalink / raw)
  To: Alexey Brodkin
  Cc: acme@redhat.com, eranian@google.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, aaro.koskinen@iki.fi,
	Vineet.Gupta1@synopsys.com, acme@kernel.org, mingo@redhat.com

On Sun, Oct 4, 2015 at 6:53 AM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> wrote:
> Hello Stephane, Armaldo,
>
> On Tue, 2015-09-22 at 00:06 +0300, Aaro Koskinen wrote:
>> Hi,
>>
>> On Mon, Sep 21, 2015 at 04:29:39PM +0000, Alexey Brodkin wrote:
>> > > Em Fri, Sep 04, 2015 at 04:01:54PM -0700, Petri Gynther escreveu:
>> > > > On Fri, Sep 4, 2015 at 3:48 PM, Arnaldo Carvalho de Melo
>> > > > <ac...@kernel.org> wrote:
>> > > > > Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:
>> > > > > > This commit breaks the perf tool MIPS build because MIPS doesn't have
>> > > > > > CONFIG_PERF_REGS=y in .config-detected:
>> > > > > >
>> > > > > > commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
>> > > > > > Author: Stephane Eranian <era...@google.com>
>> > > > > > Date:   Mon Aug 31 18:41:12 2015 +0200
>> > > > > >
>> > > > > >     perf record: Add ability to name registers to record
>> > > > >
>> > > > > There was a fix for another arch that came after this one.. here it is, already
>> > > > > upstream, can you take a look?
>> > > > >
>> > > > > commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
>> > > > > Author: Stephane Eranian <era...@google.com>
>> > > > > Date:   Tue Sep 1 11:30:14 2015 +0200
>> > > > >
>> > > > >     perf tools: Fix link time error with sample_reg_masks on non x86
>> > > > >
>> > > > >     This patch makes perf compile on non x86 platforms by defining a weak
>> > > > >     symbol for sample_reg_masks[] in util/perf_regs.c.
>> > > > >
>> > > > >     The patch also moves the REG() and REG_END() macros into the
>> > > > >     util/per_regs.h header file. The macros are renamed to
>> > > > >     SMPL_REG/SMPL_REG_END to avoid clashes with other header files.
>> > > > >
>> > > > >
>> > > >
>> > > > I have the above commit in my tree (as I have the latest Linus' tree
>> > > > as of right now).
>> > > > The MIPS build is still broken as I reported.
>> > >
>> > > Stephane, can you please take a look?
>> >
>> > The same problem happens when building perf on ARC.
>> > I'm on 4.3-rc2 and that's what I see:
>> > ------------------->8-----------------
>> >   LINK     .../linux-4.3-rc2/tools/perf/perf
>> > .../linux-4.3-rc2/tools/perf/libperf.a(libperf-in.o): In function `parse_regs':
>> > .../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:28: undefined reference to `sample_reg_masks'
>> > .../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:45: undefined reference to `sample_reg_masks'
>> > .../linux-4.3-rc2/tools/perf/util/parse-regs-options.c:38: undefined reference to `sample_reg_masks'
>> > collect2: error: ld returned 1 exit status
>> > ------------------->8-----------------
>> >
>> > Any chance for this to be discussed any further?
>>
>> Also (with 4.3-rc2) on PA-RISC, PowerPC and SPARC the same errors are
>> seen. 4.2 builds fine.
>
> Any chance to take a look at this issue?
>
> It's already 4.3-rc3 so it would be nice to get some fix to try so there will be time
> to make sure that new fix doesn't break stuff for other arches.
>
> Regards,
> Alexey

I'd suggest to revert these two commits in Linus' tree:

commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
Author: Stephane Eranian <eranian@google.com>
Date:   Tue Sep 1 11:30:14 2015 +0200

    perf tools: Fix link time error with sample_reg_masks on non x86

commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
Author: Stephane Eranian <eranian@google.com>
Date:   Mon Aug 31 18:41:12 2015 +0200

    perf record: Add ability to name registers to record

until this is figured out and tested for multiple architectures.

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

* RE: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-10-05 21:59     ` Petri Gynther
@ 2015-10-07 18:58       ` Alexey Brodkin
  2015-10-14 21:52         ` Petri Gynther
  0 siblings, 1 reply; 13+ messages in thread
From: Alexey Brodkin @ 2015-10-07 18:58 UTC (permalink / raw)
  To: Petri Gynther
  Cc: acme@redhat.com, eranian@google.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, aaro.koskinen@iki.fi,
	Vineet.Gupta1@synopsys.com, acme@kernel.org, mingo@redhat.com

Hi Petri,

> I'd suggest to revert these two commits in Linus' tree:
> 
> commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
> Author: Stephane Eranian <eranian@google.com>
> Date:   Tue Sep 1 11:30:14 2015 +0200
> 
>     perf tools: Fix link time error with sample_reg_masks on non x86
> 
> commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
> Author: Stephane Eranian <eranian@google.com>
> Date:   Mon Aug 31 18:41:12 2015 +0200
> 
>     perf record: Add ability to name registers to record
> 
> until this is figured out and tested for multiple architectures.

Looks like that problem is already solved in linux-next.
See this commit - http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/tools/perf?id=eb56db54326f910348defbee2803ec0675a664b2

At least for me on ARC latest Linus' tree + this patch cherry-picked allows to build
perf perfectly fine.

-Alexey

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

* Re: [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler
  2015-10-07 18:58       ` Alexey Brodkin
@ 2015-10-14 21:52         ` Petri Gynther
  0 siblings, 0 replies; 13+ messages in thread
From: Petri Gynther @ 2015-10-14 21:52 UTC (permalink / raw)
  To: Alexey Brodkin
  Cc: acme@redhat.com, eranian@google.com, linux-kernel@vger.kernel.org,
	peterz@infradead.org, aaro.koskinen@iki.fi,
	Vineet.Gupta1@synopsys.com, acme@kernel.org, mingo@redhat.com

On Wed, Oct 7, 2015 at 11:58 AM, Alexey Brodkin
<Alexey.Brodkin@synopsys.com> wrote:
> Hi Petri,
>
>> I'd suggest to revert these two commits in Linus' tree:
>>
>> commit af4aeadd8c04303c0aa2d112145c3627e2ebd026
>> Author: Stephane Eranian <eranian@google.com>
>> Date:   Tue Sep 1 11:30:14 2015 +0200
>>
>>     perf tools: Fix link time error with sample_reg_masks on non x86
>>
>> commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5
>> Author: Stephane Eranian <eranian@google.com>
>> Date:   Mon Aug 31 18:41:12 2015 +0200
>>
>>     perf record: Add ability to name registers to record
>>
>> until this is figured out and tested for multiple architectures.
>
> Looks like that problem is already solved in linux-next.
> See this commit - http://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/tools/perf?id=eb56db54326f910348defbee2803ec0675a664b2
>
> At least for me on ARC latest Linus' tree + this patch cherry-picked allows to build
> perf perfectly fine.
>

This patch is now in v4.3-rc5, and perf build for MIPS works fine. Thanks.

> -Alexey

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

end of thread, other threads:[~2015-10-14 21:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-05  0:38 [PATCH] perf tools: Fix build errors with mipsel-linux-uclibc compiler Petri Gynther
2015-08-06  7:04 ` [tip:perf/core] " tip-bot for Petri Gynther
2015-09-04 22:19 ` [PATCH] " Petri Gynther
2015-09-04 22:45   ` Petri Gynther
2015-09-04 22:48     ` Arnaldo Carvalho de Melo
2015-09-04 23:01       ` Petri Gynther
2015-09-04 23:04         ` Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2015-09-21 16:29 Alexey Brodkin
2015-09-21 21:06 ` Aaro Koskinen
2015-10-04 13:53   ` Alexey Brodkin
2015-10-05 21:59     ` Petri Gynther
2015-10-07 18:58       ` Alexey Brodkin
2015-10-14 21:52         ` Petri Gynther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox