Currently, the macro HAVE_PERF_REGS_SUPPORT is used as a switch to turn
on or turn off the code of perf registers. If any architecture cannot
support perf register, it disables the perf register parsing, for both
the native parsing and cross parsing for other architectures.
To support both the native parsing and cross parsing, the tool should
always build the perf regs functions. Thus, this patch removes
HAVE_PERF_REGS_SUPPORT from the perf regs files.
Signed-off-by: Leo Yan <leo.yan@linux.dev>
---
.../util/perf-regs-arch/perf_regs_aarch64.c | 4 ---
.../perf/util/perf-regs-arch/perf_regs_arm.c | 4 ---
.../perf/util/perf-regs-arch/perf_regs_csky.c | 4 ---
.../util/perf-regs-arch/perf_regs_loongarch.c | 4 ---
.../perf/util/perf-regs-arch/perf_regs_mips.c | 4 ---
.../util/perf-regs-arch/perf_regs_powerpc.c | 4 ---
.../util/perf-regs-arch/perf_regs_riscv.c | 4 ---
.../perf/util/perf-regs-arch/perf_regs_s390.c | 4 ---
.../perf/util/perf-regs-arch/perf_regs_x86.c | 4 ---
tools/perf/util/perf_regs.c | 4 ---
tools/perf/util/perf_regs.h | 31 -------------------
11 files changed, 71 deletions(-)
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#ifdef HAVE_PERF_REGS_SUPPORT
-
#include "../perf_regs.h"
#include "../../../arch/arm64/include/uapi/asm/perf_regs.h"
@@ -92,5 +90,3 @@ uint64_t __perf_reg_sp_arm64(void)
{
return PERF_REG_ARM64_SP;
}
-
-#endif
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#ifdef HAVE_PERF_REGS_SUPPORT
-
#include "../perf_regs.h"
#include "../../../arch/arm/include/uapi/asm/perf_regs.h"
@@ -56,5 +54,3 @@ uint64_t __perf_reg_sp_arm(void)
{
return PERF_REG_ARM_SP;
}
-
-#endif
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#ifdef HAVE_PERF_REGS_SUPPORT
-
#include "../perf_regs.h"
#include "../../arch/csky/include/uapi/asm/perf_regs.h"
@@ -96,5 +94,3 @@ uint64_t __perf_reg_sp_csky(void)
{
return PERF_REG_CSKY_SP;
}
-
-#endif
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#ifdef HAVE_PERF_REGS_SUPPORT
-
#include "../perf_regs.h"
#include "../../../arch/loongarch/include/uapi/asm/perf_regs.h"
@@ -87,5 +85,3 @@ uint64_t __perf_reg_sp_loongarch(void)
{
return PERF_REG_LOONGARCH_R3;
}
-
-#endif
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#ifdef HAVE_PERF_REGS_SUPPORT
-
#include "../perf_regs.h"
#include "../../../arch/mips/include/uapi/asm/perf_regs.h"
@@ -83,5 +81,3 @@ uint64_t __perf_reg_sp_mips(void)
{
return PERF_REG_MIPS_R29;
}
-
-#endif
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#ifdef HAVE_PERF_REGS_SUPPORT
-
#include "../perf_regs.h"
#include "../../../arch/powerpc/include/uapi/asm/perf_regs.h"
@@ -141,5 +139,3 @@ uint64_t __perf_reg_sp_powerpc(void)
{
return PERF_REG_POWERPC_R1;
}
-
-#endif
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#ifdef HAVE_PERF_REGS_SUPPORT
-
#include "../perf_regs.h"
#include "../../../arch/riscv/include/uapi/asm/perf_regs.h"
@@ -88,5 +86,3 @@ uint64_t __perf_reg_sp_riscv(void)
{
return PERF_REG_RISCV_SP;
}
-
-#endif
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#ifdef HAVE_PERF_REGS_SUPPORT
-
#include "../perf_regs.h"
#include "../../../arch/s390/include/uapi/asm/perf_regs.h"
@@ -92,5 +90,3 @@ uint64_t __perf_reg_sp_s390(void)
{
return PERF_REG_S390_R15;
}
-
-#endif
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#ifdef HAVE_PERF_REGS_SUPPORT
-
#include "../perf_regs.h"
#include "../../../arch/x86/include/uapi/asm/perf_regs.h"
@@ -94,5 +92,3 @@ uint64_t __perf_reg_sp_x86(void)
{
return PERF_REG_X86_SP;
}
-
-#endif
@@ -21,8 +21,6 @@ uint64_t __weak arch__user_reg_mask(void)
return 0;
}
-#ifdef HAVE_PERF_REGS_SUPPORT
-
const char *perf_reg_name(int id, const char *arch)
{
const char *reg_name = NULL;
@@ -125,5 +123,3 @@ uint64_t perf_arch_reg_sp(const char *arch)
pr_err("Fail to find SP register for arch %s, returns 0\n", arch);
return 0;
}
-
-#endif
@@ -27,7 +27,6 @@ int arch_sdt_arg_parse_op(char *old_op, char **new_op);
uint64_t arch__intr_reg_mask(void);
uint64_t arch__user_reg_mask(void);
-#ifdef HAVE_PERF_REGS_SUPPORT
extern const struct sample_reg sample_reg_masks[];
const char *perf_reg_name(int id, const char *arch);
@@ -67,34 +66,4 @@ static inline uint64_t DWARF_MINIMAL_REGS(const char *arch)
return (1ULL << perf_arch_reg_ip(arch)) | (1ULL << perf_arch_reg_sp(arch));
}
-#else
-
-static inline uint64_t DWARF_MINIMAL_REGS(const char *arch __maybe_unused)
-{
- return 0;
-}
-
-static inline const char *perf_reg_name(int id __maybe_unused, const char *arch __maybe_unused)
-{
- return "unknown";
-}
-
-static inline int perf_reg_value(u64 *valp __maybe_unused,
- struct regs_dump *regs __maybe_unused,
- int id __maybe_unused)
-{
- return 0;
-}
-
-static inline uint64_t perf_arch_reg_ip(const char *arch __maybe_unused)
-{
- return 0;
-}
-
-static inline uint64_t perf_arch_reg_sp(const char *arch __maybe_unused)
-{
- return 0;
-}
-
-#endif /* HAVE_PERF_REGS_SUPPORT */
#endif /* __PERF_REGS_H */