diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.lib | 28 | ||||
-rw-r--r-- | scripts/bin_size | 10 | ||||
-rwxr-xr-x | scripts/checksyscalls.sh | 92 | ||||
-rwxr-xr-x | scripts/kernel-doc | 22 | ||||
-rw-r--r-- | scripts/mod/file2alias.c | 2 | ||||
-rwxr-xr-x | scripts/recordmcount.pl | 19 |
6 files changed, 149 insertions, 24 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index cba61ca403ca..2b706617c89a 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -188,20 +188,34 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS) $(OBJCOPYFLAGS_$(@F)) $< $@ | |||
188 | # --------------------------------------------------------------------------- | 188 | # --------------------------------------------------------------------------- |
189 | 189 | ||
190 | quiet_cmd_gzip = GZIP $@ | 190 | quiet_cmd_gzip = GZIP $@ |
191 | cmd_gzip = gzip -f -9 < $< > $@ | 191 | cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \ |
192 | (rm -f $@ ; false) | ||
192 | 193 | ||
193 | 194 | ||
194 | # Bzip2 | 195 | # Bzip2 |
195 | # --------------------------------------------------------------------------- | 196 | # --------------------------------------------------------------------------- |
196 | 197 | ||
197 | # Bzip2 does not include size in file... so we have to fake that | 198 | # Bzip2 and LZMA do not include size in file... so we have to fake that; |
198 | size_append=$(CONFIG_SHELL) $(srctree)/scripts/bin_size | 199 | # append the size as a 32-bit littleendian number as gzip does. |
199 | 200 | size_append = echo -ne $(shell \ | |
200 | quiet_cmd_bzip2 = BZIP2 $@ | 201 | dec_size=0; \ |
201 | cmd_bzip2 = (bzip2 -9 < $< && $(size_append) $<) > $@ || (rm -f $@ ; false) | 202 | for F in $1; do \ |
203 | fsize=$$(stat -c "%s" $$F); \ | ||
204 | dec_size=$$(expr $$dec_size + $$fsize); \ | ||
205 | done; \ | ||
206 | printf "%08x" $$dec_size | \ | ||
207 | sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g' \ | ||
208 | ) | ||
209 | |||
210 | quiet_cmd_bzip2 = BZIP2 $@ | ||
211 | cmd_bzip2 = (cat $(filter-out FORCE,$^) | \ | ||
212 | bzip2 -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ | ||
213 | (rm -f $@ ; false) | ||
202 | 214 | ||
203 | # Lzma | 215 | # Lzma |
204 | # --------------------------------------------------------------------------- | 216 | # --------------------------------------------------------------------------- |
205 | 217 | ||
206 | quiet_cmd_lzma = LZMA $@ | 218 | quiet_cmd_lzma = LZMA $@ |
207 | cmd_lzma = (lzma -9 -c $< && $(size_append) $<) >$@ || (rm -f $@ ; false) | 219 | cmd_lzma = (cat $(filter-out FORCE,$^) | \ |
220 | lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ | ||
221 | (rm -f $@ ; false) | ||
diff --git a/scripts/bin_size b/scripts/bin_size deleted file mode 100644 index 43e1b360cee6..000000000000 --- a/scripts/bin_size +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ $# = 0 ] ; then | ||
4 | echo Usage: $0 file | ||
5 | fi | ||
6 | |||
7 | size_dec=`stat -c "%s" $1` | ||
8 | size_hex_echo_string=`printf "%08x" $size_dec | | ||
9 | sed 's/\(..\)\(..\)\(..\)\(..\)/\\\\x\4\\\\x\3\\\\x\2\\\\x\1/g'` | ||
10 | /bin/echo -ne $size_hex_echo_string | ||
diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh index 60d00d1c4eee..66ad375612f2 100755 --- a/scripts/checksyscalls.sh +++ b/scripts/checksyscalls.sh | |||
@@ -14,6 +14,57 @@ cat << EOF | |||
14 | #include <asm/types.h> | 14 | #include <asm/types.h> |
15 | #include <asm/unistd.h> | 15 | #include <asm/unistd.h> |
16 | 16 | ||
17 | /* *at */ | ||
18 | #define __IGNORE_open /* openat */ | ||
19 | #define __IGNORE_link /* linkat */ | ||
20 | #define __IGNORE_unlink /* unlinkat */ | ||
21 | #define __IGNORE_mknod /* mknodat */ | ||
22 | #define __IGNORE_chmod /* fchmodat */ | ||
23 | #define __IGNORE_chown /* fchownat */ | ||
24 | #define __IGNORE_mkdir /* mkdirat */ | ||
25 | #define __IGNORE_rmdir /* unlinkat */ | ||
26 | #define __IGNORE_lchown /* fchownat */ | ||
27 | #define __IGNORE_access /* faccessat */ | ||
28 | #define __IGNORE_rename /* renameat */ | ||
29 | #define __IGNORE_readlink /* readlinkat */ | ||
30 | #define __IGNORE_symlink /* symlinkat */ | ||
31 | #define __IGNORE_utimes /* futimesat */ | ||
32 | #if BITS_PER_LONG == 64 | ||
33 | #define __IGNORE_stat /* fstatat */ | ||
34 | #define __IGNORE_lstat /* fstatat */ | ||
35 | #else | ||
36 | #define __IGNORE_stat64 /* fstatat64 */ | ||
37 | #define __IGNORE_lstat64 /* fstatat64 */ | ||
38 | #endif | ||
39 | |||
40 | /* CLOEXEC flag */ | ||
41 | #define __IGNORE_pipe /* pipe2 */ | ||
42 | #define __IGNORE_dup2 /* dup3 */ | ||
43 | #define __IGNORE_epoll_create /* epoll_create1 */ | ||
44 | #define __IGNORE_inotify_init /* inotify_init1 */ | ||
45 | #define __IGNORE_eventfd /* eventfd2 */ | ||
46 | #define __IGNORE_signalfd /* signalfd4 */ | ||
47 | |||
48 | /* MMU */ | ||
49 | #ifndef CONFIG_MMU | ||
50 | #define __IGNORE_madvise | ||
51 | #define __IGNORE_mbind | ||
52 | #define __IGNORE_mincore | ||
53 | #define __IGNORE_mlock | ||
54 | #define __IGNORE_mlockall | ||
55 | #define __IGNORE_munlock | ||
56 | #define __IGNORE_munlockall | ||
57 | #define __IGNORE_mprotect | ||
58 | #define __IGNORE_msync | ||
59 | #define __IGNORE_migrate_pages | ||
60 | #define __IGNORE_move_pages | ||
61 | #define __IGNORE_remap_file_pages | ||
62 | #define __IGNORE_get_mempolicy | ||
63 | #define __IGNORE_set_mempolicy | ||
64 | #define __IGNORE_swapoff | ||
65 | #define __IGNORE_swapon | ||
66 | #endif | ||
67 | |||
17 | /* System calls for 32-bit kernels only */ | 68 | /* System calls for 32-bit kernels only */ |
18 | #if BITS_PER_LONG == 64 | 69 | #if BITS_PER_LONG == 64 |
19 | #define __IGNORE_sendfile64 | 70 | #define __IGNORE_sendfile64 |
@@ -27,6 +78,22 @@ cat << EOF | |||
27 | #define __IGNORE_fstatat64 | 78 | #define __IGNORE_fstatat64 |
28 | #define __IGNORE_fstatfs64 | 79 | #define __IGNORE_fstatfs64 |
29 | #define __IGNORE_statfs64 | 80 | #define __IGNORE_statfs64 |
81 | #define __IGNORE_llseek | ||
82 | #define __IGNORE_mmap2 | ||
83 | #else | ||
84 | #define __IGNORE_sendfile | ||
85 | #define __IGNORE_ftruncate | ||
86 | #define __IGNORE_truncate | ||
87 | #define __IGNORE_stat | ||
88 | #define __IGNORE_lstat | ||
89 | #define __IGNORE_fstat | ||
90 | #define __IGNORE_fcntl | ||
91 | #define __IGNORE_fadvise64 | ||
92 | #define __IGNORE_newfstatat | ||
93 | #define __IGNORE_fstatfs | ||
94 | #define __IGNORE_statfs | ||
95 | #define __IGNORE_lseek | ||
96 | #define __IGNORE_mmap | ||
30 | #endif | 97 | #endif |
31 | 98 | ||
32 | /* i386-specific or historical system calls */ | 99 | /* i386-specific or historical system calls */ |
@@ -44,7 +111,6 @@ cat << EOF | |||
44 | #define __IGNORE_idle | 111 | #define __IGNORE_idle |
45 | #define __IGNORE_modify_ldt | 112 | #define __IGNORE_modify_ldt |
46 | #define __IGNORE_ugetrlimit | 113 | #define __IGNORE_ugetrlimit |
47 | #define __IGNORE_mmap2 | ||
48 | #define __IGNORE_vm86 | 114 | #define __IGNORE_vm86 |
49 | #define __IGNORE_vm86old | 115 | #define __IGNORE_vm86old |
50 | #define __IGNORE_set_thread_area | 116 | #define __IGNORE_set_thread_area |
@@ -55,7 +121,6 @@ cat << EOF | |||
55 | #define __IGNORE_oldlstat | 121 | #define __IGNORE_oldlstat |
56 | #define __IGNORE_oldolduname | 122 | #define __IGNORE_oldolduname |
57 | #define __IGNORE_olduname | 123 | #define __IGNORE_olduname |
58 | #define __IGNORE_umount2 | ||
59 | #define __IGNORE_umount | 124 | #define __IGNORE_umount |
60 | #define __IGNORE_waitpid | 125 | #define __IGNORE_waitpid |
61 | #define __IGNORE_stime | 126 | #define __IGNORE_stime |
@@ -75,9 +140,12 @@ cat << EOF | |||
75 | #define __IGNORE__llseek | 140 | #define __IGNORE__llseek |
76 | #define __IGNORE__newselect | 141 | #define __IGNORE__newselect |
77 | #define __IGNORE_create_module | 142 | #define __IGNORE_create_module |
78 | #define __IGNORE_delete_module | ||
79 | #define __IGNORE_query_module | 143 | #define __IGNORE_query_module |
80 | #define __IGNORE_get_kernel_syms | 144 | #define __IGNORE_get_kernel_syms |
145 | #define __IGNORE_sysfs | ||
146 | #define __IGNORE_uselib | ||
147 | #define __IGNORE__sysctl | ||
148 | |||
81 | /* ... including the "new" 32-bit uid syscalls */ | 149 | /* ... including the "new" 32-bit uid syscalls */ |
82 | #define __IGNORE_lchown32 | 150 | #define __IGNORE_lchown32 |
83 | #define __IGNORE_getuid32 | 151 | #define __IGNORE_getuid32 |
@@ -99,6 +167,24 @@ cat << EOF | |||
99 | #define __IGNORE_setfsuid32 | 167 | #define __IGNORE_setfsuid32 |
100 | #define __IGNORE_setfsgid32 | 168 | #define __IGNORE_setfsgid32 |
101 | 169 | ||
170 | /* these can be expressed using other calls */ | ||
171 | #define __IGNORE_alarm /* setitimer */ | ||
172 | #define __IGNORE_creat /* open */ | ||
173 | #define __IGNORE_fork /* clone */ | ||
174 | #define __IGNORE_futimesat /* utimensat */ | ||
175 | #define __IGNORE_getpgrp /* getpgid */ | ||
176 | #define __IGNORE_getdents /* getdents64 */ | ||
177 | #define __IGNORE_pause /* sigsuspend */ | ||
178 | #define __IGNORE_poll /* ppoll */ | ||
179 | #define __IGNORE_select /* pselect6 */ | ||
180 | #define __IGNORE_epoll_wait /* epoll_pwait */ | ||
181 | #define __IGNORE_time /* gettimeofday */ | ||
182 | #define __IGNORE_uname /* newuname */ | ||
183 | #define __IGNORE_ustat /* statfs */ | ||
184 | #define __IGNORE_utime /* utimes */ | ||
185 | #define __IGNORE_vfork /* clone */ | ||
186 | #define __IGNORE_wait4 /* waitid */ | ||
187 | |||
102 | /* sync_file_range had a stupid ABI. Allow sync_file_range2 instead */ | 188 | /* sync_file_range had a stupid ABI. Allow sync_file_range2 instead */ |
103 | #ifdef __NR_sync_file_range2 | 189 | #ifdef __NR_sync_file_range2 |
104 | #define __IGNORE_sync_file_range | 190 | #define __IGNORE_sync_file_range |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 5c58478eb914..a193fa3f5272 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1828,6 +1828,25 @@ sub reset_state { | |||
1828 | $state = 0; | 1828 | $state = 0; |
1829 | } | 1829 | } |
1830 | 1830 | ||
1831 | sub tracepoint_munge($) { | ||
1832 | my $file = shift; | ||
1833 | my $tracepointname = 0; | ||
1834 | my $tracepointargs = 0; | ||
1835 | |||
1836 | if($prototype =~ m/TRACE_EVENT\((.*?),/) { | ||
1837 | $tracepointname = $1; | ||
1838 | } | ||
1839 | if($prototype =~ m/TP_PROTO\((.*?)\)/) { | ||
1840 | $tracepointargs = $1; | ||
1841 | } | ||
1842 | if (($tracepointname eq 0) || ($tracepointargs eq 0)) { | ||
1843 | print STDERR "Warning(${file}:$.): Unrecognized tracepoint format: \n". | ||
1844 | "$prototype\n"; | ||
1845 | } else { | ||
1846 | $prototype = "static inline void trace_$tracepointname($tracepointargs)"; | ||
1847 | } | ||
1848 | } | ||
1849 | |||
1831 | sub syscall_munge() { | 1850 | sub syscall_munge() { |
1832 | my $void = 0; | 1851 | my $void = 0; |
1833 | 1852 | ||
@@ -1882,6 +1901,9 @@ sub process_state3_function($$) { | |||
1882 | if ($prototype =~ /SYSCALL_DEFINE/) { | 1901 | if ($prototype =~ /SYSCALL_DEFINE/) { |
1883 | syscall_munge(); | 1902 | syscall_munge(); |
1884 | } | 1903 | } |
1904 | if ($prototype =~ /TRACE_EVENT/) { | ||
1905 | tracepoint_munge($file); | ||
1906 | } | ||
1885 | dump_function($prototype, $file); | 1907 | dump_function($prototype, $file); |
1886 | reset_state(); | 1908 | reset_state(); |
1887 | } | 1909 | } |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index a3344285ccf4..40e0045876ee 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -641,7 +641,7 @@ static int do_virtio_entry(const char *filename, struct virtio_device_id *id, | |||
641 | id->vendor = TO_NATIVE(id->vendor); | 641 | id->vendor = TO_NATIVE(id->vendor); |
642 | 642 | ||
643 | strcpy(alias, "virtio:"); | 643 | strcpy(alias, "virtio:"); |
644 | ADD(alias, "d", 1, id->device); | 644 | ADD(alias, "d", id->device != VIRTIO_DEV_ANY_ID, id->device); |
645 | ADD(alias, "v", id->vendor != VIRTIO_DEV_ANY_ID, id->vendor); | 645 | ADD(alias, "v", id->vendor != VIRTIO_DEV_ANY_ID, id->vendor); |
646 | 646 | ||
647 | add_wildcard(alias); | 647 | add_wildcard(alias); |
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 409596eca124..91033e67321e 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -26,7 +26,7 @@ | |||
26 | # which will also be the location of that section after final link. | 26 | # which will also be the location of that section after final link. |
27 | # e.g. | 27 | # e.g. |
28 | # | 28 | # |
29 | # .section ".text.sched" | 29 | # .section ".sched.text", "ax" |
30 | # .globl my_func | 30 | # .globl my_func |
31 | # my_func: | 31 | # my_func: |
32 | # [...] | 32 | # [...] |
@@ -39,7 +39,7 @@ | |||
39 | # [...] | 39 | # [...] |
40 | # | 40 | # |
41 | # Both relocation offsets for the mcounts in the above example will be | 41 | # Both relocation offsets for the mcounts in the above example will be |
42 | # offset from .text.sched. If we make another file called tmp.s with: | 42 | # offset from .sched.text. If we make another file called tmp.s with: |
43 | # | 43 | # |
44 | # .section __mcount_loc | 44 | # .section __mcount_loc |
45 | # .quad my_func + 0x5 | 45 | # .quad my_func + 0x5 |
@@ -51,7 +51,7 @@ | |||
51 | # But this gets hard if my_func is not globl (a static function). | 51 | # But this gets hard if my_func is not globl (a static function). |
52 | # In such a case we have: | 52 | # In such a case we have: |
53 | # | 53 | # |
54 | # .section ".text.sched" | 54 | # .section ".sched.text", "ax" |
55 | # my_func: | 55 | # my_func: |
56 | # [...] | 56 | # [...] |
57 | # call mcount (offset: 0x5) | 57 | # call mcount (offset: 0x5) |
@@ -185,6 +185,19 @@ if ($arch eq "x86_64") { | |||
185 | $objcopy .= " -O elf32-i386"; | 185 | $objcopy .= " -O elf32-i386"; |
186 | $cc .= " -m32"; | 186 | $cc .= " -m32"; |
187 | 187 | ||
188 | } elsif ($arch eq "s390" && $bits == 32) { | ||
189 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_32\\s+_mcount\$"; | ||
190 | $alignment = 4; | ||
191 | $ld .= " -m elf_s390"; | ||
192 | $cc .= " -m31"; | ||
193 | |||
194 | } elsif ($arch eq "s390" && $bits == 64) { | ||
195 | $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$"; | ||
196 | $alignment = 8; | ||
197 | $type = ".quad"; | ||
198 | $ld .= " -m elf64_s390"; | ||
199 | $cc .= " -m64"; | ||
200 | |||
188 | } elsif ($arch eq "sh") { | 201 | } elsif ($arch eq "sh") { |
189 | $alignment = 2; | 202 | $alignment = 2; |
190 | 203 | ||