perf tools: Fix cross compiling error
PATCH 1/1 perf tools: Fix cross compiling error
Cross compiling perf to other platform failed due to missing symbol:
...
AR /pathofperf/libperf.a LD /pathofperf/tests/perf-in.o LD /pathofperf/perf-in.o LINK /pathofperf/perf
/pathofperf/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':/usr/src/kernel/tools/perf/util/intel-pt.c:899: undefined reference to tsc_to_perf_time' /pathofperf/libperf.a(libperf-in.o): In function intel_pt_synth_transaction_sample':/usr/src/kernel/tools/perf/util/intel-pt.c:992: undefined reference to tsc_to_perf_time' /pathofperf/libperf.a(libperf-in.o): In function intel_pt_synth_instruction_sample':/usr/src/kernel/tools/perf/util/intel-pt.c:943: undefined reference to `tsc_to_perf_time'
...
This is because we allow newly introduced intel-pt-decoder to be compiled to not only X86, but tsc.c which required by it is compiled for x86 only.
This patch fix the compiling error by allow tsc.c to be compiled if CONFIG_AUXTRACE is set, no matter the target platform.
--- tools/perf/util/Build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -1
@@ -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-$(CONFIG_AUXTRACE) += tsc.o libperf-y += cloexec.o libperf-y += thread-stack.o libperf-$(CONFIG_AUXTRACE) += auxtrace.o
Signature · 1 line
1.8.3.4
Em Fri, Aug 28, 2015 at 12:54:02PM +0000, Wang Nan escreveu:
Quoted 15 lines
Cross compiling perf to other platform failed due to missing symbol:
...
AR /pathofperf/libperf.a LD /pathofperf/tests/perf-in.o LD /pathofperf/perf-in.o LINK /pathofperf/perf/pathofperf/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
/usr/src/kernel/tools/perf/util/intel-pt.c:899: undefined reference totsc_to_perf_time' /pathofperf/libperf.a(libperf-in.o): In functionintel_pt_synth_transaction_sample':/usr/src/kernel/tools/perf/util/intel-pt.c:992: undefined reference totsc_to_perf_time' /pathofperf/libperf.a(libperf-in.o): In functionintel_pt_synth_instruction_sample':/usr/src/kernel/tools/perf/util/intel-pt.c:943: undefined reference to `tsc_to_perf_time'
...
Quoted 6 lines
This is because we allow newly introduced intel-pt-decoder to be compiled to not only X86, but
tsc.cwhich required by it is compiled for x86 only.This patch fix the compiling error by allow
tsc.cto be compiled ifCONFIG_AUXTRACEis set, no matter the target platform.
There were some changes in this area, i.e. x86 needs tsc, and auxtrace as well, so both should express that via:
libperf-$(CONFIG_X86) += tsc.o
libperf-$(CONFIG_AUXTRACE) += tsc.o
Because on !x86 we want to process perf.data files containing Intel PT.
Adding Jiri and Adrian to the CC list.
- Arnaldo
Quoted 21 lines
Signed-off-by Wang Nan <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>--- tools/perf/util/Build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/Build +1
-1@@ -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-$(CONFIG_AUXTRACE) += tsc.o libperf-y += cloexec.o libperf-y += thread-stack.o libperf-$(CONFIG_AUXTRACE) += auxtrace.oSignature · 1 line
1.8.3.4
Quoted 41 lines · Arnaldo Carvalho de Melo
Em Fri, Aug 28, 2015 at 12:54:02PM +0000, Wang Nan escreveu:
Quoted 15 lines
Cross compiling perf to other platform failed due to missing symbol:
...
AR /pathofperf/libperf.a LD /pathofperf/tests/perf-in.o LD /pathofperf/perf-in.o LINK /pathofperf/perf/pathofperf/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
/usr/src/kernel/tools/perf/util/intel-pt.c:899: undefined reference totsc_to_perf_time' /pathofperf/libperf.a(libperf-in.o): In functionintel_pt_synth_transaction_sample':/usr/src/kernel/tools/perf/util/intel-pt.c:992: undefined reference totsc_to_perf_time' /pathofperf/libperf.a(libperf-in.o): In functionintel_pt_synth_instruction_sample':/usr/src/kernel/tools/perf/util/intel-pt.c:943: undefined reference to `tsc_to_perf_time'
...Quoted 6 lines
This is because we allow newly introduced intel-pt-decoder to be compiled to not only X86, but
tsc.cwhich required by it is compiled for x86 only.This patch fix the compiling error by allow
tsc.cto be compiled ifCONFIG_AUXTRACEis set, no matter the target platform.There were some changes in this area, i.e. x86 needs tsc, and auxtrace as well, so both should express that via:
libperf-$(CONFIG_X86) += tsc.o
libperf-$(CONFIG_AUXTRACE) += tsc.oBecause on !x86 we want to process perf.data files containing Intel PT.
Adding Jiri and Adrian to the CC list.
- Arnaldo
Quoted 6 lines
Signed-off-by Wang Nan <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>--- tools/perf/util/Build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 10 lines
tools/perf/util/Build libperf-y += stat-shadow.o · line 77
Quoted 10 lines
tools/perf/util/Build +1
-1@@ -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-$(CONFIG_AUXTRACE) += tsc.o
hum, didn't you guys want to change it like this:
libperf-$(CONFIG_X86) += tsc.o libperf-$(CONFIG_AUXTRACE) += tsc.o
thats why I made that fix for duplicates objects in obj-y:
0bdede8a3e4f tools build: Allow duplicate objects in the object list
jirka
Adrian Hunter
reviewerQuoted 55 lines · Jiri Olsa
Quoted 41 lines · Arnaldo Carvalho de Melo
Em Fri, Aug 28, 2015 at 12:54:02PM +0000, Wang Nan escreveu:
Quoted 15 lines
Cross compiling perf to other platform failed due to missing symbol:
...
AR /pathofperf/libperf.a LD /pathofperf/tests/perf-in.o LD /pathofperf/perf-in.o LINK /pathofperf/perf/pathofperf/libperf.a(libperf-in.o): In function `intel_pt_synth_branch_sample':
/usr/src/kernel/tools/perf/util/intel-pt.c:899: undefined reference totsc_to_perf_time' /pathofperf/libperf.a(libperf-in.o): In functionintel_pt_synth_transaction_sample':/usr/src/kernel/tools/perf/util/intel-pt.c:992: undefined reference totsc_to_perf_time' /pathofperf/libperf.a(libperf-in.o): In functionintel_pt_synth_instruction_sample':/usr/src/kernel/tools/perf/util/intel-pt.c:943: undefined reference to `tsc_to_perf_time'
...Quoted 6 lines
This is because we allow newly introduced intel-pt-decoder to be compiled to not only X86, but
tsc.cwhich required by it is compiled for x86 only.This patch fix the compiling error by allow
tsc.cto be compiled ifCONFIG_AUXTRACEis set, no matter the target platform.There were some changes in this area, i.e. x86 needs tsc, and auxtrace as well, so both should express that via:
libperf-$(CONFIG_X86) += tsc.o
libperf-$(CONFIG_AUXTRACE) += tsc.oBecause on !x86 we want to process perf.data files containing Intel PT.
Adding Jiri and Adrian to the CC list.
- Arnaldo
Quoted 6 lines
Signed-off-by Wang Nan <[email protected]>Cc Arnaldo Carvalho de Melo <[email protected]>--- tools/perf/util/Build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 10 lines
tools/perf/util/Build libperf-y += stat-shadow.o · line 77
Quoted 10 lines
tools/perf/util/Build +1
-1@@ -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-$(CONFIG_AUXTRACE) += tsc.ohum, didn't you guys want to change it like this:
Quoted 5 lines
libperf-$(CONFIG_X86) += tsc.o libperf-$(CONFIG_AUXTRACE) += tsc.othats why I made that fix for duplicates objects in obj-y:
0bdede8a3e4ftools build: Allow duplicate objects in the object list
Yes. I need to send V2 of my original patch "perf tools: Fix build on powerpc broken by pt/bts". Will do shortly.