linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts
@ 2015-08-25 10:42 Adrian Hunter
  2015-08-25 10:42 ` [PATCH 2/2] perf tools: Make NO_AUXTRACE default for non-x86 architectures Adrian Hunter
  2015-08-25 15:30 ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 14+ messages in thread
From: Adrian Hunter @ 2015-08-25 10:42 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, Jiri Olsa, Sukadev Bhattiprolu

It is theoretically possible to process perf.data files created on
x86 and that contain Intel PT or Intel BTS data, on any other
architecture, which is why it is possible for there to be build
errors on powerpc caused by pt/bts.

The errors were:

	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
	   switch (insn->immediate.nbytes) {
	   ^
	cc1: all warnings being treated as errors

	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/Build                                    | 2 +-
 tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index e912856cc4e5..8ae31e5131ee 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -74,7 +74,7 @@ libperf-y += stat-shadow.o
 libperf-y += record.o
 libperf-y += srcline.o
 libperf-y += data.o
-libperf-$(CONFIG_X86) += tsc.o
+libperf-$(if $(CONFIG_X86)$(CONFIG_AUXTRACE),y) += tsc.o
 libperf-y += cloexec.o
 libperf-y += thread-stack.o
 libperf-$(CONFIG_AUXTRACE) += auxtrace.o
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
index 9e4eb8fcd559..d23138c06665 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
@@ -146,6 +146,9 @@ static void intel_pt_insn_decoder(struct insn *insn,
 		case 4:
 			intel_pt_insn->rel = bswap_32(insn->immediate.value);
 			break;
+		default:
+			intel_pt_insn->rel = 0;
+			break;
 		}
 #else
 		intel_pt_insn->rel = insn->immediate.value;
-- 
1.9.1


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

* [PATCH 2/2] perf tools: Make NO_AUXTRACE default for non-x86 architectures
  2015-08-25 10:42 [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Adrian Hunter
@ 2015-08-25 10:42 ` Adrian Hunter
  2015-08-25 15:30 ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 14+ messages in thread
From: Adrian Hunter @ 2015-08-25 10:42 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: linux-kernel, Jiri Olsa, Sukadev Bhattiprolu

Currently the AUXTRACE infrastructure is only used by Intel PT
and Intel BTS but is compiled into all architectures to support
the ability to process a perf.data file (including one containing
Intel PT or Intel BTS data) from any architecture on any other
architecture.

Generally people don't want that ability with respect to AUXTRACE
by default.

Make the build option NO_AUXTRACE the default for non-x86
architectures.  To build with AUXTRACE on those architectures
use NO_AUXTRACE=0.

The build-test is updated accordingly.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/config/Makefile | 8 ++++++++
 tools/perf/tests/make      | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/tools/perf/config/Makefile b/tools/perf/config/Makefile
index 827557fc7511..ddc3b64fdad2 100644
--- a/tools/perf/config/Makefile
+++ b/tools/perf/config/Makefile
@@ -621,6 +621,14 @@ ifdef LIBBABELTRACE
 endif
 
 ifndef NO_AUXTRACE
+  ifneq ($(ARCH),x86)
+    NO_AUXTRACE := 1
+  else
+    NO_AUXTRACE := 0
+  endif
+endif
+
+ifeq ($(NO_AUXTRACE), 0)
   $(call detected,CONFIG_AUXTRACE)
   CFLAGS += -DHAVE_AUXTRACE_SUPPORT
 endif
diff --git a/tools/perf/tests/make b/tools/perf/tests/make
index ba31c4bd441d..977ded210de2 100644
--- a/tools/perf/tests/make
+++ b/tools/perf/tests/make
@@ -44,6 +44,7 @@ make_no_libnuma     := NO_LIBNUMA=1
 make_no_libaudit    := NO_LIBAUDIT=1
 make_no_libbionic   := NO_LIBBIONIC=1
 make_no_auxtrace    := NO_AUXTRACE=1
+make_auxtrace       := NO_AUXTRACE=0
 make_tags           := tags
 make_cscope         := cscope
 make_help           := help
@@ -94,6 +95,7 @@ run += make_no_libnuma
 run += make_no_libaudit
 run += make_no_libbionic
 run += make_no_auxtrace
+run += make_auxtrace
 run += make_help
 run += make_doc
 run += make_perf_o
-- 
1.9.1


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

