Skip to contentSkip to conversation

perf tools: fix build breakage on arm and arm64 targets

PATCH Superseded Will Deacon 3 participants 4 messages Sep 26, 2014 – Sep 29, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf tools: fix build breakage on arm and arm64 targets

Attempting to build the perf tool on arm or arm64 targets results in the following failure:

arch/arm/util/unwind-libunwind.c: In function ?libunwind__arch_reg_id?:
arch/arm/util/unwind-libunwind.c:43:3: error: implicit declaration of function ?pr_err? [-Werror=implicit-function-declaration]
pr_err("unwind: invalid reg id %d\n", regnum);
^
This is due to commit 84f5d36f4866 ("perf tools: Move pr_* debug macros
into debug object") moving the pr_* macros into a new header file, but
failing to update architectures other than x86.

This patch adds the missing includes, and fixes the build again.

---
 tools/perf/arch/arm/tests/dwarf-unwind.c      | 1 +
 tools/perf/arch/arm/util/unwind-libunwind.c   | 1 +
 tools/perf/arch/arm64/util/unwind-libunwind.c | 1 +
 3 files changed, 3 insertions(+)
tools/perf/arch/arm/tests/dwarf-unwind.c +1 -0
index 9f870d27cb39..62eff847f91c 100644
@@ -3,6 +3,7 @@
 #include "thread.h"
 #include "map.h"
 #include "event.h"
+#include "debug.h"
 #include "tests/tests.h"
 
 #define STACK_SIZE 8192
tools/perf/arch/arm/util/unwind-libunwind.c +1 -0
index 729ed69a6664..62c397ed3d97 100644
@@ -3,6 +3,7 @@
 #include <libunwind.h>
 #include "perf_regs.h"
 #include "../../util/unwind.h"
+#include "../../util/debug.h"
 
 int libunwind__arch_reg_id(int regnum)
 {
tools/perf/arch/arm64/util/unwind-libunwind.c +1 -0
index 436ee43859dc..a87afa91a99e 100644
@@ -3,6 +3,7 @@
 #include <libunwind.h>
 #include "perf_regs.h"
 #include "../../util/unwind.h"
+#include "../../util/debug.h"
 
 int libunwind__arch_reg_id(int regnum)
 {
Signature · 1 line
2.1.0
#1 lore raw
Quoted 5 lines · Will Deacon

Attempting to build the perf tool on arm or arm64 targets results in the following failure:

arch/arm/util/unwind-libunwind.c: In function ?libunwind__arch_reg_id?:
arch/arm/util/unwind-libunwind.c:43:3: error: implicit declaration of function ?pr_err? [-Werror=implicit-function-declaration]

Quoted 8 lines
    pr_err("unwind: invalid reg id %d\n", regnum);
    ^

This is due to commit 84f5d36f4866 ("perf tools: Move pr_* debug macros into debug object") moving the pr_* macros into a new header file, but failing to update architectures other than x86.

This patch adds the missing includes, and fixes the build again.

For ARM64, we also need the patch[1] "perf tools: Fix arm64 build error" which is already queued in linux-next.

Regards,
Sudeep

[1] https://lkml.org/lkml/2014/6/24/1024

#2 lore raw

Hi Will,

Quoted 15 lines · Sudeep Holla
Quoted 13 lines · Will Deacon

Attempting to build the perf tool on arm or arm64 targets results in the following failure:

arch/arm/util/unwind-libunwind.c: In function ?libunwind__arch_reg_id?:
arch/arm/util/unwind-libunwind.c:43:3: error: implicit declaration of function ?pr_err? [-Werror=implicit-function-declaration]

    pr_err("unwind: invalid reg id %d\n", regnum);
    ^

This is due to commit 84f5d36f4866 ("perf tools: Move pr_* debug macros into debug object") moving the pr_* macros into a new header file, but failing to update architectures other than x86.

Quoted 1 line
Quoted 1 line

This patch adds the missing includes, and fixes the build again.

The fix for ARM is already in the tip tree at
http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=29a3ce31c38c8f73f4e076b7ffc0876b4f5dd6c3.

Regards,
Jean

Quoted 10 lines
Quoted 1 line

For ARM64, we also need the patch[1] "perf tools: Fix arm64 build error" which is already queued in linux-next.

Regards,
Sudeep

[1] https://lkml.org/lkml/2014/6/24/1024

#3 lore raw
Quoted 18 lines · Jean Pihet

Hi Will,

Quoted 15 lines · Sudeep Holla
Quoted 13 lines · Will Deacon

Attempting to build the perf tool on arm or arm64 targets results in the following failure:

arch/arm/util/unwind-libunwind.c: In function ?libunwind__arch_reg_id?:
arch/arm/util/unwind-libunwind.c:43:3: error: implicit declaration of function ?pr_err? [-Werror=implicit-function-declaration]

    pr_err("unwind: invalid reg id %d\n", regnum);
    ^

This is due to commit 84f5d36f4866 ("perf tools: Move pr_* debug macros into debug object") moving the pr_* macros into a new header file, but failing to update architectures other than x86.

Quoted 4 lines
Quoted 1 line
Quoted 1 line

This patch adds the missing includes, and fixes the build again.

The fix for ARM is already in the tip tree at
http://git.kernel.org/cgit/linux/kernel/git/tip/tip.git/commit/?id=29a3ce31c38c8f73f4e076b7ffc0876b4f5dd6c3.

Thanks, but that doesn't fix the issue for arm64. I'm also not sure why these haven't been merged into mainline -- without them, the tool doesn't even build for arm/arm64 targets.

Will