Files
MuditaOS/tools/stack-usage.sh
Lefucjusz 773f2c7eb1 [BH-2069] Update license URL in headers
Update outdated license file URL in
license headers across all project.
2024-09-18 11:53:01 +02:00

25 lines
603 B
Bash
Executable File

#!/usr/bin/bash
# Copyright (c) 2017-2024, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/blob/master/LICENSE.md
# make sure, that GENERATE_STACK_USAGE option has been enabled in cmake configuration
builddir=$1
minsize=$2
pattern=$3
if [ -z "$builddir" ]; then
echo "usage $0 builddir [minsize] [file name pattern]"
exit 1
fi
if [ -z $minsize ]; then
minsize=0
fi
if [ -n "$pattern" ]; then
FILTER="| egrep $pattern"
fi
eval find $builddir -name "*.su" $FILTER | xargs awk '{if ( $(NF-1) > '$minsize') print $(NF-1)" "$0}' | sort -n