All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: acme@kernel.org, eranian@google.com,
	linux-kernel@vger.kernel.org, mingo@redhat.com
Subject: Re: [PATCH] perf record: Limit --intr-regs to platforms supporting PERF_REGS
Date: Thu, 24 Sep 2015 14:57:03 +0200	[thread overview]
Message-ID: <20150924125703.GA11857@krava.redhat.com> (raw)
In-Reply-To: <1443096718-11926-1-git-send-email-naveen.n.rao@linux.vnet.ibm.com>

On Thu, Sep 24, 2015 at 05:41:58PM +0530, Naveen N. Rao wrote:
> 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>

hum, I wonder why we have sample_reg_masks defined as weak in util/perf_regs.c
which is also built only via CONFIG_PERF_REGS

I wonder we could get rid of the weak definition via attached patch, Stephane?


anyway this looks ok

Acked-by: Jiri Olsa <jolsa@kernel.org>

thanks,
jirka


---
diff --git a/tools/perf/arch/x86/util/Build b/tools/perf/arch/x86/util/Build
index ff63649fa9ac..e5627b3d1bb8 100644
--- a/tools/perf/arch/x86/util/Build
+++ b/tools/perf/arch/x86/util/Build
@@ -2,7 +2,7 @@ libperf-y += header.o
 libperf-y += tsc.o
 libperf-y += pmu.o
 libperf-y += kvm-stat.o
-libperf-y += perf_regs.o
+libperf-$(CONFIG_PERF_REGS) += perf_regs.o
 
 libperf-$(CONFIG_DWARF) += dwarf-regs.o
 
diff --git a/tools/perf/util/perf_regs.c b/tools/perf/util/perf_regs.c
index 885e8ac83997..43168fb0d9a2 100644
--- a/tools/perf/util/perf_regs.c
+++ b/tools/perf/util/perf_regs.c
@@ -2,10 +2,6 @@
 #include "perf_regs.h"
 #include "event.h"
 
-const struct sample_reg __weak sample_reg_masks[] = {
-	SMPL_REG_END
-};
-
 int perf_reg_value(u64 *valp, struct regs_dump *regs, int id)
 {
 	int i, idx = 0;

  reply	other threads:[~2015-09-24 12:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150924125703.GA11857@krava.redhat.com \
    --to=jolsa@redhat.com \
    --cc=acme@kernel.org \
    --cc=eranian@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=naveen.n.rao@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.