* Re: [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts
  2015-08-25 10:42 [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Adrian Hunter
  2015-08-25 10:42 ` [PATCH 2/2] perf tools: Make NO_AUXTRACE default for non-x86 architectures Adrian Hunter
@ 2015-08-25 15:30 ` Arnaldo Carvalho de Melo
  2015-08-26  6:57   ` Adrian Hunter
                     ` (2 more replies)
  1 sibling, 3 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-08-25 15:30 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linux-kernel, Jiri Olsa, Sukadev Bhattiprolu

Em Tue, Aug 25, 2015 at 01:42:27PM +0300, Adrian Hunter escreveu:
> It is theoretically possible to process perf.data files created on
> x86 and that contain Intel PT or Intel BTS data, on any other
> architecture, which is why it is possible for there to be build
> errors on powerpc caused by pt/bts.
> 
> The errors were:
> 
> 	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
> 	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
> 	   switch (insn->immediate.nbytes) {
> 	   ^
> 	cc1: all warnings being treated as errors
> 
> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
>  tools/perf/util/Build                                    | 2 +-
>  tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> index e912856cc4e5..8ae31e5131ee 100644
> --- a/tools/perf/util/Build
> +++ b/tools/perf/util/Build
> @@ -74,7 +74,7 @@ libperf-y += stat-shadow.o
>  libperf-y += record.o
>  libperf-y += srcline.o
>  libperf-y += data.o
> -libperf-$(CONFIG_X86) += tsc.o
> +libperf-$(if $(CONFIG_X86)$(CONFIG_AUXTRACE),y) += tsc.o

I think this is preferred/more clear:

libperf-$(CONFIG_X86) += tsc.o
libperf-$(CONFIG_AUXTRACE) += tsc.o

As we have in drivers/Makefile, in the kernel sources:

drivers/Makefile:obj-$(CONFIG_PCI)		+= usb/
drivers/Makefile:obj-$(CONFIG_USB_GADGET)	+= usb/
drivers/Makefile:obj-$(CONFIG_USB_PHY)		+= usb/
drivers/Makefile:obj-$(CONFIG_USB)		+= usb/

>From Documentation/kbuild/makefiles.txt:

--- 3.2 Built-in object goals - obj-y

        The kbuild Makefile specifies object files for vmlinux
        in the $(obj-y) lists.  These lists depend on the kernel
        configuration.

        Kbuild compiles all the $(obj-y) files.  It then calls
        "$(LD) -r" to merge these files into one built-in.o file.
        built-in.o is later linked into vmlinux by the parent Makefile.

        The order of files in $(obj-y) is significant.  Duplicates in
        the lists are allowed: the first instance will be linked into
        built-in.o and succeeding instances will be ignored.

------------------------

Jiri?

- Arnaldo

>  libperf-y += cloexec.o
>  libperf-y += thread-stack.o
>  libperf-$(CONFIG_AUXTRACE) += auxtrace.o
> diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
> index 9e4eb8fcd559..d23138c06665 100644
> --- a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
> +++ b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
> @@ -146,6 +146,9 @@ static void intel_pt_insn_decoder(struct insn *insn,
>  		case 4:
>  			intel_pt_insn->rel = bswap_32(insn->immediate.value);
>  			break;
> +		default:
> +			intel_pt_insn->rel = 0;
> +			break;
>  		}
>  #else
>  		intel_pt_insn->rel = insn->immediate.value;
> -- 
> 1.9.1

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

* Re: [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts
  2015-08-25 15:30 ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Arnaldo Carvalho de Melo
@ 2015-08-26  6:57   ` Adrian Hunter
  2015-08-26  7:25     ` Jiri Olsa
  2015-08-26  7:06   ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Jiri Olsa
  2015-08-31 18:39   ` [PATCH V2] " Adrian Hunter
  2 siblings, 1 reply; 14+ messages in thread
From: Adrian Hunter @ 2015-08-26  6:57 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa; +Cc: linux-kernel, Sukadev Bhattiprolu

On 25/08/15 18:30, Arnaldo Carvalho de Melo wrote:
> Em Tue, Aug 25, 2015 at 01:42:27PM +0300, Adrian Hunter escreveu:
>> It is theoretically possible to process perf.data files created on
>> x86 and that contain Intel PT or Intel BTS data, on any other
>> architecture, which is why it is possible for there to be build
>> errors on powerpc caused by pt/bts.
>>
>> The errors were:
>>
>> 	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
>> 	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
>> 	   switch (insn->immediate.nbytes) {
>> 	   ^
>> 	cc1: all warnings being treated as errors
>>
>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>>  tools/perf/util/Build                                    | 2 +-
>>  tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
>>  2 files changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
>> index e912856cc4e5..8ae31e5131ee 100644
>> --- a/tools/perf/util/Build
>> +++ b/tools/perf/util/Build
>> @@ -74,7 +74,7 @@ libperf-y += stat-shadow.o
>>  libperf-y += record.o
>>  libperf-y += srcline.o
>>  libperf-y += data.o
>> -libperf-$(CONFIG_X86) += tsc.o
>> +libperf-$(if $(CONFIG_X86)$(CONFIG_AUXTRACE),y) += tsc.o
> 
> I think this is preferred/more clear:
> 
> libperf-$(CONFIG_X86) += tsc.o
> libperf-$(CONFIG_AUXTRACE) += tsc.o

I tried that first but it doesn't work:

util/tsc.o: In function `perf_time_to_tsc':
/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: multiple definition of `perf_time_to_tsc'
util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: first defined here
util/tsc.o: In function `tsc_to_perf_time':
/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: multiple definition of `tsc_to_perf_time'
util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: first defined here
make[3]: *** [util/libperf-in.o] Error 1
make[2]: *** [util] Error 2
make[1]: *** [libperf-in.o] Error 2
make: *** [all] Error 2

I will have a look at why, unless Jiri knows?

> 
> As we have in drivers/Makefile, in the kernel sources:
> 
> drivers/Makefile:obj-$(CONFIG_PCI)		+= usb/
> drivers/Makefile:obj-$(CONFIG_USB_GADGET)	+= usb/
> drivers/Makefile:obj-$(CONFIG_USB_PHY)		+= usb/
> drivers/Makefile:obj-$(CONFIG_USB)		+= usb/
> 
>>From Documentation/kbuild/makefiles.txt:
> 
> --- 3.2 Built-in object goals - obj-y
> 
>         The kbuild Makefile specifies object files for vmlinux
>         in the $(obj-y) lists.  These lists depend on the kernel
>         configuration.
> 
>         Kbuild compiles all the $(obj-y) files.  It then calls
>         "$(LD) -r" to merge these files into one built-in.o file.
>         built-in.o is later linked into vmlinux by the parent Makefile.
> 
>         The order of files in $(obj-y) is significant.  Duplicates in
>         the lists are allowed: the first instance will be linked into
>         built-in.o and succeeding instances will be ignored.
> 
> ------------------------
> 
> Jiri?
> 
> - Arnaldo
> 
>>  libperf-y += cloexec.o
>>  libperf-y += thread-stack.o
>>  libperf-$(CONFIG_AUXTRACE) += auxtrace.o
>> diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
>> index 9e4eb8fcd559..d23138c06665 100644
>> --- a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
>> +++ b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
>> @@ -146,6 +146,9 @@ static void intel_pt_insn_decoder(struct insn *insn,
>>  		case 4:
>>  			intel_pt_insn->rel = bswap_32(insn->immediate.value);
>>  			break;
>> +		default:
>> +			intel_pt_insn->rel = 0;
>> +			break;
>>  		}
>>  #else
>>  		intel_pt_insn->rel = insn->immediate.value;
>> -- 
>> 1.9.1
> 
> 


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

* Re: [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts
  2015-08-25 15:30 ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Arnaldo Carvalho de Melo
  2015-08-26  6:57   ` Adrian Hunter
@ 2015-08-26  7:06   ` Jiri Olsa
  2015-08-31 18:39   ` [PATCH V2] " Adrian Hunter
  2 siblings, 0 replies; 14+ messages in thread
From: Jiri Olsa @ 2015-08-26  7:06 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo; +Cc: Adrian Hunter, linux-kernel, Sukadev Bhattiprolu

On Tue, Aug 25, 2015 at 12:30:10PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Aug 25, 2015 at 01:42:27PM +0300, Adrian Hunter escreveu:
> > It is theoretically possible to process perf.data files created on
> > x86 and that contain Intel PT or Intel BTS data, on any other
> > architecture, which is why it is possible for there to be build
> > errors on powerpc caused by pt/bts.
> > 
> > The errors were:
> > 
> > 	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
> > 	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
> > 	   switch (insn->immediate.nbytes) {
> > 	   ^
> > 	cc1: all warnings being treated as errors
> > 
> > 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
> > 	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
> > 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
> > 	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
> > 	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
> > 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
> > 	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'
> > 
> > Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> > ---
> >  tools/perf/util/Build                                    | 2 +-
> >  tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
> >  2 files changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> > index e912856cc4e5..8ae31e5131ee 100644
> > --- a/tools/perf/util/Build
> > +++ b/tools/perf/util/Build
> > @@ -74,7 +74,7 @@ libperf-y += stat-shadow.o
> >  libperf-y += record.o
> >  libperf-y += srcline.o
> >  libperf-y += data.o
> > -libperf-$(CONFIG_X86) += tsc.o
> > +libperf-$(if $(CONFIG_X86)$(CONFIG_AUXTRACE),y) += tsc.o
> 
> I think this is preferred/more clear:
> 
> libperf-$(CONFIG_X86) += tsc.o
> libperf-$(CONFIG_AUXTRACE) += tsc.o
> 
> As we have in drivers/Makefile, in the kernel sources:
> 
> drivers/Makefile:obj-$(CONFIG_PCI)		+= usb/
> drivers/Makefile:obj-$(CONFIG_USB_GADGET)	+= usb/
> drivers/Makefile:obj-$(CONFIG_USB_PHY)		+= usb/
> drivers/Makefile:obj-$(CONFIG_USB)		+= usb/
> 
> From Documentation/kbuild/makefiles.txt:
> 
> --- 3.2 Built-in object goals - obj-y
> 
>         The kbuild Makefile specifies object files for vmlinux
>         in the $(obj-y) lists.  These lists depend on the kernel
>         configuration.
> 
>         Kbuild compiles all the $(obj-y) files.  It then calls
>         "$(LD) -r" to merge these files into one built-in.o file.
>         built-in.o is later linked into vmlinux by the parent Makefile.
> 
>         The order of files in $(obj-y) is significant.  Duplicates in
>         the lists are allowed: the first instance will be linked into
>         built-in.o and succeeding instances will be ignored.

nope, we don't do that.. but it's nice feature ;-)
seems easy enough, I'll check

jirka

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

* Re: [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts
  2015-08-26  6:57   ` Adrian Hunter
@ 2015-08-26  7:25     ` Jiri Olsa
  2015-08-26  7:27       ` Adrian Hunter
  0 siblings, 1 reply; 14+ messages in thread
From: Jiri Olsa @ 2015-08-26  7:25 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Arnaldo Carvalho de Melo, linux-kernel, Sukadev Bhattiprolu

On Wed, Aug 26, 2015 at 09:57:13AM +0300, Adrian Hunter wrote:
> On 25/08/15 18:30, Arnaldo Carvalho de Melo wrote:
> > Em Tue, Aug 25, 2015 at 01:42:27PM +0300, Adrian Hunter escreveu:
> >> It is theoretically possible to process perf.data files created on
> >> x86 and that contain Intel PT or Intel BTS data, on any other
> >> architecture, which is why it is possible for there to be build
> >> errors on powerpc caused by pt/bts.
> >>
> >> The errors were:
> >>
> >> 	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
> >> 	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
> >> 	   switch (insn->immediate.nbytes) {
> >> 	   ^
> >> 	cc1: all warnings being treated as errors
> >>
> >> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
> >> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
> >> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
> >> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
> >> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
> >> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
> >> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'
> >>
> >> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> >> ---
> >>  tools/perf/util/Build                                    | 2 +-
> >>  tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
> >>  2 files changed, 4 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> >> index e912856cc4e5..8ae31e5131ee 100644
> >> --- a/tools/perf/util/Build
> >> +++ b/tools/perf/util/Build
> >> @@ -74,7 +74,7 @@ libperf-y += stat-shadow.o
> >>  libperf-y += record.o
> >>  libperf-y += srcline.o
> >>  libperf-y += data.o
> >> -libperf-$(CONFIG_X86) += tsc.o
> >> +libperf-$(if $(CONFIG_X86)$(CONFIG_AUXTRACE),y) += tsc.o
> > 
> > I think this is preferred/more clear:
> > 
> > libperf-$(CONFIG_X86) += tsc.o
> > libperf-$(CONFIG_AUXTRACE) += tsc.o
> 
> I tried that first but it doesn't work:
> 
> util/tsc.o: In function `perf_time_to_tsc':
> /mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: multiple definition of `perf_time_to_tsc'
> util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: first defined here
> util/tsc.o: In function `tsc_to_perf_time':
> /mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: multiple definition of `tsc_to_perf_time'
> util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: first defined here
> make[3]: *** [util/libperf-in.o] Error 1
> make[2]: *** [util] Error 2
> make[1]: *** [libperf-in.o] Error 2
> make: *** [all] Error 2
> 
> I will have a look at why, unless Jiri knows?
> 

I'm now testing attached patch, does it fix it for you?

thanks,
jirka


---
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index 8120af9c0341..0c5f485521d6 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -63,7 +63,7 @@ quiet_cmd_gen = GEN      $@
 # If there's nothing to link, create empty $@ object.
 quiet_cmd_ld_multi = LD       $@
       cmd_ld_multi = $(if $(strip $(obj-y)),\
-		       $(LD) -r -o $@ $(obj-y),rm -f $@; $(AR) rcs $@)
+		       $(LD) -r -o $@  $(filter $(obj-y),$^),rm -f $@; $(AR) rcs $@)
 
 # Build rules
 $(OUTPUT)%.o: %.c FORCE
diff --git a/tools/build/tests/ex/Build b/tools/build/tests/ex/Build
index 70d876237c57..429c7d452101 100644
--- a/tools/build/tests/ex/Build
+++ b/tools/build/tests/ex/Build
@@ -1,6 +1,7 @@
 ex-y += ex.o
 ex-y += a.o
 ex-y += b.o
+ex-y += b.o
 ex-y += empty/
 ex-y += empty2/
 

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

* Re: [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts
  2015-08-26  7:25     ` Jiri Olsa
@ 2015-08-26  7:27       ` Adrian Hunter
  2015-08-26  8:07         ` Jiri Olsa
  0 siblings, 1 reply; 14+ messages in thread
From: Adrian Hunter @ 2015-08-26  7:27 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: Arnaldo Carvalho de Melo, linux-kernel, Sukadev Bhattiprolu

On 26/08/15 10:25, Jiri Olsa wrote:
> On Wed, Aug 26, 2015 at 09:57:13AM +0300, Adrian Hunter wrote:
>> On 25/08/15 18:30, Arnaldo Carvalho de Melo wrote:
>>> Em Tue, Aug 25, 2015 at 01:42:27PM +0300, Adrian Hunter escreveu:
>>>> It is theoretically possible to process perf.data files created on
>>>> x86 and that contain Intel PT or Intel BTS data, on any other
>>>> architecture, which is why it is possible for there to be build
>>>> errors on powerpc caused by pt/bts.
>>>>
>>>> The errors were:
>>>>
>>>> 	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
>>>> 	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
>>>> 	   switch (insn->immediate.nbytes) {
>>>> 	   ^
>>>> 	cc1: all warnings being treated as errors
>>>>
>>>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
>>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
>>>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
>>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
>>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
>>>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
>>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'
>>>>
>>>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>>>> ---
>>>>  tools/perf/util/Build                                    | 2 +-
>>>>  tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
>>>>  2 files changed, 4 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
>>>> index e912856cc4e5..8ae31e5131ee 100644
>>>> --- a/tools/perf/util/Build
>>>> +++ b/tools/perf/util/Build
>>>> @@ -74,7 +74,7 @@ libperf-y += stat-shadow.o
>>>>  libperf-y += record.o
>>>>  libperf-y += srcline.o
>>>>  libperf-y += data.o
>>>> -libperf-$(CONFIG_X86) += tsc.o
>>>> +libperf-$(if $(CONFIG_X86)$(CONFIG_AUXTRACE),y) += tsc.o
>>>
>>> I think this is preferred/more clear:
>>>
>>> libperf-$(CONFIG_X86) += tsc.o
>>> libperf-$(CONFIG_AUXTRACE) += tsc.o
>>
>> I tried that first but it doesn't work:
>>
>> util/tsc.o: In function `perf_time_to_tsc':
>> /mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: multiple definition of `perf_time_to_tsc'
>> util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: first defined here
>> util/tsc.o: In function `tsc_to_perf_time':
>> /mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: multiple definition of `tsc_to_perf_time'
>> util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: first defined here
>> make[3]: *** [util/libperf-in.o] Error 1
>> make[2]: *** [util] Error 2
>> make[1]: *** [libperf-in.o] Error 2
>> make: *** [all] Error 2
>>
>> I will have a look at why, unless Jiri knows?
>>
> 
> I'm now testing attached patch, does it fix it for you?

Yup!  Thanks Jiri! :-)

> 
> thanks,
> jirka
> 
> 
> ---
> diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
> index 8120af9c0341..0c5f485521d6 100644
> --- a/tools/build/Makefile.build
> +++ b/tools/build/Makefile.build
> @@ -63,7 +63,7 @@ quiet_cmd_gen = GEN      $@
>  # If there's nothing to link, create empty $@ object.
>  quiet_cmd_ld_multi = LD       $@
>        cmd_ld_multi = $(if $(strip $(obj-y)),\
> -		       $(LD) -r -o $@ $(obj-y),rm -f $@; $(AR) rcs $@)
> +		       $(LD) -r -o $@  $(filter $(obj-y),$^),rm -f $@; $(AR) rcs $@)
>  
>  # Build rules
>  $(OUTPUT)%.o: %.c FORCE
> diff --git a/tools/build/tests/ex/Build b/tools/build/tests/ex/Build
> index 70d876237c57..429c7d452101 100644
> --- a/tools/build/tests/ex/Build
> +++ b/tools/build/tests/ex/Build
> @@ -1,6 +1,7 @@
>  ex-y += ex.o
>  ex-y += a.o
>  ex-y += b.o
> +ex-y += b.o
>  ex-y += empty/
>  ex-y += empty2/
>  
> 
> 


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

* Re: [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts
  2015-08-26  7:27       ` Adrian Hunter
@ 2015-08-26  8:07         ` Jiri Olsa
  2015-08-26 13:01           ` [PATCH] tools build: Allow duplicate objects in the object list Jiri Olsa
                             ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Jiri Olsa @ 2015-08-26  8:07 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Arnaldo Carvalho de Melo, linux-kernel, Sukadev Bhattiprolu

On Wed, Aug 26, 2015 at 10:27:09AM +0300, Adrian Hunter wrote:
> On 26/08/15 10:25, Jiri Olsa wrote:
> > On Wed, Aug 26, 2015 at 09:57:13AM +0300, Adrian Hunter wrote:
> >> On 25/08/15 18:30, Arnaldo Carvalho de Melo wrote:
> >>> Em Tue, Aug 25, 2015 at 01:42:27PM +0300, Adrian Hunter escreveu:
> >>>> It is theoretically possible to process perf.data files created on
> >>>> x86 and that contain Intel PT or Intel BTS data, on any other
> >>>> architecture, which is why it is possible for there to be build
> >>>> errors on powerpc caused by pt/bts.
> >>>>
> >>>> The errors were:
> >>>>
> >>>> 	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
> >>>> 	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
> >>>> 	   switch (insn->immediate.nbytes) {
> >>>> 	   ^
> >>>> 	cc1: all warnings being treated as errors
> >>>>
> >>>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
> >>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
> >>>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
> >>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
> >>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
> >>>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
> >>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'
> >>>>
> >>>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> >>>> ---
> >>>>  tools/perf/util/Build                                    | 2 +-
> >>>>  tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
> >>>>  2 files changed, 4 insertions(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> >>>> index e912856cc4e5..8ae31e5131ee 100644
> >>>> --- a/tools/perf/util/Build
> >>>> +++ b/tools/perf/util/Build
> >>>> @@ -74,7 +74,7 @@ libperf-y += stat-shadow.o
> >>>>  libperf-y += record.o
> >>>>  libperf-y += srcline.o
> >>>>  libperf-y += data.o
> >>>> -libperf-$(CONFIG_X86) += tsc.o
> >>>> +libperf-$(if $(CONFIG_X86)$(CONFIG_AUXTRACE),y) += tsc.o
> >>>
> >>> I think this is preferred/more clear:
> >>>
> >>> libperf-$(CONFIG_X86) += tsc.o
> >>> libperf-$(CONFIG_AUXTRACE) += tsc.o
> >>
> >> I tried that first but it doesn't work:
> >>
> >> util/tsc.o: In function `perf_time_to_tsc':
> >> /mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: multiple definition of `perf_time_to_tsc'
> >> util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: first defined here
> >> util/tsc.o: In function `tsc_to_perf_time':
> >> /mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: multiple definition of `tsc_to_perf_time'
> >> util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: first defined here
> >> make[3]: *** [util/libperf-in.o] Error 1
> >> make[2]: *** [util] Error 2
> >> make[1]: *** [libperf-in.o] Error 2
> >> make: *** [all] Error 2
> >>
> >> I will have a look at why, unless Jiri knows?
> >>
> > 
> > I'm now testing attached patch, does it fix it for you?
> 
> Yup!  Thanks Jiri! :-)
> 

cool, I'll send it out soon..

Arnaldo,
the tarpkg test is failing on me because of removed export.h
not sure I missed attached update in your patch queue

jirka


---
diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
index d01a0aad5a01..4d16e8af18b7 100644
--- a/tools/perf/MANIFEST
+++ b/tools/perf/MANIFEST
@@ -40,7 +40,6 @@ tools/include/asm-generic/bitops.h
 tools/include/linux/atomic.h
 tools/include/linux/bitops.h
 tools/include/linux/compiler.h
-tools/include/linux/export.h
 tools/include/linux/hash.h
 tools/include/linux/kernel.h
 tools/include/linux/list.h

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

* [PATCH] tools build: Allow duplicate objects in the object list
  2015-08-26  8:07         ` Jiri Olsa
@ 2015-08-26 13:01           ` Jiri Olsa
  2015-08-28  6:41             ` [tip:perf/core] " tip-bot for Jiri Olsa
  2015-08-26 13:08           ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Arnaldo Carvalho de Melo
  2015-08-28  6:41           ` [tip:perf/core] perf tools: Remove export.h from MANIFEST tip-bot for Jiri Olsa
  2 siblings, 1 reply; 14+ messages in thread
From: Jiri Olsa @ 2015-08-26 13:01 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: Arnaldo Carvalho de Melo, linux-kernel, Sukadev Bhattiprolu

On Wed, Aug 26, 2015 at 10:07:50AM +0200, Jiri Olsa wrote:

SNIP

> > >> util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: first defined here
> > >> make[3]: *** [util/libperf-in.o] Error 1
> > >> make[2]: *** [util] Error 2
> > >> make[1]: *** [libperf-in.o] Error 2
> > >> make: *** [all] Error 2
> > >>
> > >> I will have a look at why, unless Jiri knows?
> > >>
> > > 
> > > I'm now testing attached patch, does it fix it for you?
> > 
> > Yup!  Thanks Jiri! :-)
> > 
> 
> cool, I'll send it out soon..


---
It's sometimes useful to specify the object affiliation
to multiple config options like:
  libperf-$(CONFIG_X86) += tsc.o
  libperf-$(CONFIG_AUXTRACE) += tsc.o

while the object itself is linked only once. Adding the
support for this and ignoring duplicate objects in the
object list.

Suggested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Link: http://lkml.kernel.org/n/tip-ia1jyo9ktbqyc78ccs809j8w@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/build/Documentation/Build.txt | 1 +
 tools/build/Makefile.build          | 2 +-
 tools/build/tests/ex/Build          | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/build/Documentation/Build.txt b/tools/build/Documentation/Build.txt
index 00ad2d608727..aa5e092c4352 100644
--- a/tools/build/Documentation/Build.txt
+++ b/tools/build/Documentation/Build.txt
@@ -66,6 +66,7 @@ To follow the above example, the user provides following 'Build' files:
   ex/Build:
     ex-y += a.o
     ex-y += b.o
+    ex-y += b.o # duplicates in the lists are allowed
 
     libex-y += c.o
     libex-y += d.o
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index 8120af9c0341..0c5f485521d6 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -63,7 +63,7 @@ quiet_cmd_gen = GEN      $@
 # If there's nothing to link, create empty $@ object.
 quiet_cmd_ld_multi = LD       $@
       cmd_ld_multi = $(if $(strip $(obj-y)),\
-		       $(LD) -r -o $@ $(obj-y),rm -f $@; $(AR) rcs $@)
+		       $(LD) -r -o $@  $(filter $(obj-y),$^),rm -f $@; $(AR) rcs $@)
 
 # Build rules
 $(OUTPUT)%.o: %.c FORCE
diff --git a/tools/build/tests/ex/Build b/tools/build/tests/ex/Build
index 70d876237c57..429c7d452101 100644
--- a/tools/build/tests/ex/Build
+++ b/tools/build/tests/ex/Build
@@ -1,6 +1,7 @@
 ex-y += ex.o
 ex-y += a.o
 ex-y += b.o
+ex-y += b.o
 ex-y += empty/
 ex-y += empty2/
 
-- 
2.4.3


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

* Re: [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts
  2015-08-26  8:07         ` Jiri Olsa
  2015-08-26 13:01           ` [PATCH] tools build: Allow duplicate objects in the object list Jiri Olsa
@ 2015-08-26 13:08           ` Arnaldo Carvalho de Melo
  2015-08-28  6:41           ` [tip:perf/core] perf tools: Remove export.h from MANIFEST tip-bot for Jiri Olsa
  2 siblings, 0 replies; 14+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-08-26 13:08 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: Adrian Hunter, linux-kernel, Sukadev Bhattiprolu

Em Wed, Aug 26, 2015 at 10:07:50AM +0200, Jiri Olsa escreveu:
> On Wed, Aug 26, 2015 at 10:27:09AM +0300, Adrian Hunter wrote:
> > On 26/08/15 10:25, Jiri Olsa wrote:
> > > On Wed, Aug 26, 2015 at 09:57:13AM +0300, Adrian Hunter wrote:
> > >> On 25/08/15 18:30, Arnaldo Carvalho de Melo wrote:
> > >>> Em Tue, Aug 25, 2015 at 01:42:27PM +0300, Adrian Hunter escreveu:
> > >>>> It is theoretically possible to process perf.data files created on
> > >>>> x86 and that contain Intel PT or Intel BTS data, on any other
> > >>>> architecture, which is why it is possible for there to be build
> > >>>> errors on powerpc caused by pt/bts.
> > >>>>
> > >>>> The errors were:
> > >>>>
> > >>>> 	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
> > >>>> 	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
> > >>>> 	   switch (insn->immediate.nbytes) {
> > >>>> 	   ^
> > >>>> 	cc1: all warnings being treated as errors
> > >>>>
> > >>>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
> > >>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
> > >>>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
> > >>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
> > >>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
> > >>>> 	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
> > >>>> 	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'
> > >>>>
> > >>>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> > >>>> ---
> > >>>>  tools/perf/util/Build                                    | 2 +-
> > >>>>  tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
> > >>>>  2 files changed, 4 insertions(+), 1 deletion(-)
> > >>>>
> > >>>> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> > >>>> index e912856cc4e5..8ae31e5131ee 100644
> > >>>> --- a/tools/perf/util/Build
> > >>>> +++ b/tools/perf/util/Build
> > >>>> @@ -74,7 +74,7 @@ libperf-y += stat-shadow.o
> > >>>>  libperf-y += record.o
> > >>>>  libperf-y += srcline.o
> > >>>>  libperf-y += data.o
> > >>>> -libperf-$(CONFIG_X86) += tsc.o
> > >>>> +libperf-$(if $(CONFIG_X86)$(CONFIG_AUXTRACE),y) += tsc.o
> > >>>
> > >>> I think this is preferred/more clear:
> > >>>
> > >>> libperf-$(CONFIG_X86) += tsc.o
> > >>> libperf-$(CONFIG_AUXTRACE) += tsc.o
> > >>
> > >> I tried that first but it doesn't work:
> > >>
> > >> util/tsc.o: In function `perf_time_to_tsc':
> > >> /mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: multiple definition of `perf_time_to_tsc'
> > >> util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:7: first defined here
> > >> util/tsc.o: In function `tsc_to_perf_time':
> > >> /mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: multiple definition of `tsc_to_perf_time'
> > >> util/tsc.o:/mnt/ssd/ahunter/git/linux-perf/tools/perf/util/tsc.c:18: first defined here
> > >> make[3]: *** [util/libperf-in.o] Error 1
> > >> make[2]: *** [util] Error 2
> > >> make[1]: *** [libperf-in.o] Error 2
> > >> make: *** [all] Error 2
> > >>
> > >> I will have a look at why, unless Jiri knows?
> > >>
> > > 
> > > I'm now testing attached patch, does it fix it for you?
> > 
> > Yup!  Thanks Jiri! :-)
> > 
> 
> cool, I'll send it out soon..
> 
> Arnaldo,
> the tarpkg test is failing on me because of removed export.h
> not sure I missed attached update in your patch queue

Thanks, applying, strange this remained there :-\
 
> jirka
> 
> 
> ---
> diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
> index d01a0aad5a01..4d16e8af18b7 100644
> --- a/tools/perf/MANIFEST
> +++ b/tools/perf/MANIFEST
> @@ -40,7 +40,6 @@ tools/include/asm-generic/bitops.h
>  tools/include/linux/atomic.h
>  tools/include/linux/bitops.h
>  tools/include/linux/compiler.h
> -tools/include/linux/export.h
>  tools/include/linux/hash.h
>  tools/include/linux/kernel.h
>  tools/include/linux/list.h


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

* [tip:perf/core] perf tools: Remove export.h from MANIFEST
  2015-08-26  8:07         ` Jiri Olsa
  2015-08-26 13:01           ` [PATCH] tools build: Allow duplicate objects in the object list Jiri Olsa
  2015-08-26 13:08           ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Arnaldo Carvalho de Melo
@ 2015-08-28  6:41           ` tip-bot for Jiri Olsa
  2 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-08-28  6:41 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: mingo, jolsa, linux-kernel, hpa, jolsa, acme, adrian.hunter,
	sukadev, tglx

Commit-ID:  18b9a05868391e8f617febb4528bc1765dc921cf
Gitweb:     http://git.kernel.org/tip/18b9a05868391e8f617febb4528bc1765dc921cf
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Wed, 26 Aug 2015 10:07:50 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 26 Aug 2015 10:34:57 -0300

perf tools: Remove export.h from MANIFEST

We don't carry an export.h wrapper anymore, remove it from the MANIFEST
file to avoid breaking the make perf-tar targets.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20150826080750.GD22670@krava.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/MANIFEST | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/perf/MANIFEST b/tools/perf/MANIFEST
index f31f15a..af009bd 100644
--- a/tools/perf/MANIFEST
+++ b/tools/perf/MANIFEST
@@ -41,7 +41,6 @@ tools/include/asm-generic/bitops.h
 tools/include/linux/atomic.h
 tools/include/linux/bitops.h
 tools/include/linux/compiler.h
-tools/include/linux/export.h
 tools/include/linux/hash.h
 tools/include/linux/kernel.h
 tools/include/linux/list.h

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

* [tip:perf/core] tools build: Allow duplicate objects in the object list
  2015-08-26 13:01           ` [PATCH] tools build: Allow duplicate objects in the object list Jiri Olsa
@ 2015-08-28  6:41             ` tip-bot for Jiri Olsa
  0 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Jiri Olsa @ 2015-08-28  6:41 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, acme, jolsa, adrian.hunter, mingo, acme, tglx,
	jolsa, sukadev

Commit-ID:  0bdede8a3e4ff7710622a2e6713d04b3243c24a8
Gitweb:     http://git.kernel.org/tip/0bdede8a3e4ff7710622a2e6713d04b3243c24a8
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Wed, 26 Aug 2015 15:01:03 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 26 Aug 2015 10:34:58 -0300

tools build: Allow duplicate objects in the object list

It's sometimes useful to specify the object affiliation to multiple
config options like:

  libperf-$(CONFIG_X86) += tsc.o
  libperf-$(CONFIG_AUXTRACE) += tsc.o

while the object itself is linked only once. Adding the support for this
and ignoring duplicate objects in the object list.

Suggested-by: Arnaldo Carvalho de Melo <acme@kernel.org>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Link: http://lkml.kernel.org/r/20150826130103.GF22670@krava.redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/build/Documentation/Build.txt | 1 +
 tools/build/Makefile.build          | 2 +-
 tools/build/tests/ex/Build          | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/build/Documentation/Build.txt b/tools/build/Documentation/Build.txt
index 00ad2d6..aa5e092 100644
--- a/tools/build/Documentation/Build.txt
+++ b/tools/build/Documentation/Build.txt
@@ -66,6 +66,7 @@ To follow the above example, the user provides following 'Build' files:
   ex/Build:
     ex-y += a.o
     ex-y += b.o
+    ex-y += b.o # duplicates in the lists are allowed
 
     libex-y += c.o
     libex-y += d.o
diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build
index 8120af9..0c5f485 100644
--- a/tools/build/Makefile.build
+++ b/tools/build/Makefile.build
@@ -63,7 +63,7 @@ quiet_cmd_gen = GEN      $@
 # If there's nothing to link, create empty $@ object.
 quiet_cmd_ld_multi = LD       $@
       cmd_ld_multi = $(if $(strip $(obj-y)),\
-		       $(LD) -r -o $@ $(obj-y),rm -f $@; $(AR) rcs $@)
+		       $(LD) -r -o $@  $(filter $(obj-y),$^),rm -f $@; $(AR) rcs $@)
 
 # Build rules
 $(OUTPUT)%.o: %.c FORCE
diff --git a/tools/build/tests/ex/Build b/tools/build/tests/ex/Build
index 70d8762..429c7d4 100644
--- a/tools/build/tests/ex/Build
+++ b/tools/build/tests/ex/Build
@@ -1,6 +1,7 @@
 ex-y += ex.o
 ex-y += a.o
 ex-y += b.o
+ex-y += b.o
 ex-y += empty/
 ex-y += empty2/
 

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

* [PATCH V2] perf tools: Fix build on powerpc broken by pt/bts
  2015-08-25 15:30 ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Arnaldo Carvalho de Melo
  2015-08-26  6:57   ` Adrian Hunter
  2015-08-26  7:06   ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Jiri Olsa
@ 2015-08-31 18:39   ` Adrian Hunter
  2015-09-01  8:30     ` [tip:perf/urgent] perf tools: Fix build on powerpc broken by pt/ bts tip-bot for Adrian Hunter
  2 siblings, 1 reply; 14+ messages in thread
From: Adrian Hunter @ 2015-08-31 18:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Jiri Olsa, Sukadev Bhattiprolu, Wang Nan, lizefan,
	pi3orama

It is theoretically possible to process perf.data files created on
x86 and that contain Intel PT or Intel BTS data, on any other
architecture, which is why it is possible for there to be build
errors on powerpc caused by pt/bts.

The errors were:

	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
	   switch (insn->immediate.nbytes) {
	   ^
	cc1: all warnings being treated as errors

	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---


Changes in V2:

	Use:
		libperf-$(CONFIG_X86) += tsc.o
		libperf-$(CONFIG_AUXTRACE) += tsc.o

	instead of:

		libperf-$(if $(CONFIG_X86)$(CONFIG_AUXTRACE),y) += tsc.o


 tools/perf/util/Build                                    | 1 +
 tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index e912856cc4e5..e79e4522368a 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -75,6 +75,7 @@ libperf-y += record.o
 libperf-y += srcline.o
 libperf-y += data.o
 libperf-$(CONFIG_X86) += tsc.o
+libperf-$(CONFIG_AUXTRACE) += tsc.o
 libperf-y += cloexec.o
 libperf-y += thread-stack.o
 libperf-$(CONFIG_AUXTRACE) += auxtrace.o
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
index 9e4eb8fcd559..d23138c06665 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
@@ -146,6 +146,9 @@ static void intel_pt_insn_decoder(struct insn *insn,
 		case 4:
 			intel_pt_insn->rel = bswap_32(insn->immediate.value);
 			break;
+		default:
+			intel_pt_insn->rel = 0;
+			break;
 		}
 #else
 		intel_pt_insn->rel = insn->immediate.value;
-- 
1.9.1


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

* [tip:perf/urgent] perf tools: Fix build on powerpc broken by pt/ bts
  2015-08-31 18:39   ` [PATCH V2] " Adrian Hunter
@ 2015-09-01  8:30     ` tip-bot for Adrian Hunter
  0 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Adrian Hunter @ 2015-09-01  8:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: tglx, mingo, acme, lizefan, hpa, wangnan0, linux-kernel, sukadev,
	adrian.hunter, jolsa

Commit-ID:  97db62062ac76e314c8bda4dc5b63f0ea906d15f
Gitweb:     http://git.kernel.org/tip/97db62062ac76e314c8bda4dc5b63f0ea906d15f
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Mon, 31 Aug 2015 21:39:44 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 31 Aug 2015 15:47:33 -0300

perf tools: Fix build on powerpc broken by pt/bts

It is theoretically possible to process perf.data files created on x86
and that contain Intel PT or Intel BTS data, on any other architecture,
which is why it is possible for there to be build errors on powerpc
caused by pt/bts.

The errors were:

	util/intel-pt-decoder/intel-pt-insn-decoder.c: In function ‘intel_pt_insn_decoder’:
	util/intel-pt-decoder/intel-pt-insn-decoder.c:138:3: error: switch missing default case [-Werror=switch-default]
	   switch (insn->immediate.nbytes) {
	   ^
	cc1: all warnings being treated as errors

	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
	sources/linux-acme.git/tools/perf/util/intel-pt.c:871: undefined reference to `tsc_to_perf_time'
	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_sample':
	sources/linux-acme.git/tools/perf/util/intel-pt.c:915: undefined reference to `tsc_to_perf_time'
	sources/linux-acme.git/tools/perf/util/intel-pt.c:962: undefined reference to `tsc_to_perf_time'
	linux-acme.git/tools/perf/perf-obj/libperf.a(libperf-in.o): In function `intel_pt_process_event':
	sources/linux-acme.git/tools/perf/util/intel-pt.c:1454: undefined reference to `perf_time_to_tsc'

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Link: http://lkml.kernel.org/r/1441046384-28663-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/Build                                    | 1 +
 tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index e912856..e79e452 100644
--- a/tools/perf/util/Build
+++ b/tools/perf/util/Build
@@ -75,6 +75,7 @@ libperf-y += record.o
 libperf-y += srcline.o
 libperf-y += data.o
 libperf-$(CONFIG_X86) += tsc.o
+libperf-$(CONFIG_AUXTRACE) += tsc.o
 libperf-y += cloexec.o
 libperf-y += thread-stack.o
 libperf-$(CONFIG_AUXTRACE) += auxtrace.o
diff --git a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
index 9e4eb8f..d23138c 100644
--- a/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
+++ b/tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
@@ -146,6 +146,9 @@ static void intel_pt_insn_decoder(struct insn *insn,
 		case 4:
 			intel_pt_insn->rel = bswap_32(insn->immediate.value);
 			break;
+		default:
+			intel_pt_insn->rel = 0;
+			break;
 		}
 #else
 		intel_pt_insn->rel = insn->immediate.value;

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

end of thread, other threads:[~2015-09-01  8:31 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-25 10:42 [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Adrian Hunter
2015-08-25 10:42 ` [PATCH 2/2] perf tools: Make NO_AUXTRACE default for non-x86 architectures Adrian Hunter
2015-08-25 15:30 ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Arnaldo Carvalho de Melo
2015-08-26  6:57   ` Adrian Hunter
2015-08-26  7:25     ` Jiri Olsa
2015-08-26  7:27       ` Adrian Hunter
2015-08-26  8:07         ` Jiri Olsa
2015-08-26 13:01           ` [PATCH] tools build: Allow duplicate objects in the object list Jiri Olsa
2015-08-28  6:41             ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-08-26 13:08           ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Arnaldo Carvalho de Melo
2015-08-28  6:41           ` [tip:perf/core] perf tools: Remove export.h from MANIFEST tip-bot for Jiri Olsa
2015-08-26  7:06   ` [PATCH 1/2] perf tools: Fix build on powerpc broken by pt/bts Jiri Olsa
2015-08-31 18:39   ` [PATCH V2] " Adrian Hunter
2015-09-01  8:30     ` [tip:perf/urgent] perf tools: Fix build on powerpc broken by pt/ bts tip-bot for Adrian Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).