diff options
| author | Takashi Iwai <tiwai@suse.de> | 2015-09-24 14:02:48 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2015-09-24 14:02:48 +0200 |
| commit | db25f440f42eca380fcdb339f51cf73633e32485 (patch) | |
| tree | d67c8ec502c2ce8b1382538545ee1b8a439dc6e2 /scripts/stackusage | |
| parent | 145d92e77e6f34f53773fdb06789816ec2b6c7b3 (diff) | |
| parent | 83510441bc08bee201c0ded9d81da6dfd008d69a (diff) | |
Merge branch 'for-linus' into for-next
Diffstat (limited to 'scripts/stackusage')
| -rwxr-xr-x | scripts/stackusage | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/scripts/stackusage b/scripts/stackusage new file mode 100755 index 000000000000..8cf26640ef8a --- /dev/null +++ b/scripts/stackusage @@ -0,0 +1,33 @@ +#!/bin/sh + +outfile="" +now=`date +%s` + +while [ $# -gt 0 ] +do + case "$1" in + -o) + outfile="$2" + shift 2;; + -h) + echo "usage: $0 [-o outfile] <make options/args>" + exit 0;; + *) break;; + esac +done + +if [ -z "$outfile" ] +then + outfile=`mktemp --tmpdir stackusage.$$.XXXX` +fi + +KCFLAGS="${KCFLAGS} -fstack-usage" make "$@" + +# Prepend directory name to file names, remove column information, +# make file:line/function/size/type properly tab-separated. +find . -name '*.su' -newermt "@${now}" -print | \ + xargs perl -MFile::Basename -pe \ + '$d = dirname($ARGV); s#([^:]+:[0-9]+):[0-9]+:#$d/$1\t#;' | \ + sort -k3,3nr > "${outfile}" + +echo "$0: output written to ${outfile}" |
