diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-17 17:15:23 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-17 17:15:23 -0500 |
| commit | 51f267739a81db5eb511b95aeae338413690b8a2 (patch) | |
| tree | f4cd6461e8f2fa98a470ff9895dcb89842feab08 /scripts | |
| parent | 59dad0cbe6fd52e68b1ee4b02cbf89d64a4655cc (diff) | |
| parent | 929799973ba4a40f7b8001e9cc461c13d04c4124 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
kbuild: create the source symlink earlier in the objdir
scripts: add x86 64 bit support to the markup_oops.pl script
scripts: add x86 register parser to markup_oops.pl
kbuild: add sys_* entries for syscalls in tags
kbuild: fix tags generation of config symbols
bootgraph: fix for use with dot symbols
kbuild: add vmlinux to kernel rpm
kbuild,setlocalversion: shorten the make time when using svn
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/bootgraph.pl | 4 | ||||
| -rw-r--r-- | scripts/markup_oops.pl | 161 | ||||
| -rwxr-xr-x | scripts/package/mkspec | 8 | ||||
| -rwxr-xr-x | scripts/setlocalversion | 9 | ||||
| -rwxr-xr-x | scripts/tags.sh | 12 |
5 files changed, 173 insertions, 21 deletions
diff --git a/scripts/bootgraph.pl b/scripts/bootgraph.pl index b0246307aac4..12caa822a232 100644 --- a/scripts/bootgraph.pl +++ b/scripts/bootgraph.pl | |||
| @@ -51,7 +51,7 @@ my %pidctr; | |||
| 51 | 51 | ||
| 52 | while (<>) { | 52 | while (<>) { |
| 53 | my $line = $_; | 53 | my $line = $_; |
| 54 | if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_]+)\+/) { | 54 | if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_\.]+)\+/) { |
| 55 | my $func = $2; | 55 | my $func = $2; |
| 56 | if ($done == 0) { | 56 | if ($done == 0) { |
| 57 | $start{$func} = $1; | 57 | $start{$func} = $1; |
| @@ -87,7 +87,7 @@ while (<>) { | |||
| 87 | $count = $count + 1; | 87 | $count = $count + 1; |
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_]+)\+.*returned/) { | 90 | if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_\.]+)\+.*returned/) { |
| 91 | if ($done == 0) { | 91 | if ($done == 0) { |
| 92 | $end{$2} = $1; | 92 | $end{$2} = $1; |
| 93 | $maxtime = $1; | 93 | $maxtime = $1; |
diff --git a/scripts/markup_oops.pl b/scripts/markup_oops.pl index d40449cafa84..528492bcba5b 100644 --- a/scripts/markup_oops.pl +++ b/scripts/markup_oops.pl | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/usr/bin/perl -w | 1 | #!/usr/bin/perl |
| 2 | 2 | ||
| 3 | use File::Basename; | 3 | use File::Basename; |
| 4 | 4 | ||
| @@ -29,27 +29,151 @@ my $filename = $vmlinux_name; | |||
| 29 | my $target = "0"; | 29 | my $target = "0"; |
| 30 | my $function; | 30 | my $function; |
| 31 | my $module = ""; | 31 | my $module = ""; |
| 32 | my $func_offset; | 32 | my $func_offset = 0; |
| 33 | my $vmaoffset = 0; | 33 | my $vmaoffset = 0; |
| 34 | 34 | ||
| 35 | my %regs; | ||
| 36 | |||
| 37 | |||
| 38 | sub parse_x86_regs | ||
| 39 | { | ||
| 40 | my ($line) = @_; | ||
| 41 | if ($line =~ /EAX: ([0-9a-f]+) EBX: ([0-9a-f]+) ECX: ([0-9a-f]+) EDX: ([0-9a-f]+)/) { | ||
| 42 | $regs{"%eax"} = $1; | ||
| 43 | $regs{"%ebx"} = $2; | ||
| 44 | $regs{"%ecx"} = $3; | ||
| 45 | $regs{"%edx"} = $4; | ||
| 46 | } | ||
| 47 | if ($line =~ /ESI: ([0-9a-f]+) EDI: ([0-9a-f]+) EBP: ([0-9a-f]+) ESP: ([0-9a-f]+)/) { | ||
| 48 | $regs{"%esi"} = $1; | ||
| 49 | $regs{"%edi"} = $2; | ||
| 50 | $regs{"%esp"} = $4; | ||
| 51 | } | ||
| 52 | if ($line =~ /RAX: ([0-9a-f]+) RBX: ([0-9a-f]+) RCX: ([0-9a-f]+)/) { | ||
| 53 | $regs{"%eax"} = $1; | ||
| 54 | $regs{"%ebx"} = $2; | ||
| 55 | $regs{"%ecx"} = $3; | ||
| 56 | } | ||
| 57 | if ($line =~ /RDX: ([0-9a-f]+) RSI: ([0-9a-f]+) RDI: ([0-9a-f]+)/) { | ||
| 58 | $regs{"%edx"} = $1; | ||
| 59 | $regs{"%esi"} = $2; | ||
| 60 | $regs{"%edi"} = $3; | ||
| 61 | } | ||
| 62 | if ($line =~ /RBP: ([0-9a-f]+) R08: ([0-9a-f]+) R09: ([0-9a-f]+)/) { | ||
| 63 | $regs{"%r08"} = $2; | ||
| 64 | $regs{"%r09"} = $3; | ||
| 65 | } | ||
| 66 | if ($line =~ /R10: ([0-9a-f]+) R11: ([0-9a-f]+) R12: ([0-9a-f]+)/) { | ||
| 67 | $regs{"%r10"} = $1; | ||
| 68 | $regs{"%r11"} = $2; | ||
| 69 | $regs{"%r12"} = $3; | ||
| 70 | } | ||
| 71 | if ($line =~ /R13: ([0-9a-f]+) R14: ([0-9a-f]+) R15: ([0-9a-f]+)/) { | ||
| 72 | $regs{"%r13"} = $1; | ||
| 73 | $regs{"%r14"} = $2; | ||
| 74 | $regs{"%r15"} = $3; | ||
| 75 | } | ||
| 76 | } | ||
| 77 | |||
| 78 | sub reg_name | ||
| 79 | { | ||
| 80 | my ($reg) = @_; | ||
| 81 | $reg =~ s/r(.)x/e\1x/; | ||
| 82 | $reg =~ s/r(.)i/e\1i/; | ||
| 83 | $reg =~ s/r(.)p/e\1p/; | ||
| 84 | return $reg; | ||
| 85 | } | ||
| 86 | |||
| 87 | sub process_x86_regs | ||
| 88 | { | ||
| 89 | my ($line, $cntr) = @_; | ||
| 90 | my $str = ""; | ||
| 91 | if (length($line) < 40) { | ||
| 92 | return ""; # not an asm istruction | ||
| 93 | } | ||
| 94 | |||
| 95 | # find the arguments to the instruction | ||
| 96 | if ($line =~ /([0-9a-zA-Z\,\%\(\)\-\+]+)$/) { | ||
| 97 | $lastword = $1; | ||
| 98 | } else { | ||
| 99 | return ""; | ||
| 100 | } | ||
| 101 | |||
| 102 | # we need to find the registers that get clobbered, | ||
| 103 | # since their value is no longer relevant for previous | ||
| 104 | # instructions in the stream. | ||
| 105 | |||
| 106 | $clobber = $lastword; | ||
| 107 | # first, remove all memory operands, they're read only | ||
| 108 | $clobber =~ s/\([a-z0-9\%\,]+\)//g; | ||
| 109 | # then, remove everything before the comma, thats the read part | ||
| 110 | $clobber =~ s/.*\,//g; | ||
| 111 | |||
| 112 | # if this is the instruction that faulted, we haven't actually done | ||
| 113 | # the write yet... nothing is clobbered. | ||
| 114 | if ($cntr == 0) { | ||
| 115 | $clobber = ""; | ||
| 116 | } | ||
| 117 | |||
| 118 | foreach $reg (keys(%regs)) { | ||
| 119 | my $clobberprime = reg_name($clobber); | ||
| 120 | my $lastwordprime = reg_name($lastword); | ||
| 121 | my $val = $regs{$reg}; | ||
| 122 | if ($val =~ /^[0]+$/) { | ||
| 123 | $val = "0"; | ||
| 124 | } else { | ||
| 125 | $val =~ s/^0*//; | ||
| 126 | } | ||
| 127 | |||
| 128 | # first check if we're clobbering this register; if we do | ||
| 129 | # we print it with a =>, and then delete its value | ||
| 130 | if ($clobber =~ /$reg/ || $clobberprime =~ /$reg/) { | ||
| 131 | if (length($val) > 0) { | ||
| 132 | $str = $str . " $reg => $val "; | ||
| 133 | } | ||
| 134 | $regs{$reg} = ""; | ||
| 135 | $val = ""; | ||
| 136 | } | ||
| 137 | # now check if we're reading this register | ||
| 138 | if ($lastword =~ /$reg/ || $lastwordprime =~ /$reg/) { | ||
| 139 | if (length($val) > 0) { | ||
| 140 | $str = $str . " $reg = $val "; | ||
| 141 | } | ||
| 142 | } | ||
| 143 | } | ||
| 144 | return $str; | ||
| 145 | } | ||
| 146 | |||
| 147 | # parse the oops | ||
| 35 | while (<STDIN>) { | 148 | while (<STDIN>) { |
| 36 | my $line = $_; | 149 | my $line = $_; |
| 37 | if ($line =~ /EIP: 0060:\[\<([a-z0-9]+)\>\]/) { | 150 | if ($line =~ /EIP: 0060:\[\<([a-z0-9]+)\>\]/) { |
| 38 | $target = $1; | 151 | $target = $1; |
| 39 | } | 152 | } |
| 153 | if ($line =~ /RIP: 0010:\[\<([a-z0-9]+)\>\]/) { | ||
| 154 | $target = $1; | ||
| 155 | } | ||
| 40 | if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) { | 156 | if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) { |
| 41 | $function = $1; | 157 | $function = $1; |
| 42 | $func_offset = $2; | 158 | $func_offset = $2; |
| 43 | } | 159 | } |
| 160 | if ($line =~ /RIP: 0010:\[\<[0-9a-f]+\>\] \[\<[0-9a-f]+\>\] ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) { | ||
| 161 | $function = $1; | ||
| 162 | $func_offset = $2; | ||
| 163 | } | ||
| 44 | 164 | ||
| 45 | # check if it's a module | 165 | # check if it's a module |
| 46 | if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]+\W\[([a-zA-Z0-9\_\-]+)\]/) { | 166 | if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]+\W\[([a-zA-Z0-9\_\-]+)\]/) { |
| 47 | $module = $3; | 167 | $module = $3; |
| 48 | } | 168 | } |
| 169 | if ($line =~ /RIP: 0010:\[\<[0-9a-f]+\>\] \[\<[0-9a-f]+\>\] ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]+\W\[([a-zA-Z0-9\_\-]+)\]/) { | ||
| 170 | $module = $3; | ||
| 171 | } | ||
| 172 | parse_x86_regs($line); | ||
| 49 | } | 173 | } |
| 50 | 174 | ||
| 51 | my $decodestart = hex($target) - hex($func_offset); | 175 | my $decodestart = hex($target) - hex($func_offset); |
| 52 | my $decodestop = $dec | ||
