summaryrefslogtreecommitdiff
path: root/scripts/stackusage
blob: 8cf26640ef8a989a7d667bb6fad67f1afaea9336 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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}"
77ab9de37abf2c01c5b44f'>Merge tag 'sysctl-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/...Linus Torvalds 2022-04-29kexec: remove redundant assignmentsMichal Orzel 2022-04-25kernel/kexec_core: move kexec_core sysctls into its own fileyingelin 2022-04-14ELF: Remove elf_core_copy_kernel_regs()Brian Gerst 2021-12-13exit: Move oops specific logic from do_exit into make_task_deadEric W. Biederman