how to use elf-size-analyze
git: https://github.com/jedrzejboczar/elf-size-analyze
env windows 10
installation
- open cmd terminal, install python;
- execute “pip install elf-size-analyze” to install tool;
run tool
- execute “elf-size-analyze -t riscv32-elf- -w 120 -HaRF xxx.elf -W > index.html”
cautious:
first execute will get warning:
"elf_size_analyze\html\gen.py, line 16, in generate_html_output
css_styles = f.read()
UnicodeDecodeError: ‘gbk’ codec can’t decode byte 0xa6 in position 477: illegal "
solution:
navigate to “C:\Users\Admin\AppData\Local\Programs\Python\Python39\Lib\site-packages\elf_size_analyze\html\gen.py”
modify the line 15 from
“with open(custom_css) as f:”
to
“with open(custom_css, encoding=‘utf-8’, errors=‘ignore’) as f:”;
change default read format from gbk to utf-8(elf is in utf-8 format); then retry step 1;
- get the analysis file “index.html”