diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-11-04 01:45:16 +0300 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-11-04 01:45:16 +0300 |
| commit | 84a73014d86fd660822a20c032625e3afe99ca58 (patch) | |
| tree | 9e42a2d3c40730947ae18363d00e8a0ee2743792 /scripts/stackusage | |
| parent | 195562194aad3a0a3915941077f283bcc6347b9b (diff) | |
| parent | bf5f18d708802737fa0db6306f6b9148f85b2efd (diff) | |
| download | linux-84a73014d86fd660822a20c032625e3afe99ca58.tar.xz | |
Merge branch 'next' into for-linus
Prepare first round of input updates for 4.3 merge window.
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}" |
