| Age | Commit message (Collapse) | Author |
|
Adapt checkstack.pl so that it works for metag.
Signed-off-by: James Hogan <james.hogan@imgtec.com>
|
|
Haavard's e-mail address at Atmel is no longer valid.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Havard Skinnemoen <hskinnemoen@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
|
Cleanup checkstack script:
* Turn on strict checking
* Fix resulting error message because the declaration syntax
was incorrect.
* Remove incorrect and misleading use of prototype
- prototype not required for this type of sort function
because $a and $b are being used in this contex
- if prototype was being used it should be for both arguments
* Use closure for sort function
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Cong Wang <amwang@redhat.com>
Cc: Michal Marek <mmarek@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>
|
|
Add sparc support to checkstack.
Signed-off-by: Martin Habets <errandir_news@mph.eclipse.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
With -march=z990 and later gcc can use the long displacement facility
insruction lay for stack register handling. This patch adopts checkstack
to catch lay in addition to ahi and aghi.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
|
|
uname -m was leaving a newline in $arch, and not passing the tests.
Also, printing the unknown arch on failure is probably helpful.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
Currently, checkstack.pl only looks for fixed subtractions from the stack
pointer. However, things like this:
void function(int size)
{
char stackbuster[size << 2];
...
are certainly worth pointing out, I think.
This could perhaps be done more cleanly, and the following patch only
adds "dynamic" REs for x86 and x86_64, but it works:
0x00b0 crypto_cbc_decrypt_inplace [cbc]: Dynamic (%rax)
0x00ad crypto_pcbc_decrypt_inplace [pcbc]: Dynamic (%rax)
0x02f6 crypto_pcbc_encrypt_inplace [pcbc]: Dynamic (%rax)
0x036c _crypto_xcbc_digest_setkey [xcbc]: Dynamic (%rax)
...
(Inspired by Keith Owens' old stack-check script)
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
I have been prime author and maintainer of block2mtd from day one, but
neither MAINTAINERS nor the module source makes this fact clear. And while
I'm at it, update my email addresses tree-wide, as the old address
currently bounces and change my name to "joern" as unicode will likely
continue to cause trouble until the end of this century.
Signed-off-by: Joern Engel <joern@lazybastard.org>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
hera.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6
* 'master' of hera.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6: (29 commits)
[PARISC] fix uninitialized variable warning in asm/rtc.h
[PARISC] Port checkstack.pl to parisc
[PARISC] Make palo target work when $obj != $src
[PARISC] Zap unused variable warnings in pci.c
[PARISC] Fix tests in palo target
[PARISC] Fix palo target
[PARISC] Restore palo target
[PARISC] Attempt to clean up parisc/Makefile
[PARISC] Fix infinite loop in /proc/iomem
[PARISC] Quiet sysfs_create_link __must_check warnings in pdc_stable
[PARISC] Squelch pci_enable_device __must_check warning in superio
[PARISC] Kill off broken irqstack code
[PARISC] Remove hardcoded uses of PAGE_SIZE
[PARISC] Clean up pointless ASM_PAGE_SIZE_DIV use
[PARISC] Kill off the last vestiges of ASM_PAGE_SIZE
[PARISC] Kill off ASM_PAGE_SIZE use
[PARISC] Beautify parisc vmlinux.lds.S
[PARISC] Clean up a resource_size_t warning in sba_iommu
[PARISC] Kill incorrect cast warning in unwinder
[PARISC] Kill zone_to_nid printk warning
...
Fixed trivial conflict in include/asm-parisc/tlbflush.h manually
|
|
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
|
|
Trivial change in a comment.
Signed-off-by: Joern Engel <joern@logfs.org>
Signed-off-by: Andre Haupt <andre@finow14.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
Simply fill out the bits in checkstack.pl for Blackfin. I thought I already
sent this, but I don't see it in -mm anywhere ...
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: Bryan Wu <bryan.wu@analog.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
Add regexes to recognize stack frame adjustments in AVR32 code.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
|
|
This patch adds 'powerpc' architecture support to checkstack.pl.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
|
|
Finding "init_module" high stack usage problems is challenging when there
are over 1600 "init_module" functions in the kernel tree, so make
checkstack.pl print out the filename where the stack usage occurs. This is
useful for code built as loadable modules.
For built-in code, it just prints the kernel image file name, like
"vmlinux". Examples:
(before patch:)
0x0000000d callback: 1928
0xffffffff81678c09 huft_build: 1560
0x0018 init_module: 1512
(after patch:)
0x0000000d callback [divacapi]: 1928
0xffffffff81678c09 huft_build [vmlinux]: 1560
0x0018 init_module [hdaps]: 1512
Also change one if-series to use elsif to cut down on unneeded tests.
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Joern Engel <joern@wh.fh-wedel.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Make it executable like it should be. Do the same for other files intended to be
executed by the user - the ones called by the build process needn't be
executable as they already work (as argument to their interpreter).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
|
|
Fix sort behavior when long names are encountered. The previour regular
expression depended on a tab to find the size in a string. For long names,
this tab no longer exists, so it is smarter to check for a colon instead.
For the kernel, this change shouldn't make a difference. But people
started using the same script for c++ code in other projects.
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>
|
|
Randy Dunlap found one case where checkstack reported a false
positive. From objdump of efi_stub.o:
5: 81 ea 00 00 00 c0 sub $0xc0000000,%edx
With the old code, this was interpreted as a negative number. The
output line was:
0xc0116f5d efi_call_phys: 1073741824
Randy wanted a change to return the correct number, like this:
0xc0116f5d efi_call_phys: 3221225472
adding "or I can just ignore it, like I've been doing for awhile..."
Let's help him with the most sophisticated electronic tools and have
the script actively ignore this case for him.
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>
|
|
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>
|