* [PATCH v2] perf tools: Fix cross compiling error
@ 2015-08-31 14:09 Wang Nan
2015-08-31 14:20 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: Wang Nan @ 2015-08-31 14:09 UTC (permalink / raw)
To: acme, jolsa, adrian.hunter
Cc: linux-kernel, lizefan, pi3orama, Wang Nan,
Arnaldo Carvalho de Melo
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.
Comment from Arnaldo:
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.
Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/Build | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/Build b/tools/perf/util/Build
index fd2f084..e712311 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
--
1.8.3.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] perf tools: Fix cross compiling error
2015-08-31 14:09 [PATCH v2] perf tools: Fix cross compiling error Wang Nan
@ 2015-08-31 14:20 ` Arnaldo Carvalho de Melo
2015-08-31 18:43 ` Adrian Hunter
0 siblings, 1 reply; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2015-08-31 14:20 UTC (permalink / raw)
To: Wang Nan; +Cc: jolsa, adrian.hunter, linux-kernel, lizefan, pi3orama
Em Mon, Aug 31, 2015 at 02:09:41PM +0000, Wang Nan escreveu:
> Cross compiling perf to other platform failed due to missing symbol:
Adrian, I think this one covers what you would resend, no? If it does,
can I have your Acked-by?
- Arnaldo
> ...
> 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.
>
> Comment from Arnaldo:
>
> 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.
>
> Signed-off-by: Wang Nan <wangnan0@huawei.com>
> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> tools/perf/util/Build | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
> index fd2f084..e712311 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
> --
> 1.8.3.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] perf tools: Fix cross compiling error
2015-08-31 14:20 ` Arnaldo Carvalho de Melo
@ 2015-08-31 18:43 ` Adrian Hunter
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Hunter @ 2015-08-31 18:43 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, Wang Nan; +Cc: jolsa, linux-kernel, lizefan, pi3orama
On 31/08/2015 5:20 p.m., Arnaldo Carvalho de Melo wrote:
> Em Mon, Aug 31, 2015 at 02:09:41PM +0000, Wang Nan escreveu:
>> Cross compiling perf to other platform failed due to missing symbol:
>
> Adrian, I think this one covers what you would resend, no? If it does,
> can I have your Acked-by?
There was another chunk as well so I sent V2 of the other patch.
>
> - Arnaldo
>
>> ...
>> 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.
>>
>> Comment from Arnaldo:
>>
>> 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.
>>
>> Signed-off-by: Wang Nan <wangnan0@huawei.com>
>> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
>> ---
>> tools/perf/util/Build | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/tools/perf/util/Build b/tools/perf/util/Build
>> index fd2f084..e712311 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
>> --
>> 1.8.3.4
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-08-31 18:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-31 14:09 [PATCH v2] perf tools: Fix cross compiling error Wang Nan
2015-08-31 14:20 ` Arnaldo Carvalho de Melo
2015-08-31 18:43 ` 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).