Skip to contentSkip to conversation

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

PATCH Alexey Brodkin 3 participants 6 messages Sep 21, 2015 – Oct 14, 2015

lore
Share & tools
lore
#0 lore raw

Hi Stephane,

Quoted 31 lines

Em Fri, Sep 04, 2015 at 04:01:54PM -0700, Petri Gynther escreveu:

Quoted 30 lines
Quoted 27 lines · Arnaldo Carvalho de Melo

Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:

Quoted 8 lines

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 <[email protected]>
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 <[email protected]>
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.

Quoted 5 lines
Quoted 3 lines

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�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

#1 lore raw

Hi,

Quoted 48 lines · Alexey Brodkin
Quoted 31 lines

Em Fri, Sep 04, 2015 at 04:01:54PM -0700, Petri Gynther escreveu:

Quoted 30 lines
Quoted 27 lines · Arnaldo Carvalho de Melo

Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:

Quoted 8 lines

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 <[email protected]>
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 <[email protected]>
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.

Quoted 5 lines
Quoted 3 lines

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

Quoted 1 line

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.

#2 lore raw

Hello Stephane, Armaldo,

Quoted 51 lines · Aaro Koskinen

Hi,

Quoted 48 lines · Alexey Brodkin
Quoted 31 lines

Em Fri, Sep 04, 2015 at 04:01:54PM -0700, Petri Gynther escreveu:

Quoted 30 lines
Quoted 27 lines · Arnaldo Carvalho de Melo

Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:

Quoted 8 lines

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 <[email protected]>
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 <[email protected]>
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.

Quoted 5 lines
Quoted 3 lines

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

Quoted 4 lines
Quoted 1 line

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�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

#3 lore raw
Quoted 59 lines · Alexey Brodkin

Hello Stephane, Armaldo,

Quoted 51 lines · Aaro Koskinen

Hi,

Quoted 48 lines · Alexey Brodkin
Quoted 31 lines

Em Fri, Sep 04, 2015 at 04:01:54PM -0700, Petri Gynther escreveu:

Quoted 30 lines
Quoted 27 lines · Arnaldo Carvalho de Melo

Em Fri, Sep 04, 2015 at 03:45:03PM -0700, Petri Gynther escreveu:

Quoted 8 lines

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 <[email protected]>
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 <[email protected]>
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.

Quoted 5 lines
Quoted 3 lines

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

Quoted 4 lines
Quoted 1 line

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.

Quoted 7 lines

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 <[email protected]>
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 <[email protected]>
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.

#4 lore raw

Hi Petri,

Quoted 8 lines

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

commit af4aeadd8c04303c0aa2d112145c3627e2ebd026

Author: Stephane Eranian <[email protected]>
Date:   Tue Sep 1 11:30:14 2015 +0200

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

Quoted 7 lines

commit bcc84ec65ad1bd9f777a1fade6f8e5e0c5808fa5

Author: Stephane Eranian <[email protected]>
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

#5 lore raw
Quoted 16 lines · Alexey Brodkin

Hi Petri,

Quoted 14 lines

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

commit af4aeadd8c04303c0aa2d112145c3627e2ebd026

Author: Stephane Eranian <[email protected]>
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 <[email protected]>
Date:   Mon Aug 31 18:41:12 2015 +0200

perf record: Add ability to name registers to record

Quoted 8 lines
Quoted 1 line

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.

Quoted 1 line

-Alexey