https://github.com/torvalds/linux
Revision 92c4bc9f9cd92a8581e36bc5105f03b569f37e36 authored by Peter Zijlstra on 22 September 2017, 16:13:36 UTC, committed by Ingo Molnar on 29 September 2017, 08:09:08 UTC
Bit patterns are easier in hex.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 1593baa
Raw File
Tip revision: 92c4bc9f9cd92a8581e36bc5105f03b569f37e36 authored by Peter Zijlstra on 22 September 2017, 16:13:36 UTC
sched/debug: Convert TASK_state to hex
Tip revision: 92c4bc9
stackusage
#!/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}"
back to top