summaryrefslogtreecommitdiff
path: root/scripts/stackusage
blob: 56ef1ab670acc06700bf92fc322e0ae87831c511 (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
34
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

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}"
608490b017bfc2d48'>Merge tag 'modules-6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/...Linus Torvalds 2023-01-31kbuild: modinst: Fix build error when CONFIG_MODULE_SIG_KEY is a PKCS#11 URIJan Luebbe 2023-01-25kbuild: Modify default INSTALL_MOD_DIR from extra to updatesLuis Chamberlain 2022-12-14kbuild: change module.order to list *.o instead of *.koMasahiro Yamada 2022-12-13kbuild: add read-file macroMasahiro Yamada 2022-12-13kbuild: do not sort after reading modules.orderMasahiro Yamada 2022-07-27kbuild: error out if $(INSTALL_MOD_PATH) contains % or :Masahiro Yamada 2022-07-10kbuild: remove unused cmd_none in scripts/Makefile.modinstMasahiro Yamada 2022-01-08kbuild: do not quote string values in include/config/auto.confMasahiro Yamada 2022-01-08kbuild: stop using config_filename in scripts/Makefile.modsignMasahiro Yamada