mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 18:23:53 +08:00
af4aeadd8c
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. Signed-off-by: Stephane Eranian <eranian@google.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Kan Liang <kan.liang@intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1441099814-26783-1-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
39 lines
763 B
C
39 lines
763 B
C
#ifndef __PERF_REGS_H
|
|
#define __PERF_REGS_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct regs_dump;
|
|
|
|
struct sample_reg {
|
|
const char *name;
|
|
uint64_t mask;
|
|
};
|
|
#define SMPL_REG(n, b) { .name = #n, .mask = 1ULL << (b) }
|
|
#define SMPL_REG_END { .name = NULL }
|
|
|
|
extern const struct sample_reg sample_reg_masks[];
|
|
|
|
#ifdef HAVE_PERF_REGS_SUPPORT
|
|
#include <perf_regs.h>
|
|
|
|
int perf_reg_value(u64 *valp, struct regs_dump *regs, int id);
|
|
|
|
#else
|
|
#define PERF_REGS_MASK 0
|
|
#define PERF_REGS_MAX 0
|
|
|
|
static inline const char *perf_reg_name(int id __maybe_unused)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline int perf_reg_value(u64 *valp __maybe_unused,
|
|
struct regs_dump *regs __maybe_unused,
|
|
int id __maybe_unused)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif /* HAVE_PERF_REGS_SUPPORT */
|
|
#endif /* __PERF_REGS_H */
|