Commit 51f26773 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 59dad0cb 92979997
......@@ -389,6 +389,7 @@ PHONY += outputmakefile
# output directory.
outputmakefile:
ifneq ($(KBUILD_SRC),)
$(Q)ln -fsn $(srctree) source
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \
$(srctree) $(objtree) $(VERSION) $(PATCHLEVEL)
endif
......@@ -946,7 +947,6 @@ ifneq ($(KBUILD_SRC),)
mkdir -p include2; \
ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm; \
fi
ln -fsn $(srctree) source
endif
# prepare2 creates a makefile if using a separate output directory
......
......@@ -51,7 +51,7 @@ my %pidctr;
while (<>) {
my $line = $_;
if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_]+)\+/) {
if ($line =~ /([0-9\.]+)\] calling ([a-zA-Z0-9\_\.]+)\+/) {
my $func = $2;
if ($done == 0) {
$start{$func} = $1;
......@@ -87,7 +87,7 @@ while (<>) {
$count = $count + 1;
}
if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_]+)\+.*returned/) {
if ($line =~ /([0-9\.]+)\] initcall ([a-zA-Z0-9\_\.]+)\+.*returned/) {
if ($done == 0) {
$end{$2} = $1;
$maxtime = $1;
......
#!/usr/bin/perl -w
#!/usr/bin/perl
use File::Basename;
......@@ -29,27 +29,151 @@ my $filename = $vmlinux_name;
my $target = "0";
my $function;
my $module = "";
my $func_offset;
my $func_offset = 0;
my $vmaoffset = 0;
my %regs;
sub parse_x86_regs
{
my ($line) = @_;
if ($line =~ /EAX: ([0-9a-f]+) EBX: ([0-9a-f]+) ECX: ([0-9a-f]+) EDX: ([0-9a-f]+)/) {
$regs{"%eax"} = $1;
$regs{"%ebx"} = $2;
$regs{"%ecx"} = $3;
$regs{"%edx"} = $4;
}
if ($line =~ /ESI: ([0-9a-f]+) EDI: ([0-9a-f]+) EBP: ([0-9a-f]+) ESP: ([0-9a-f]+)/) {
$regs{"%esi"} = $1;
$regs{"%edi"} = $2;
$regs{"%esp"} = $4;
}
if ($line =~ /RAX: ([0-9a-f]+) RBX: ([0-9a-f]+) RCX: ([0-9a-f]+)/) {
$regs{"%eax"} = $1;
$regs{"%ebx"} = $2;
$regs{"%ecx"} = $3;
}
if ($line =~ /RDX: ([0-9a-f]+) RSI: ([0-9a-f]+) RDI: ([0-9a-f]+)/) {
$regs{"%edx"} = $1;
$regs{"%esi"} = $2;
$regs{"%edi"} = $3;
}
if ($line =~ /RBP: ([0-9a-f]+) R08: ([0-9a-f]+) R09: ([0-9a-f]+)/) {
$regs{"%r08"} = $2;
$regs{"%r09"} = $3;
}
if ($line =~ /R10: ([0-9a-f]+) R11: ([0-9a-f]+) R12: ([0-9a-f]+)/) {
$regs{"%r10"} = $1;
$regs{"%r11"} = $2;
$regs{"%r12"} = $3;
}
if ($line =~ /R13: ([0-9a-f]+) R14: ([0-9a-f]+) R15: ([0-9a-f]+)/) {
$regs{"%r13"} = $1;
$regs{"%r14"} = $2;
$regs{"%r15"} = $3;
}
}
sub reg_name
{
my ($reg) = @_;
$reg =~ s/r(.)x/e\1x/;
$reg =~ s/r(.)i/e\1i/;
$reg =~ s/r(.)p/e\1p/;
return $reg;
}
sub process_x86_regs
{
my ($line, $cntr) = @_;
my $str = "";
if (length($line) < 40) {
return ""; # not an asm istruction
}
# find the arguments to the instruction
if ($line =~ /([0-9a-zA-Z\,\%\(\)\-\+]+)$/) {
$lastword = $1;
} else {
return "";
}
# we need to find the registers that get clobbered,
# since their value is no longer relevant for previous
# instructions in the stream.
$clobber = $lastword;
# first, remove all memory operands, they're read only
$clobber =~ s/\([a-z0-9\%\,]+\)//g;
# then, remove everything before the comma, thats the read part
$clobber =~ s/.*\,//g;
# if this is the instruction that faulted, we haven't actually done
# the write yet... nothing is clobbered.
if ($cntr == 0) {
$clobber = "";
}
foreach $reg (keys(%regs)) {
my $clobberprime = reg_name($clobber);
my $lastwordprime = reg_name($lastword);
my $val = $regs{$reg};
if ($val =~ /^[0]+$/) {
$val = "0";
} else {
$val =~ s/^0*//;
}
# first check if we're clobbering this register; if we do
# we print it with a =>, and then delete its value
if ($clobber =~ /$reg/ || $clobberprime =~ /$reg/) {
if (length($val) > 0) {
$str = $str . " $reg => $val ";
}
$regs{$reg} = "";
$val = "";
}
# now check if we're reading this register
if ($lastword =~ /$reg/ || $lastwordprime =~ /$reg/) {
if (length($val) > 0) {
$str = $str . " $reg = $val ";
}
}
}
return $str;
}
# parse the oops
while (<STDIN>) {
my $line = $_;
if ($line =~ /EIP: 0060:\[\<([a-z0-9]+)\>\]/) {
$target = $1;
}
if ($line =~ /RIP: 0010:\[\<([a-z0-9]+)\>\]/) {
$target = $1;
}
if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) {
$function = $1;
$func_offset = $2;
}
if ($line =~ /RIP: 0010:\[\<[0-9a-f]+\>\] \[\<[0-9a-f]+\>\] ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]/) {
$function = $1;
$func_offset = $2;
}
# check if it's a module
if ($line =~ /EIP is at ([a-zA-Z0-9\_]+)\+(0x[0-9a-f]+)\/0x[a-f0-9]+\W\[([a-zA-Z0-9\_\-]+)\]/) {
$module = $3;
}
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\_\-]+)\]/) {
$module = $3;
}
parse_x86_regs($line);
}
my $decodestart = hex($target) - hex($func_offset);
my $decodestop = $decodestart + 8192;
my $decodestop = hex($target) + 8192;
if ($target eq "0") {
print "No oops found!\n";
print "Usage: \n";
......@@ -84,6 +208,7 @@ my $counter = 0;
my $state = 0;
my $center = 0;
my @lines;
my @reglines;
sub InRange {
my ($address, $target) = @_;
......@@ -188,16 +313,36 @@ while ($finish < $counter) {
my $i;
my $fulltext = "";
# start annotating the registers in the asm.
# this goes from the oopsing point back, so that the annotator
# can track (opportunistically) which registers got written and
# whos value no longer is relevant.
$i = $center;
while ($i >= $start) {
$reglines[$i] = process_x86_regs($lines[$i], $center - $i);
$i = $i - 1;
}
$i = $start;
while ($i < $finish) {
my $line;
if ($i == $center) {
$fulltext = $fulltext . "*$lines[$i] <----- faulting instruction\n";
$line = "*$lines[$i] ";
} else {
$fulltext = $fulltext . " $lines[$i]\n";
$line = " $lines[$i] ";
}
print $line;
if (defined($reglines[$i]) && length($reglines[$i]) > 0) {
my $c = 60 - length($line);
while ($c > 0) { print " "; $c = $c - 1; };
print "| $reglines[$i]";
}
if ($i == $center) {
print "<--- faulting instruction";
}
print "\n";
$i = $i +1;
}
print $fulltext;
......@@ -86,6 +86,14 @@ echo "%endif"
echo 'cp System.map $RPM_BUILD_ROOT'"/boot/System.map-$KERNELRELEASE"
echo 'cp .config $RPM_BUILD_ROOT'"/boot/config-$KERNELRELEASE"
echo "%ifnarch ppc64"
echo 'cp vmlinux vmlinux.orig'
echo 'bzip2 -9 vmlinux'
echo 'mv vmlinux.bz2 $RPM_BUILD_ROOT'"/boot/vmlinux-$KERNELRELEASE.bz2"
echo 'mv vmlinux.orig vmlinux'
echo "%endif"
echo ""
echo "%clean"
echo '#echo -rf $RPM_BUILD_ROOT'
......
......@@ -58,14 +58,7 @@ fi
# Check for svn and a svn repo.
if rev=`svn info 2>/dev/null | grep '^Last Changed Rev'`; then
rev=`echo $rev | awk '{print $NF}'`
changes=`svn status 2>/dev/null | grep '^[AMD]' | wc -l`
# Are there uncommitted changes?
if [ $changes != 0 ]; then
printf -- '-svn%s%s' "$rev" -dirty
else
printf -- '-svn%s' "$rev"
fi
# All done with svn
exit
......
......@@ -76,7 +76,10 @@ all_sources()
all_kconfigs()
{
find_sources $ALLSOURCE_ARCHS 'Kconfig*'
for arch in $ALLSOURCE_ARCHS; do
find_sources $arch 'Kconfig*'
done
find_other_sources 'Kconfig*'
}
all_defconfigs()
......@@ -99,7 +102,8 @@ exuberant()
-I ____cacheline_internodealigned_in_smp \
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
--extra=+f --c-kinds=+px \
--regex-asm='/^ENTRY\(([^)]*)\).*/\1/'
--regex-asm='/^ENTRY\(([^)]*)\).*/\1/' \
--regex-c='/^SYSCALL_DEFINE[[:digit:]]?\(([^,)]*).*/sys_\1/'
all_kconfigs | xargs $1 -a \
--langdef=kconfig --language-force=kconfig \
......@@ -117,7 +121,9 @@ exuberant()
emacs()
{
all_sources | xargs $1 -a
all_sources | xargs $1 -a \
--regex='/^ENTRY(\([^)]*\)).*/\1/' \
--regex='/^SYSCALL_DEFINE[0-9]?(\([^,)]*\).*/sys_\1/'
all_kconfigs | xargs $1 -a \
--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment