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)
19 --- linux-4.8/tools/perf/Makefile.config~ 2015-04-11 12:12:31.000000000 +0200
20 +++ linux-4.8/tools/perf/Makefile.config 2015-04-11 12:19:05.011244885 +0200
22 LIBUNWIND_LIBS = -lunwind-x86 -llzma -lunwind
25 + ifeq (${IS_X32_BIT}, 1)
26 + CFLAGS += -DHAVE_ARCH_X32_SUPPORT
27 + ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
28 + LIBUNWIND_LIBS = -lunwind-x86_64 -llzma -lunwind
33 --- linux-5.5/tools/perf/arch/x86/tests/regs_load.S.orig 2020-01-27 20:52:02.819752368 +0100
34 +++ linux-5.5/tools/perf/arch/x86/tests/regs_load.S 2020-01-27 20:56:05.908435444 +0100
36 SYM_FUNC_END(perf_regs_load)
38 SYM_FUNC_START(perf_regs_load)
40 +#ifdef HAVE_ARCH_X32_SUPPORT
51 +#ifdef HAVE_ARCH_X32_SUPPORT
58 --- linux-3.19/tools/perf/bench/sched-messaging.c~ 2015-02-09 03:54:22.000000000 +0100
59 +++ linux-3.19/tools/perf/bench/sched-messaging.c 2015-04-11 12:33:22.587917365 +0200
61 printf("# %d groups == %d %s run\n\n",
62 num_groups, num_groups * 2 * num_fds,
63 thread_mode ? "threads" : "processes");
64 +#if defined(__x86_64__) && !defined(__ILP32__)
65 printf(" %14s: %lu.%03lu [sec]\n", "Total time",
67 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
69 + printf(" %14s: %llu.%03llu [sec]\n", "Total time",
71 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
74 case BENCH_FORMAT_SIMPLE:
75 +#if defined(__x86_64__) && !defined(__ILP32__)
76 printf("%lu.%03lu\n", diff.tv_sec,
77 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
79 + printf("%llu.%03llu\n", diff.tv_sec,
80 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
84 /* reaching here is something disaster */
85 --- linux-3.19/tools/perf/bench/sched-pipe.c~ 2015-02-09 03:54:22.000000000 +0100
86 +++ linux-3.19/tools/perf/bench/sched-pipe.c 2015-04-11 12:34:32.727917841 +0200
88 result_usec = diff.tv_sec * 1000000;
89 result_usec += diff.tv_usec;
91 +#if defined(__x86_64__) && !defined(__ILP32__)
92 printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
94 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
96 + printf(" %14s: %llu.%03llu [sec]\n\n", "Total time",
98 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
101 printf(" %14lf usecs/op\n",
102 (double)result_usec / (double)loops);
106 case BENCH_FORMAT_SIMPLE:
107 +#if defined(__x86_64__) && !defined(__ILP32__)
108 printf("%lu.%03lu\n",
110 (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
112 + printf("%llu.%03llu\n",
114 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
119 --- linux-3.19/tools/perf/builtin-kvm.c~ 2015-02-09 03:54:22.000000000 +0100
120 +++ linux-3.19/tools/perf/builtin-kvm.c 2015-04-11 12:36:00.511251770 +0200
122 gettimeofday(&tv, NULL);
123 if (localtime_r(&tv.tv_sec, <ime)) {
124 strftime(date, sizeof(date), "%H:%M:%S", <ime);
125 +#if defined(__x86_64__) && !defined(__ILP32__)
126 pr_info("%s.%06ld", date, tv.tv_usec);
128 + pr_info("%s.%06lld", date, tv.tv_usec);
131 pr_info("00:00:00.000000");
133 --- linux-5.1/tools/perf/arch/x86/util/unwind-libunwind.c.orig 2019-05-06 02:42:58.000000000 +0200
134 +++ linux-5.1/tools/perf/arch/x86/util/unwind-libunwind.c 2019-05-18 12:32:31.916685600 +0200
136 #include "../../util/debug.h"
139 -#ifdef HAVE_ARCH_X86_64_SUPPORT
140 +#if defined(HAVE_ARCH_X86_64_SUPPORT) || defined(HAVE_ARCH_X32_SUPPORT)
141 int LIBUNWIND__ARCH_REG_ID(int regnum)