public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf record: Limit --intr-regs to platforms supporting PERF_REGS
@ 2015-09-24 12:11 Naveen N. Rao
  2015-09-24 12:57 ` Jiri Olsa
  0 siblings, 1 reply; 13+ messages in thread
From: Naveen N. Rao @ 2015-09-24 12:11 UTC (permalink / raw)
  To: acme, eranian; +Cc: linux-kernel, jolsa, mingo

perf build currently fails on powerpc:

  LINK     perf
libperf.a(libperf-in.o):(.toc+0x120): undefined reference to
`sample_reg_masks'
libperf.a(libperf-in.o):(.toc+0x130): undefined reference to
`sample_reg_masks'
collect2: error: ld returned 1 exit status
make[1]: *** [perf] Error 1
make: *** [all] Error 2

This is due to parse-regs-options.c using sample_reg_masks, which is
defined only with CONFIG_PERF_REGS.

In addition, perf record -I is only useful if the arch supports
PERF_REGS. Hence, let's expose -I conditionally.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
---
 tools/perf/builtin-record.c | 2 ++
 tools/perf/util/Build       | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index a01c8ae..de2aaac 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1095,9 +1095,11 @@ struct option __record_options[] = {
 		    "sample transaction flags (special events only)"),
 	OPT_BOOLEAN(0, "per-thread", &record.opts.target.per_thread,
 		    "use per-thread mmaps"),
+#ifdef HAVE_PERF_REGS_SUPPORT
 	OPT_CALLBACK_OPTARG('I', "intr-regs", &record.opts.sample_intr_regs, NULL, "any register",
 		    "sample selected machine registers on interrupt,"
 		    " use -I ? to list register names", parse_regs),
+#endif
 	OPT_BOOLEAN(0, "running-time", &record.opts.running_time,
 		    "Record running/enabled time of read (:S) events"),
 	OPT_CALLBACK('k', "clockid", &record.opts,
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index 4bc7a9a..cc3960c 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -84,7 +84,7 @@ libperf-$(CONFIG_AUXTRACE) += intel-pt-decoder/
 libperf-$(CONFIG_AUXTRACE) += intel-pt.o
 libperf-$(CONFIG_AUXTRACE) += intel-bts.o
 libperf-y += parse-branch-options.o
-libperf-y += parse-regs-options.o
+libperf-$(CONFIG_PERF_REGS) += parse-regs-options.o
 
 libperf-$(CONFIG_LIBELF) += symbol-elf.o
 libperf-$(CONFIG_LIBELF) += probe-file.o
-- 
2.5.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-09-29 20:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24 12:11 [PATCH] perf record: Limit --intr-regs to platforms supporting PERF_REGS Naveen N. Rao
2015-09-24 12:57 ` Jiri Olsa
2015-09-24 15:32   ` Stephane Eranian
2015-09-24 16:07     ` Jiri Olsa
2015-09-24 16:45     ` Naveen N. Rao
2015-09-29  5:36       ` Naveen N. Rao
2015-09-29  6:53         ` Jiri Olsa
2015-09-29  8:00           ` Naveen N. Rao
2015-09-29 10:47             ` Jiri Olsa
2015-09-29 16:31               ` Naveen N. Rao
2015-09-29 17:15                 ` Jiri Olsa
2015-09-29 18:10                   ` Sukadev Bhattiprolu
2015-09-29 20:36                     ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox