perf tools: Fix build break on powerpc due to sample_reg_masks

perf_regs.c does not get built on Powerpc as CONFIG_PERF_REGS is false.
So the weak definition for 'sample_regs_masks' doesn't get picked up.

Adding perf_regs.o to util/Build unconditionally, exposes a redefinition
error for 'perf_reg_value()' function (due to the static inline version
in util/perf_regs.h). So use #ifdef HAVE_PERF_REGS_SUPPORT' around that
function.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: linuxppc-dev@ozlabs.org
Link: http://lkml.kernel.org/r/20150930182836.GA27858@us.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by Sukadev Bhattiprolu and committed by Arnaldo Carvalho de Melo 9fb47654 097f70b3

Changed files
+4 -1
tools
+1 -1
tools/perf/util/Build
··· 17 17 libperf-y += llvm-utils.o 18 18 libperf-y += parse-options.o 19 19 libperf-y += parse-events.o 20 + libperf-y += perf_regs.o 20 21 libperf-y += path.o 21 22 libperf-y += rbtree.o 22 23 libperf-y += bitmap.o ··· 104 103 105 104 libperf-y += scripting-engines/ 106 105 107 - libperf-$(CONFIG_PERF_REGS) += perf_regs.o 108 106 libperf-$(CONFIG_ZLIB) += zlib.o 109 107 libperf-$(CONFIG_LZMA) += lzma.o 110 108
+2
tools/perf/util/perf_regs.c
··· 6 6 SMPL_REG_END 7 7 }; 8 8 9 + #ifdef HAVE_PERF_REGS_SUPPORT 9 10 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id) 10 11 { 11 12 int i, idx = 0; ··· 30 29 *valp = regs->cache_regs[id]; 31 30 return 0; 32 31 } 32 + #endif
+1
tools/perf/util/perf_regs.h
··· 2 2 #define __PERF_REGS_H 3 3 4 4 #include <linux/types.h> 5 + #include <linux/compiler.h> 5 6 6 7 struct regs_dump; 7 8