Skip to content

Commit 7baa1ea

Browse files
committed
[Build] Add build stats to track
See also [PlatformIO docs](http://docs.platformio.org/en/latest/faq.html#program-memory-usage) and esp8266/Arduino#3740 (comment)
1 parent d4207ec commit 7baa1ea

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ addons:
1818
apt:
1919
packages:
2020
- cppcheck
21-
21+
- binutils
2222

2323

2424
install:

before_deploy

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ if [ -d "docs/build" ]; then
3030
cp -r docs/build/* ${TMP_DIST}/docs/
3131
fi
3232

33+
mkdir -p ${TMP_DIST}/memstats
34+
3335
for ENV in \
3436
dev_ESP8266_4M\
3537
esp-wrover-kit_test_1M8_partition\
@@ -95,6 +97,16 @@ do
9597
else
9698
echo "Build too large for $ENV $FILESIZE > $MAX_FILESIZE "
9799
fi
100+
101+
ELFFILE=`echo ".pioenvs/${ENV}/firmware.elf"`
102+
if [ -f $ELFFILE ]; then
103+
SYMBOLS_STATS=`echo "${TMP_DIST}/memstats/${ENV}_symbols.txt"`
104+
STRINGS_STATS=`echo "${TMP_DIST}/memstats/${ENV}_strings.txt"`
105+
readelf -a ${ELFFILE} |grep 3ff |sort -n -k 3 > ${SYMBOLS_STATS}
106+
objdump -s -j .rodata ${ELFFILE} > ${STRINGS_STATS}
107+
gzip ${SYMBOLS_STATS}
108+
gzip ${STRINGS_STATS}
109+
fi
98110
done
99111

100112
#create a source structure that is the same as the original ESPEasy project (and works with the howto on the wiki)

src/WebServer.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3861,8 +3861,8 @@ void handle_tools() {
38613861
SPIFFS.info(fs_info);
38623862
if ((fs_info.totalBytes - fs_info.usedBytes) / 1024 > 50) {
38633863
TXBuffer += F("<TR><TD>");
3864-
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>";
3865-
TXBuffer += "<a class=\"button link wide\" onclick=\"downloadUI()\">download new ui</a>";
3864+
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>");
3865+
TXBuffer += F("<a class=\"button link wide\" onclick=\"downloadUI()\">download new ui</a>");
38663866
TXBuffer += F("</TD><TD>Download new UI</TD></TR>");
38673867
}
38683868
#endif

tools/build_ESPeasy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Needed packages:
77
# sudo apt-get update
88
# sudo apt-get upgrade
9-
# sudo apt install python-minimal virtualenv build-essential zip
9+
# sudo apt install python-minimal virtualenv build-essential zip binutils
1010

1111
VENV=~/.venv/python2.7
1212
SRC=~/GitHub/letscontrolit/ESPEasy

0 commit comments

Comments
 (0)