From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758903AbcDAHR0 (ORCPT ); Fri, 1 Apr 2016 03:17:26 -0400 Received: from mga02.intel.com ([134.134.136.20]:33259 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753501AbcDAHRZ (ORCPT ); Fri, 1 Apr 2016 03:17:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,426,1455004800"; d="scan'208";a="77127293" Subject: Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 To: He Kuang , acme@kernel.org References: <1459482572-129494-1-git-send-email-hekuang@huawei.com> Cc: peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, jpoimboe@redhat.com, sukadev@linux.vnet.ibm.com, eranian@google.com, wangnan0@huawei.com, linux-kernel@vger.kernel.org From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <56FE1FA5.4060206@intel.com> Date: Fri, 1 Apr 2016 10:13:41 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1459482572-129494-1-git-send-email-hekuang@huawei.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/04/16 06:49, He Kuang wrote: > Build errors on aarch64: > > libperf.a(libperf-in.o): In function `convert_timestamp': > util/jitdump.c:356: undefined reference to `tsc_to_perf_time' > collect2: error: ld returned 1 exit status > Makefile.perf:347: recipe for target 'perf' failed > make[1]: *** [perf] Error 1 > Makefile:68: recipe for target 'all' failed > make: *** [all] Error 2 Sorry about that :-( > > Since tsc conversion functions were moved out from arch dir, move > 'tsc.h' out from x86 dir to make it possible to compile for other archs. So this is the case where data can be collected on x86 and then processed on another arch. Originally, it wasn't wanted to be compiled in: http://marc.info/?l=linux-kernel&m=142445842131011 But that has been causing problems: http://marc.info/?l=linux-kernel&m=144109627003194 So this seems better. > > Signed-off-by: He Kuang Acked-by: Adrian Hunter > --- > tools/perf/arch/x86/util/tsc.c | 1 - > tools/perf/arch/x86/util/tsc.h | 17 ----------------- > tools/perf/util/Build | 3 +-- > tools/perf/util/tsc.h | 11 ++++++++++- > 4 files changed, 11 insertions(+), 21 deletions(-) > delete mode 100644 tools/perf/arch/x86/util/tsc.h > > diff --git a/tools/perf/arch/x86/util/tsc.c b/tools/perf/arch/x86/util/tsc.c > index 70ff7c1..357f1b1 100644 > --- a/tools/perf/arch/x86/util/tsc.c > +++ b/tools/perf/arch/x86/util/tsc.c > @@ -7,7 +7,6 @@ > #include > #include "../../util/debug.h" > #include "../../util/tsc.h" > -#include "tsc.h" > > int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc, > struct perf_tsc_conversion *tc) > diff --git a/tools/perf/arch/x86/util/tsc.h b/tools/perf/arch/x86/util/tsc.h > deleted file mode 100644 > index 2edc4d3..0000000 > --- a/tools/perf/arch/x86/util/tsc.h > +++ /dev/null > @@ -1,17 +0,0 @@ > -#ifndef TOOLS_PERF_ARCH_X86_UTIL_TSC_H__ > -#define TOOLS_PERF_ARCH_X86_UTIL_TSC_H__ > - > -#include > - > -struct perf_tsc_conversion { > - u16 time_shift; > - u32 time_mult; > - u64 time_zero; > -}; > - > -struct perf_event_mmap_page; > - > -int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc, > - struct perf_tsc_conversion *tc); > - > -#endif /* TOOLS_PERF_ARCH_X86_UTIL_TSC_H__ */ > diff --git a/tools/perf/util/Build b/tools/perf/util/Build > index da48fd8..85ceff3 100644 > --- a/tools/perf/util/Build > +++ b/tools/perf/util/Build > @@ -69,8 +69,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 += tsc.o > libperf-y += cloexec.o > libperf-y += thread-stack.o > libperf-$(CONFIG_AUXTRACE) += auxtrace.o > diff --git a/tools/perf/util/tsc.h b/tools/perf/util/tsc.h > index 280ddc0..d5b11e2 100644 > --- a/tools/perf/util/tsc.h > +++ b/tools/perf/util/tsc.h > @@ -4,7 +4,16 @@ > #include > > #include "event.h" > -#include "../arch/x86/util/tsc.h" > + > +struct perf_tsc_conversion { > + u16 time_shift; > + u32 time_mult; > + u64 time_zero; > +}; > +struct perf_event_mmap_page; > + > +int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc, > + struct perf_tsc_conversion *tc); > > u64 perf_time_to_tsc(u64 ns, struct perf_tsc_conversion *tc); > u64 tsc_to_perf_time(u64 cyc, struct perf_tsc_conversion *tc); >