Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1368991 > unrolled thread
| Started by | He Kuang <hekuang@huawei.com> |
|---|---|
| First post | 2016-04-01 06:00 +0200 |
| Last post | 2016-04-01 15:50 +0200 |
| Articles | 6 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 He Kuang <hekuang@huawei.com> - 2016-04-01 06:00 +0200
Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 Adrian Hunter <adrian.hunter@intel.com> - 2016-04-01 09:20 +0200
Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-01 15:20 +0200
Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 Hekuang <hekuang@huawei.com> - 2016-04-01 15:30 +0200
Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-04-01 15:30 +0200
Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 Adrian Hunter <adrian.hunter@intel.com> - 2016-04-01 15:50 +0200
| From | He Kuang <hekuang@huawei.com> |
|---|---|
| Date | 2016-04-01 06:00 +0200 |
| Subject | [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 |
| Message-ID | <riYpz-6ZD-1@gated-at.bofh.it> |
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
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.
Signed-off-by: He Kuang <hekuang@huawei.com>
---
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 <linux/types.h>
#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 <linux/types.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);
-
-#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 <linux/types.h>
#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);
--
1.8.5.2
[toc] | [next] | [standalone]
| From | Adrian Hunter <adrian.hunter@intel.com> |
|---|---|
| Date | 2016-04-01 09:20 +0200 |
| Subject | Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 |
| Message-ID | <rj1x7-Xr-1@gated-at.bofh.it> |
| In reply to | #1368991 |
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 <hekuang@huawei.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> 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 <linux/types.h>
> #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 <linux/types.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);
> -
> -#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 <linux/types.h>
>
> #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);
>
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-04-01 15:20 +0200 |
| Subject | Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 |
| Message-ID | <rj79w-4RA-5@gated-at.bofh.it> |
| In reply to | #1368991 |
Em Fri, Apr 01, 2016 at 03:49:32AM +0000, He Kuang escreveu:
> 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
Got it, my cross-compile environment for aarch64 doesn't build jitdump.c
because it needs a package I haven't found in ubuntu:
config/Makefile:416: No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev
minimal-ubuntu-x-arm64: Ok
BTW, He, what environment do you use to build for arm64, is it a cross
compile one? Yocto?
- Arnaldo
> 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.
>
> Signed-off-by: He Kuang <hekuang@huawei.com>
> ---
> 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 <linux/types.h>
> #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 <linux/types.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);
> -
> -#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 <linux/types.h>
>
> #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);
> --
> 1.8.5.2
[toc] | [prev] | [next] | [standalone]
| From | Hekuang <hekuang@huawei.com> |
|---|---|
| Date | 2016-04-01 15:30 +0200 |
| Subject | Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 |
| Message-ID | <rj7jc-4UU-19@gated-at.bofh.it> |
| In reply to | #1369303 |
hi,
在 2016/4/1 21:13, Arnaldo Carvalho de Melo 写道:
> Em Fri, Apr 01, 2016 at 03:49:32AM +0000, He Kuang escreveu:
>> 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
> Got it, my cross-compile environment for aarch64 doesn't build jitdump.c
> because it needs a package I haven't found in ubuntu:
>
> config/Makefile:416: No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev
> minimal-ubuntu-x-arm64: Ok
>
> BTW, He, what environment do you use to build for arm64, is it a cross
> compile one? Yocto?
I use buildroot, though my colleague prefers yocto(oxygen).
In my environment, libcrypto is on.
... libcrypto: [ on ]
>
> - Arnaldo
>
>
>
>> 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.
>>
>> Signed-off-by: He Kuang <hekuang@huawei.com>
>> ---
>> 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 <linux/types.h>
>> #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 <linux/types.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);
>> -
>> -#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 <linux/types.h>
>>
>> #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);
>> --
>> 1.8.5.2
[toc] | [prev] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-04-01 15:30 +0200 |
| Subject | Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 |
| Message-ID | <rj7jc-4UU-27@gated-at.bofh.it> |
| In reply to | #1369303 |
Em Fri, Apr 01, 2016 at 10:13:12AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Apr 01, 2016 at 03:49:32AM +0000, He Kuang escreveu:
> > 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
>
> Got it, my cross-compile environment for aarch64 doesn't build jitdump.c
> because it needs a package I haven't found in ubuntu:
>
> config/Makefile:416: No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev
> minimal-ubuntu-x-arm64: Ok
>
> BTW, He, what environment do you use to build for arm64, is it a cross
> compile one? Yocto?
Adrian, BTW, Ok with this? I'm adding a:
Fixes: d3e58a3b8b3b ("perf jit: Add support for using TSC as a timestamp")
And would appreciate your Acked-by.
Thanks,
- Arnaldo
[toc] | [prev] | [next] | [standalone]
| From | Adrian Hunter <adrian.hunter@intel.com> |
|---|---|
| Date | 2016-04-01 15:50 +0200 |
| Subject | Re: [PATCH] perf tools: Fix build errors on tsc functions for archs other than x86 |
| Message-ID | <rj7Cx-53r-11@gated-at.bofh.it> |
| In reply to | #1369319 |
On 01/04/16 16:24, Arnaldo Carvalho de Melo wrote:
> Em Fri, Apr 01, 2016 at 10:13:12AM -0300, Arnaldo Carvalho de Melo escreveu:
>> Em Fri, Apr 01, 2016 at 03:49:32AM +0000, He Kuang escreveu:
>>> 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
>>
>> Got it, my cross-compile environment for aarch64 doesn't build jitdump.c
>> because it needs a package I haven't found in ubuntu:
>>
>> config/Makefile:416: No libcrypto.h found, disables jitted code injection, please install libssl-devel or libssl-dev
>> minimal-ubuntu-x-arm64: Ok
>>
>> BTW, He, what environment do you use to build for arm64, is it a cross
>> compile one? Yocto?
>
> Adrian, BTW, Ok with this? I'm adding a:
>
> Fixes: d3e58a3b8b3b ("perf jit: Add support for using TSC as a timestamp")
>
> And would appreciate your Acked-by.
Sure, already did in http://marc.info/?l=linux-kernel&m=145949505329251
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web