Skip to content

Commit

Permalink
[Build] Add build stats to track
Browse files Browse the repository at this point in the history
  • Loading branch information
TD-er committed Mar 8, 2019
1 parent d4207ec commit 7baa1ea
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ addons:
apt:
packages:
- cppcheck

- binutils


install:
Expand Down
12 changes: 12 additions & 0 deletions before_deploy
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ if [ -d "docs/build" ]; then
cp -r docs/build/* ${TMP_DIST}/docs/
fi

mkdir -p ${TMP_DIST}/memstats

for ENV in \
dev_ESP8266_4M\
esp-wrover-kit_test_1M8_partition\
Expand Down Expand Up @@ -95,6 +97,16 @@ do
else
echo "Build too large for $ENV $FILESIZE > $MAX_FILESIZE "
fi

ELFFILE=`echo ".pioenvs/${ENV}/firmware.elf"`
if [ -f $ELFFILE ]; then
SYMBOLS_STATS=`echo "${TMP_DIST}/memstats/${ENV}_symbols.txt"`
STRINGS_STATS=`echo "${TMP_DIST}/memstats/${ENV}_strings.txt"`
readelf -a ${ELFFILE} |grep 3ff |sort -n -k 3 > ${SYMBOLS_STATS}
objdump -s -j .rodata ${ELFFILE} > ${STRINGS_STATS}
gzip ${SYMBOLS_STATS}
gzip ${STRINGS_STATS}
fi
done

#create a source structure that is the same as the original ESPEasy project (and works with the howto on the wiki)
Expand Down
4 changes: 2 additions & 2 deletions src/WebServer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3861,8 +3861,8 @@ void handle_tools() {
SPIFFS.info(fs_info);
if ((fs_info.totalBytes - fs_info.usedBytes) / 1024 > 50) {
TXBuffer += F("<TR><TD>");
TXBuffer += "<script>function downloadUI() { fetch('https://raw.githubusercontent.com/ppisljar/espeasy_new_ui/master/build/index.htm.gz').then(r=>r.arrayBuffer()).then(r => {var f=new FormData();f.append('file', new File([new Blob([new Uint8Array(r)])], 'index.htm.gz'));f.append('edit', 1);fetch('/upload',{method:'POST',body:f}).then(() => {window.location.href='/';});}); }</script>";
TXBuffer += "<a class=\"button link wide\" onclick=\"downloadUI()\">download new ui</a>";
TXBuffer += F("<script>function downloadUI() { fetch('https://raw.githubusercontent.com/ppisljar/espeasy_new_ui/master/build/index.htm.gz').then(r=>r.arrayBuffer()).then(r => {var f=new FormData();f.append('file', new File([new Blob([new Uint8Array(r)])], 'index.htm.gz'));f.append('edit', 1);fetch('/upload',{method:'POST',body:f}).then(() => {window.location.href='/';});}); }</script>");
TXBuffer += F("<a class=\"button link wide\" onclick=\"downloadUI()\">download new ui</a>");
TXBuffer += F("</TD><TD>Download new UI</TD></TR>");
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion tools/build_ESPeasy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Needed packages:
# sudo apt-get update
# sudo apt-get upgrade
# sudo apt install python-minimal virtualenv build-essential zip
# sudo apt install python-minimal virtualenv build-essential zip binutils

VENV=~/.venv/python2.7
SRC=~/GitHub/letscontrolit/ESPEasy
Expand Down

0 comments on commit 7baa1ea

Please sign in to comment.