~aleteoryx/muditaos

ref: e35fca8524dfe78c3076073d20bedad897e876a7 muditaos/tools/stack-usage.sh -rwxr-xr-x 591 bytes
e35fca85 — Lefucjusz [MOS-1064] Fix no input language selected for French/Spanish 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/bash
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/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