1 FIXME: regs_load.S need complete x32 ABI support; now it will just compile, but tests won't run properly.
2 --- linux-4.7/tools/scripts/Makefile.arch~ 2015-02-09 03:54:22.000000000 +0100
3 +++ linux-4.7/tools/scripts/Makefile.arch 2015-04-11 12:17:45.107911011 +0200
7 LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
8 +ILP32 := $(shell echo __ILP32__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
9 +X86_64 := $(shell echo __x86_64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
15 +ifeq ($(x86_64)_$(ILP32), 1_1)
20 --- linux-4.8/tools/perf/Makefile.config~ 2015-04-11 12:12:31.000000000 +0200
21 +++ linux-4.8/tools/perf/Makefile.config 2015-04-11 12:19:05.011244885 +0200
23 LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
26 + ifeq (${IS_X32_BIT}, 1)
27 + CFLAGS += -DHAVE_ARCH_X32_SUPPORT
28 + ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
29 + LIBUNWIND_LIBS = -lunwind-x86_64 -llzma -lunwind
34 --- linux-5.5/tools/perf/arch/x86/tests/regs_load.S.orig 2020-01-27 20:52:02.819752368 +0100
35 +++ linux-5.5/tools/perf/arch/x86/tests/regs_load.S 2020-01-27 20:56:05.908435444 +0100
37 SYM_FUNC_END(perf_regs_load)
39 SYM_FUNC_START(perf_regs_load)
41 +#ifdef HAVE_ARCH_X32_SUPPORT
52 +#ifdef HAVE_ARCH_X32_SUPPORT
59 --- linux-3.19/tools/perf/bench/sched-messaging.c~ 2015-02-09 03:54:22.000000000 +0100
60 +++ linux-3.19/tools/perf/bench/sched-messaging.c 2015-04-11 12:33:22.587917365 +0200
62 printf("# %d groups == %d %s run\n\n",
63 num_groups, num_groups * 2 * num_fds,
64 thread_mode ? "threads" : "processes");
65 +#if defined(__x86_64__) && !defined(__ILP32__)
66 printf(" %14s: %lu.%03lu [sec]\n", "Total time",
68 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
70 + printf(" %14s: %llu.%03llu [sec]\n", "Total time",
72 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
75 case BENCH_FORMAT_SIMPLE:
76 +#if defined(__x86_64__) && !defined(__ILP32__)
77 printf("%lu.%03lu\n", diff.tv_sec,
78 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
80 + printf("%llu.%03llu\n", diff.tv_sec,
81 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
85 /* reaching here is something disaster */
86 --- linux-3.19/tools/perf/bench/sched-pipe.c~ 2015-02-09 03:54:22.000000000 +0100
87 +++ linux-3.19/tools/perf/bench/sched-pipe.c 2015-04-11 12:34:32.727917841 +0200
89 result_usec = diff.tv_sec * 1000000;
90 result_usec += diff.tv_usec;
92 +#if defined(__x86_64__) && !defined(__ILP32__)
93 printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
95 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
97 + printf(" %14s: %llu.%03llu [sec]\n\n", "Total time",
99 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
102 printf(" %14lf usecs/op\n",
103 (double)result_usec / (double)loops);
107 case BENCH_FORMAT_SIMPLE:
108 +#if defined(__x86_64__) && !defined(__ILP32__)
109 printf("%lu.%03lu\n",
111 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
113 + printf("%llu.%03llu\n",
115 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
120 --- linux-3.19/tools/perf/builtin-kvm.c~ 2015-02-09 03:54:22.000000000 +0100
121 +++ linux-3.19/tools/perf/builtin-kvm.c 2015-04-11 12:36:00.511251770 +0200
123 gettimeofday(&tv, NULL);
124 if (localtime_r(&tv.tv_sec, <ime)) {
125 strftime(date, sizeof(date), "%H:%M:%S", <ime);
126 +#if defined(__x86_64__) && !defined(__ILP32__)
127 pr_info("%s.%06ld", date, tv.tv_usec);
129 + pr_info("%s.%06lld", date, tv.tv_usec);
132 pr_info("00:00:00.000000");
134 --- linux-5.1/tools/perf/arch/x86/util/unwind-libunwind.c.orig 2019-05-06 02:42:58.000000000 +0200
135 +++ linux-5.1/tools/perf/arch/x86/util/unwind-libunwind.c 2019-05-18 12:32:31.916685600 +0200
137 #include "../../util/debug.h"
140 -#ifdef HAVE_ARCH_X86_64_SUPPORT
141 +#if defined(HAVE_ARCH_X86_64_SUPPORT) || defined(HAVE_ARCH_X32_SUPPORT)
142 int LIBUNWIND__ARCH_REG_ID(int regnum)