From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754562AbbIXMM1 (ORCPT ); Thu, 24 Sep 2015 08:12:27 -0400 Received: from e28smtp02.in.ibm.com ([122.248.162.2]:54786 "EHLO e28smtp02.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752427AbbIXMMZ (ORCPT ); Thu, 24 Sep 2015 08:12:25 -0400 X-Helo: d28dlp02.in.ibm.com X-MailFrom: naveen.n.rao@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org From: "Naveen N. Rao" To: acme@kernel.org, eranian@google.com Cc: linux-kernel@vger.kernel.org, jolsa@redhat.com, mingo@redhat.com Subject: [PATCH] perf record: Limit --intr-regs to platforms supporting PERF_REGS Date: Thu, 24 Sep 2015 17:41:58 +0530 Message-Id: <1443096718-11926-1-git-send-email-naveen.n.rao@linux.vnet.ibm.com> X-Mailer: git-send-email 2.5.3 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15092412-0005-0000-0000-000007B3E847 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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