]> git.pld-linux.org Git - packages/kernel-tools.git/blob - x32.patch
5c0625480f40f40f33aaa4c521ed763b342908da
[packages/kernel-tools.git] / x32.patch
1 --- linux-3.19/tools/perf/config/Makefile.arch~ 2015-02-09 03:54:22.000000000 +0100
2 +++ linux-3.19/tools/perf/config/Makefile.arch  2015-04-11 12:17:45.107911011 +0200
3 @@ -24,8 +24,14 @@
4  ARCH ?= $(RAW_ARCH)
5  
6  LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
7 +ILP32 := $(shell echo __ILP32__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
8  ifeq ($(LP64), 1)
9    IS_64_BIT := 1
10  else
11    IS_64_BIT := 0
12  endif
13 +ifeq ($(ILP32), 1)
14 +  IS_X32_BIT := 1
15 +else
16 +  IS_X32_BIT := 0
17 +endif
18 --- linux-3.19/tools/perf/config/Makefile~      2015-04-11 12:12:31.000000000 +0200
19 +++ linux-3.19/tools/perf/config/Makefile       2015-04-11 12:19:05.011244885 +0200
20 @@ -28,6 +28,9 @@
21      LIBUNWIND_LIBS = -lunwind -lunwind-x86
22    endif
23    NO_PERF_REGS := 0
24 +  ifeq (${IS_X32_BIT}, 1)
25 +    CFLAGS += -DHAVE_ARCH_X32_SUPPORT
26 +  endif
27  endif
28  
29  ifeq ($(ARCH),arm)
30 --- linux-3.19/tools/perf/arch/x86/tests/regs_load.S~   2015-02-09 03:54:22.000000000 +0100
31 +++ linux-3.19/tools/perf/arch/x86/tests/regs_load.S    2015-04-11 12:21:07.717912384 +0200
32 @@ -62,14 +62,20 @@
33  ENDPROC(perf_regs_load)
34  #else
35  ENTRY(perf_regs_load)
36 -       push %edi
37 +#ifdef HAVE_ARCH_X32_SUPPORT
38 +#else
39 +       pushl %edi
40 +#endif
41         movl 8(%esp), %edi
42         movl %eax, AX(%edi)
43         movl %ebx, BX(%edi)
44         movl %ecx, CX(%edi)
45         movl %edx, DX(%edi)
46         movl %esi, SI(%edi)
47 -       pop %eax
48 +#ifdef HAVE_ARCH_X32_SUPPORT
49 +#else
50 +       popl %eax
51 +#endif
52         movl %eax, DI(%edi)
53         movl %ebp, BP(%edi)
54  
55 --- linux-3.19/arch/x86/include/uapi/asm/bitsperlong.h~ 2015-02-09 03:54:22.000000000 +0100
56 +++ linux-3.19/arch/x86/include/uapi/asm/bitsperlong.h  2015-04-11 12:31:26.051249909 +0200
57 @@ -1,7 +1,7 @@
58  #ifndef __ASM_X86_BITSPERLONG_H
59  #define __ASM_X86_BITSPERLONG_H
60  
61 -#ifdef __x86_64__
62 +#if defined(__x86_64__) && !defined(__ILP32__)
63  # define __BITS_PER_LONG 64
64  #else
65  # define __BITS_PER_LONG 32
66 --- linux-3.19/tools/perf/bench/sched-messaging.c~      2015-02-09 03:54:22.000000000 +0100
67 +++ linux-3.19/tools/perf/bench/sched-messaging.c       2015-04-11 12:33:22.587917365 +0200
68 @@ -310,13 +310,24 @@
69                 printf("# %d groups == %d %s run\n\n",
70                        num_groups, num_groups * 2 * num_fds,
71                        thread_mode ? "threads" : "processes");
72 +#if defined(__x86_64__) && !defined(__ILP32__)
73                 printf(" %14s: %lu.%03lu [sec]\n", "Total time",
74                        diff.tv_sec,
75                        (unsigned long) (diff.tv_usec/1000));
76 +#else
77 +               printf(" %14s: %llu.%03llu [sec]\n", "Total time",
78 +                      diff.tv_sec,
79 +                      (unsigned long long) (diff.tv_usec/1000));
80 +#endif
81                 break;
82         case BENCH_FORMAT_SIMPLE:
83 +#if defined(__x86_64__) && !defined(__ILP32__)
84                 printf("%lu.%03lu\n", diff.tv_sec,
85                        (unsigned long) (diff.tv_usec/1000));
86 +#else
87 +               printf("%llu.%03llu\n", diff.tv_sec,
88 +                      (unsigned long long) (diff.tv_usec/1000));
89 +#endif
90                 break;
91         default:
92                 /* reaching here is something disaster */
93 --- linux-3.19/tools/perf/bench/sched-pipe.c~   2015-02-09 03:54:22.000000000 +0100
94 +++ linux-3.19/tools/perf/bench/sched-pipe.c    2015-04-11 12:34:32.727917841 +0200
95 @@ -156,9 +156,15 @@
96                 result_usec = diff.tv_sec * 1000000;
97                 result_usec += diff.tv_usec;
98  
99 +#if defined(__x86_64__) && !defined(__ILP32__)
100                 printf(" %14s: %lu.%03lu [sec]\n\n", "Total time",
101                        diff.tv_sec,
102                        (unsigned long) (diff.tv_usec/1000));
103 +#else
104 +               printf(" %14s: %llu.%03llu [sec]\n\n", "Total time",
105 +                      diff.tv_sec,
106 +                      (unsigned long long) (diff.tv_usec/1000));
107 +#endif
108  
109                 printf(" %14lf usecs/op\n",
110                        (double)result_usec / (double)loops);
111 @@ -168,9 +174,15 @@
112                 break;
113  
114         case BENCH_FORMAT_SIMPLE:
115 +#if defined(__x86_64__) && !defined(__ILP32__)
116                 printf("%lu.%03lu\n",
117                        diff.tv_sec,
118                        (unsigned long) (diff.tv_usec / 1000));
119 +#else
120 +               printf("%llu.%03llu\n",
121 +                      diff.tv_sec,
122 +                      (unsigned long long) (diff.tv_usec / 1000));
123 +#endif
124                 break;
125  
126         default:
127 --- linux-3.19/tools/perf/builtin-stat.c~       2015-02-09 03:54:22.000000000 +0100
128 +++ linux-3.19/tools/perf/builtin-stat.c        2015-04-11 12:35:21.841251509 +0200
129 @@ -550,7 +550,11 @@
130  
131         clock_gettime(CLOCK_MONOTONIC, &ts);
132         diff_timespec(&rs, &ts, &ref_time);
133 +#if defined(__x86_64__) && !defined(__ILP32__)
134         sprintf(prefix, "%6lu.%09lu%s", rs.tv_sec, rs.tv_nsec, csv_sep);
135 +#else
136 +       sprintf(prefix, "%6llu.%09llu%s", rs.tv_sec, rs.tv_nsec, csv_sep);
137 +#endif
138  
139         if (num_print_interval == 0 && !csv_output) {
140                 switch (aggr_mode) {
141 --- linux-3.19/tools/perf/builtin-kvm.c~        2015-02-09 03:54:22.000000000 +0100
142 +++ linux-3.19/tools/perf/builtin-kvm.c 2015-04-11 12:36:00.511251770 +0200
143 @@ -565,7 +565,11 @@
144         gettimeofday(&tv, NULL);
145         if (localtime_r(&tv.tv_sec, &ltime)) {
146                 strftime(date, sizeof(date), "%H:%M:%S", &ltime);
147 +#if defined(__x86_64__) && !defined(__ILP32__)
148                 pr_info("%s.%06ld", date, tv.tv_usec);
149 +#else
150 +               pr_info("%s.%06lld", date, tv.tv_usec);
151 +#endif
152         } else
153                 pr_info("00:00:00.000000");
154  
This page took 0.127397 seconds and 3 git commands to generate.