| Age | Commit message (Collapse) | Author |
|
This provides a port of checkstack for sh64 for the simple frames
allocated as an immediate with a single instruction.
Stack frame creation on sh64 happens in a couple of different ways,
when the frame size is less than 511 bytes an addi or addi.l is
typically used, generally along the lines of something like:
addi{,.l} r15, -IMM_FRAME_SIZE, r15
For larger frames, this ends up getting split up into a
movi/sub pair:
movi IMM_FRAME_SIZE, rX
sub r15, rX, r15
We currently don't handle the split pair case, as basically
any register can be used, and there is no easy way to determine
what happens without scanning the prologue multiple times and
using some sort of register cache (we already do something
similar for the sh64 stack unwinder, but it would be preferable
not to do this in perl..).
This does have limited usefulness in that we are not easily able
to check for huge frames without manual inspection, but this is
still useful enough in the general case to be worth doing for
the addi/addi.l case as long as people are aware of this caveat.
It may be worth revisiting at a later point to try and catch the
larger users though.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add support for x86_64 arch. to 'make checkstack' (checkstack.pl).
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
Acked-by: Jrn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
- fix documentation
- use $(src) in Makefile (fixes cross-compilation)
Both spottet by Geert Uytterhoeven
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add m68k support to checkstack.pl
Regular expression combination by Andres Schwab
Signed-off-by: <geert@linux-m68k.org>
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
- "\<" and "\>" can be safely replaced with "<" and ">"
- "$var =~ /^string$/" is better written "$var eq 'string'"
- $i is better written without the double quotes
- it's not safe to use for without "my"ing the iteration variable
- "print foreach @array" is better written "print @array"
- declare variables
- ".*" is useless at the end of a regexp
- "$a[@a] = $foo" is a rather obfuscated syntax for "push @a, $foo"...
let's not opencoding language basic operators...
- ignoring return value from a regexp is very bad: this can results in
working on previous value of $1, $2, ...
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
On i386, stack usually grows with "sub $0x8,%esp" and shrinks with
"add $0x8,%esp" respectively. In some cases, though, stack grows with
"add $0xffffff80,%esp" and shrinks with "sub $0xffffff80,%esp".
Obviously, we don't want to miss those cases.
Since in either case add and sub seem to be balanced and contain the
same parameter, we don't need a second regex. We simply accept hex
numbers of up to 8 digits and treat them as negative numbers when the
sub appears to be a little too high.
...or so I thought. But another day of testing proved me wrong again.
Some functions do stuff like "sub $0x10,%esp", ..., "add $0x20,%esp".
In other words, add and sub are *NOT* balanced. Manual inspection
showed that 0x20 is a more realistic number, so I accept either
variant, just in case. We pay for this with a bunch of duplicates in
our output, but that beats missing some stack hogs.
In the long run, this script has to be replaced by gcc options,
really. Looking at the result and guessing back is such a stupid
idea.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
|
|
Jorn Engel <joern@wohnheim.fh-wedel.de>
Adds a `make checkstack' target. This disassembles and parses vmlinux and
*.ko, generating a sorted list of stack hogs, eg:
0xc0100663 huft_build: 1456
0xc01022d3 huft_build: 1456
0xc0103127 inflate_dynamic: 1328
0xc0101487 inflate_dynamic: 1324
0xc010131f inflate_fixed: 1168
0xc0102fb7 inflate_fixed: 1168
0x00000003 sha512_transform: 984
0xc024aee3 Vpd: 952
0x00000003 twofish_setkey: 804
0x000060c3 isd200_action: 792
0x0000e6cb nfsd4_proc_compound: 760
0xc0249087 SkPnmiGetStruct: 712
....
Supported architectures are alleged to be arm, x86, ia64, mips, mips64, ppc,
ppc64 and s390x.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|