mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-30 06:32:43 +00:00
tool/metrics: add label header to metrics.tsv
This commit is contained in:
parent
8fb780d83e
commit
cfc3484e52
@ -48,7 +48,10 @@ SRCS = \
|
||||
all: metrics.md metrics.html metrics.txt
|
||||
|
||||
metrics.tsv: ${SRCS}
|
||||
ccsm --disable-file --disable-global --exclude-std-headers --exclude-file=.h$$ --output-format=tsv --output-metrics=HIS_.* $^ -- -DuECC_NO_DEFAULT_RNG -isystem ${C_HEADERS}/c90 -isystem ${C_HEADERS}/c99 ${INCLUDES} > $@
|
||||
ccsm --disable-file --disable-global --exclude-std-headers --exclude-file=.h$$ --output-format=tsv --output-metrics=HIS_.* $^ -- -DuECC_NO_DEFAULT_RNG -isystem ${C_HEADERS}/c90 -isystem ${C_HEADERS}/c99 ${INCLUDES} > metrics_raw.tsv
|
||||
echo "# file\tfunction\tGOTO\tRETURN\t_\tSTMT \t_\tCCN\tPATH\tCALLS\tPARAM\tLEVEL\t_\t_\t_" > metrics_header.tsv
|
||||
cat metrics_header.tsv metrics_raw.tsv > $@
|
||||
rm metrics_header.tsv metrics_raw.tsv
|
||||
|
||||
metrics.md: metrics.tsv metrics_ccsm.py
|
||||
./metrics_ccsm.py > metrics.md
|
||||
@ -57,8 +60,7 @@ metrics.html: metrics.md
|
||||
pandoc --from markdown --to html -o metrics.html metrics.md
|
||||
|
||||
metrics.txt: metrics.tsv
|
||||
echo "file\tfunction\tGOTO\tRETURN\t_\tSTMT \t_\tCCN\tPATH\tCALLS\tPARAM\tLEVEL\t_\t_\t_" > metrics_header.tsv
|
||||
cat metrics_header.tsv metrics.tsv | expand -t 70,160,170,180,190,210,220,230,240,250,260,270,280,290,300 > metrics.txt
|
||||
expand -t 70,160,170,180,190,210,220,230,240,250,260,270,280,290,300 metrics.tsv > metrics.txt
|
||||
|
||||
clean:
|
||||
rm -f metrics.tsv metrics.md metrics.txt metrics.html metrics_header.tsv
|
||||
rm -f metrics.tsv metrics.md metrics.txt metrics.html metrics_header.tsv metrics_raw.tsv
|
||||
|
@ -102,6 +102,10 @@ def analyze_folders(btstack_root, folders, metrics_file):
|
||||
for row in rd:
|
||||
file = ''
|
||||
function_metrics = {}
|
||||
# skip optional header
|
||||
if row[0].startswith('#'):
|
||||
continue
|
||||
|
||||
for key, value in zip(fields, row):
|
||||
if key == 'file':
|
||||
# get rid of directory traversal on buildbot
|
||||
|
Loading…
x
Reference in New Issue
Block a user