1 FIXME: verify x32 ABI support in regs_load.S
2 --- linux-5.11/tools/scripts/Makefile.arch.orig 2021-02-25 19:40:18.181160970 +0100
3 +++ linux-5.11/tools/scripts/Makefile.arch 2021-02-25 19:46:07.599314457 +0100
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-5.11/tools/perf/Makefile.config.orig 2021-02-25 19:40:18.184494476 +0100
21 +++ linux-5.11/tools/perf/Makefile.config 2021-02-25 19:48:36.007024754 +0100
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.11/tools/perf/arch/x86/tests/regs_load.S.orig 2021-02-14 23:32:24.000000000 +0100
35 +++ linux-5.11/tools/perf/arch/x86/tests/regs_load.S 2021-02-25 21:46:57.425008548 +0100
38 SYM_FUNC_END(perf_regs_load)
40 +#ifdef(HAVE_ARCH_X32_SUPPORT)
41 +SYM_FUNC_START(perf_regs_load)
50 + leaq 8(%rsp), %rax /* exclude this call. */
56 + movq $0, FLAGS(%edi)
66 + movq %r10, R10(%edi)
67 + movq %r11, R11(%edi)
68 + movq %r12, R12(%edi)
69 + movq %r13, R13(%edi)
70 + movq %r14, R14(%edi)
71 + movq %r15, R15(%edi)
73 +SYM_FUNC_END(perf_regs_load)
75 SYM_FUNC_START(perf_regs_load)
80 SYM_FUNC_END(perf_regs_load)
85 * We need to provide note.GNU-stack section, saying that we want
86 --- linux-3.19/tools/perf/bench/sched-messaging.c~ 2015-02-09 03:54:22.000000000 +0100
87 +++ linux-3.19/tools/perf/bench/sched-messaging.c 2015-04-11 12:33:22.587917365 +0200
89 printf("# %d groups == %d %s run\n\n",
90 num_groups, num_groups * 2 * num_fds,
91 thread_mode ? "threads" : "processes");
92 - printf(" %14s: %lu.%03lu [sec]\n", "Total time",
94 - (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
95 + printf(" %14s: %llu.%03llu [sec]\n", "Total time",
96 + (unsigned long long) diff.tv_sec,
97 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
99 case BENCH_FORMAT_SIMPLE:
100 - printf("%lu.%03lu\n", diff.tv_sec,
101 - (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
102 + printf("%llu.%03llu\n", (unsigned long long) diff.tv_sec,
103 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
106 /* reaching here is something disaster */
107 --- linux-5.11/tools/perf/bench/sched-pipe.c.orig 2021-02-14 23:32:24.000000000 +0100
108 +++ linux-5.11/tools/perf/bench/sched-pipe.c 2021-02-25 20:38:57.380710973 +0100
110 result_usec = diff.tv_sec * USEC_PER_SEC;
111 result_usec += diff.tv_usec;
113 - printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
115 - (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
116 + printf(" %14s: %llu.%03llu [sec]\n\n", "Total time",
117 + (unsigned long long) diff.tv_sec,
118 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
120 printf(" %14lf usecs/op\n",
121 (double)result_usec / (double)loops);
125 case BENCH_FORMAT_SIMPLE:
126 - printf("%lu.%03lu\n",
128 - (unsigned long) (diff.tv_usec / USEC_PER_MSEC));
129 + printf("%llu.%03llu\n",
130 + (unsigned long long) diff.tv_sec,
131 + (unsigned long long) (diff.tv_usec / USEC_PER_MSEC));
135 --- linux-3.19/tools/perf/builtin-kvm.c~ 2015-02-09 03:54:22.000000000 +0100
136 +++ linux-3.19/tools/perf/builtin-kvm.c 2015-04-11 12:36:00.511251770 +0200
138 gettimeofday(&tv, NULL);
139 if (localtime_r(&tv.tv_sec, <ime)) {
140 strftime(date, sizeof(date), "%H:%M:%S", <ime);
141 - pr_info("%s.%06ld", date, tv.tv_usec);
142 + pr_info("%s.%06lld", date, (long long) tv.tv_usec);
144 pr_info("00:00:00.000000");
146 --- linux-5.11/tools/perf/arch/x86/util/unwind-libunwind.c.orig 2021-02-25 20:23:15.561804956 +0100
147 +++ linux-5.11/tools/perf/arch/x86/util/unwind-libunwind.c 2021-02-25 20:39:56.170430285 +0100
149 #include "../../util/unwind.h"
152 -#ifdef HAVE_ARCH_X86_64_SUPPORT
153 +#if defined(HAVE_ARCH_X86_64_SUPPORT) || defined(HAVE_ARCH_X32_SUPPORT)
154 int LIBUNWIND__ARCH_REG_ID(int regnum)