Browse Source

Symbols analyzer script

fastled^2
Xose Pérez 6 years ago
parent
commit
d337d5212e
1 changed files with 57 additions and 0 deletions
  1. +57
    -0
      code/symbols.sh

+ 57
- 0
code/symbols.sh View File

@ -0,0 +1,57 @@
#!/bin/bash
# ------------------------------------------------------------------------------
# CONFIGURATION
# ------------------------------------------------------------------------------
ENVIRONMENT="wemos-d1mini-relayshield"
READELF="xtensa-lx106-elf-readelf"
NUMBER=20
# ------------------------------------------------------------------------------
# END CONFIGURATION - DO NOT EDIT FURTHER
# ------------------------------------------------------------------------------
# remove default trace file
rm -rf $FILE
function help {
echo
echo "Syntax: $0 [-e <environment>] [-n <number>]"
echo
}
# get environment from command line
while [[ $# -gt 1 ]]; do
key="$1"
case $key in
-e)
ENVIRONMENT="$2"
shift
;;
-n)
NUMBER="$2"
shift
;;
esac
shift # past argument or value
done
# check environment folder
if [ $ENVIRONMENT == "" ]; then
echo "No environment defined"
help
exit 1
fi
ELF=.pioenvs/$ENVIRONMENT/firmware.elf
if [ ! -f $ELF ]; then
echo "Could not find ELF file for the selected environment: $ELF"
exit 2
fi
$READELF -s $ELF | head -3 | tail -1
$READELF -s $ELF | sort -r -k3 -n | head -$NUMBER

Loading…
Cancel
Save