tools: add alloc2cover tool to convert heap allocation report to same…#5129
tools: add alloc2cover tool to convert heap allocation report to same…#5129deadprogram wants to merge 1 commit intodevfrom
Conversation
… format as go cover Signed-off-by: deadprogram <ron@hybridgroup.com>
|
Size difference with the dev branch: Binary size differencenot the same command!
tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/adafruit4650
go: downloading tinygo.org/x/tinyfont v0.3.0
not the same command!
tinygo build -size short -o ./build/test.hex -target=pico ./examples/tmc5160/main.go
go: downloading golang.org/x/exp v0.0.0-20241204233417-43b7b7cde48d
not the same command!
tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/websocket/dial/
go: downloading golang.org/x/net v0.33.0
not the same command!
tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/mqttclient/natiu/
go: downloading github.com/soypat/natiu-mqtt v0.5.1
not the same command!
tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/mqttclient/paho/
go: downloading github.com/eclipse/paho.mqtt.golang v1.2.0
flash ram
before after diff before after diff
18352 18352 0 0.00% 6212 6212 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/adafruit4650
61452 61452 0 0.00% 6156 6156 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adt7410/main.go
8624 8624 0 0.00% 4724 4724 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/adxl345/main.go
13404 13404 0 0.00% 6772 6772 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/amg88xx
8784 8784 0 0.00% 4724 4724 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/main.go
11632 11632 0 0.00% 6556 6556 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/apds9960/proximity/main.go
9600 9600 0 0.00% 4736 4736 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/apa102/itsybitsy-m0/main.go
7352 7352 0 0.00% 2296 2296 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/at24cx/main.go
7868 7868 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bh1750/main.go
7228 7228 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/blinkm/main.go
71412 71412 0 0.00% 3640 3640 0 0.00% tinygo build -size short -o ./build/test.hex -target=pinetime ./examples/bma42x/main.go
65320 65320 0 0.00% 6172 6172 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmi160/main.go
27524 27524 0 0.00% 4756 4756 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp180/main.go
64000 64000 0 0.00% 6196 6196 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/bmp280/main.go
11740 11740 0 0.00% 4788 4788 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bmp388/main.go
25040 25040 0 0.00% 5380 5380 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-rp2350 ./examples/bno08x/i2c/main.go
7684 7684 0 0.00% 3336 3336 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/sram/main.go
21592 21592 0 0.00% 3532 3532 0 0.00% tinygo build -size short -o ./build/test.hex -target=bluepill ./examples/ds1307/time/main.go
28948 28948 0 0.00% 4952 4952 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/alarms/main.go
42864 42864 0 0.00% 4952 4952 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/ds3231/basic/main.go
4400 4400 0 0.00% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/easystepper/main.go
70048 70048 0 0.00% 6956 6956 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/flash/console/spi
66888 66888 0 0.00% 8996 8996 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/flash/console/qspi
7068 7068 0 0.00% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/gc9a01/main.go
67664 67664 0 0.00% 6336 6336 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/i2c/main.go
68104 68104 0 0.00% 6480 6480 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/gps/uart/main.go
8204 8204 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/hcsr04/main.go
5528 5528 0 0.00% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/customchar/main.go
5568 5568 0 0.00% 2256 2256 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hd44780/text/main.go
10204 10204 0 0.00% 4724 4724 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/hd44780i2c/main.go
14508 14508 0 0.00% 6556 6556 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/hts221/main.go
15980 15980 0 0.00% 2340 2340 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/hub75/main.go
10220 10220 0 0.00% 6892 6892 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/basic
10968 10968 0 0.00% 4852 4852 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/basic
29588 29588 0 0.00% 38052 38052 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/pyportal_boing
10252 10252 0 0.00% 6892 6892 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/scroll
11052 11052 0 0.00% 4852 4852 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/ili9341/scroll
263716 263716 0 0.00% 46748 46748 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/ili9341/slideshow
10416 10416 0 0.00% 4756 4756 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis3dh/main.go
13892 13892 0 0.00% 6556 6556 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-33-ble ./examples/lps22hb/main.go
26188 26188 0 0.00% 2304 2304 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/lsm303agr/main.go
27960 27960 0 0.00% 6804 6804 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/lsm303dlhc/main.go
12172 12172 0 0.00% 4764 4764 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/lsm6ds3/main.go
9876 9876 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mag3110/main.go
9008 9008 0 0.00% 4748 4748 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017/main.go
9412 9412 0 0.00% 4756 4756 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp23017-multiple/main.go
9268 9268 0 0.00% 4724 4724 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp3008/main.go
71512 71512 0 0.00% 6172 6172 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mcp2515/main.go
27340 27340 0 0.00% 3776 3776 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/microbitmatrix/main.go
27220 27220 0 0.00% 5820 5820 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit-v2 ./examples/microbitmatrix/main.go
7324 7324 0 0.00% 4724 4724 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mma8653/main.go
7228 7228 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/mpu6050/main.go
76008 76008 0 0.00% 7428 7428 0 0.00% tinygo build -size short -o ./build/test.hex -target=p1am-100 ./examples/p1am/main.go
13992 13992 0 0.00% 5392 5392 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/pca9685/main.go
6244 6244 0 0.00% 3268 3268 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setbuffer/main.go
4628 4628 0 0.00% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/pcd8544/setpixel/main.go
12328 12328 0 0.00% 5368 5368 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/seesaw/soil-sensor
13636 13636 0 0.00% 5376 5376 0 0.00% tinygo build -size short -o ./build/test.hex -target=qtpy-rp2040 ./examples/seesaw/rotary-encoder
3113 3113 0 0.00% 560 560 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/servo
15644 15644 0 0.00% 5440 5440 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/sgp30
8048 8048 0 0.00% 6764 6764 0 0.00% tinygo build -size short -o ./build/test.hex -target=pybadge ./examples/shifter/main.go
57568 57568 0 0.00% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht3x/main.go
57560 57560 0 0.00% 3680 3680 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/sht4x/main.go
57568 57568 0 0.00% 3672 3672 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/shtc3/main.go
12564 12564 0 0.00% 8348 8348 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao-ble ./examples/ssd1306/
13400 13400 0 0.00% 5320 5320 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao-rp2040 ./examples/ssd1306/
13512 13512 0 0.00% 5320 5320 0 0.00% tinygo build -size short -o ./build/test.hex -target=thumby ./examples/ssd1306/
5892 5892 0 0.00% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ssd1331/main.go
6548 6548 0 0.00% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7735/main.go
6476 6476 0 0.00% 2260 2260 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/st7789/main.go
16636 16636 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/thermistor/main.go
9892 9892 0 0.00% 4516 4516 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-bluefruit ./examples/tone
9964 9964 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/tm1637/main.go
12536 12536 0 0.00% 5380 5380 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/touch/capacitive
8976 8976 0 0.00% 6756 6756 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/fourwire/main.go
12500 12500 0 0.00% 6952 6952 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal ./examples/touch/resistive/pyportal_touchpaint/main.go
15552 15552 0 0.00% 4724 4724 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl53l1x/main.go
14184 14184 0 0.00% 4724 4724 0 0.00% tinygo build -size short -o ./build/test.hex -target=itsybitsy-m0 ./examples/vl6180x/main.go
24588 24588 0 0.00% 13704 13704 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840-sense ./examples/waveshare-epd/epd1in54/main.go
6352 6352 0 0.00% 2300 2300 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13/main.go
5940 5940 0 0.00% 2292 2292 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd2in13x/main.go
6244 6244 0 0.00% 2300 2300 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/waveshare-epd/epd4in2/main.go
27940 27940 0 0.00% 18452 18452 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/waveshare-epd/epd2in66b/main.go
6748 6748 0 0.00% 4756 4756 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/ws2812
5386 5386 0 0.00% 9470 9470 0 0.00% '-xesppie' is not a recognized feature for this target (ignoring feature)
62872 62872 0 0.00% 5924 5924 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/is31fl3731/main.go
1853 1853 0 0.00% 600 600 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino ./examples/ws2812
1328 1328 0 0.00% 182 182 0 0.00% tinygo build -size short -o ./build/test.hex -target=digispark ./examples/ws2812
31976 31976 0 0.00% 4756 4756 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/bme280/main.go
16208 16208 0 0.00% 4700 4700 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/microphone/main.go
11596 11596 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/buzzer/main.go
12120 12120 0 0.00% 4756 4756 0 0.00% tinygo build -size short -o ./build/test.hex -target=trinket-m0 ./examples/veml6070/main.go
6656 6656 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/simple/main.go
8576 8576 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l293x/speed/main.go
6632 6632 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/simple/main.go
8980 8980 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/l9110x/speed/main.go
7244 7244 0 0.00% 3308 3308 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-f103rb ./examples/shiftregister/main.go
7020 7020 0 0.00% 2248 2248 0 0.00% '-xesppie' is not a recognized feature for this target (ignoring feature)
13136 13136 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=circuitplay-express ./examples/lis2mdl/main.go
11108 11108 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/max72xx/main.go
76560 76560 0 0.00% 6308 6308 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/dht/main.go
37496 37496 0 0.00% 6032 6032 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8523/
70948 70948 0 0.00% 6316 6316 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/alarm/
7036 7036 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/clkout/
70380 70380 0 0.00% 6312 6312 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/time/
70780 70780 0 0.00% 6316 6316 0 0.00% tinygo build -size short -o ./build/test.hex -target=xiao ./examples/pcf8563/timer/
13964 13964 0 0.00% 5344 5344 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/qmi8658c/main.go
12548 12548 0 0.00% 5328 5328 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-rp2040 ./examples/pcf8591/
8556 8556 0 0.00% 4724 4724 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina260/main.go
12148 12148 0 0.00% 4756 4756 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m0 ./examples/ina219/main.go
9232 9232 0 0.00% 5232 5232 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-l432kc ./examples/aht20/main.go
73864 73864 0 0.00% 10732 10732 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/sdcard/console/
61968 61968 0 0.00% 8204 8204 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-m4 ./examples/i2csoft/adt7410/
10220 10220 0 0.00% 6764 6764 0 0.00% tinygo build -size short -o ./build/test.elf -target=wioterminal ./examples/axp192/m5stack-core2-blinky/
10712 10712 0 0.00% 5316 5316 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/xpt2046/main.go
13072 13072 0 0.00% 4920 4920 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/sx126x/lora_rxtx/
33268 33268 0 0.00% 6804 6804 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/ssd1289/main.go
12880 12880 0 0.00% 6292 6292 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/irremote/main.go
14024 14024 0 0.00% 5392 5392 0 0.00% tinygo build -size short -o ./build/test.hex -target=badger2040 ./examples/uc8151/main.go
12184 12184 0 0.00% 5396 5396 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/scd4x/main.go
7808 7808 0 0.00% 4724 4724 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=circuitplay-express ./examples/makeybutton/main.go
9356 9356 0 0.00% 4740 4740 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ds18b20/main.go
122024 122024 0 0.00% 8076 8076 0 0.00% tinygo build -size short -o ./build/test.hex -target=nucleo-wl55jc ./examples/lora/lorawan/atcmd/
17752 17752 0 0.00% 6988 6988 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/as560x/main.go
11596 11596 0 0.00% 5336 5336 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu6886/main.go
7624 7624 0 0.00% 4716 4716 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ttp229/main.go
68976 68976 0 0.00% 6868 6868 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/ndir/main_ndir.go
62156 62156 0 0.00% 3768 3768 0 0.00% tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ndir/main_ndir.go
65200 65200 0 0.00% 6228 6228 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ndir/main_ndir.go
11044 11044 0 0.00% 5328 5328 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu9150/main.go
13444 13444 0 0.00% 5364 5364 0 0.00% tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/sh1106/macropad_spi
10068 10068 0 0.00% 5800 5800 0 0.00% tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/encoders/quadrature-interrupt
68432 68432 0 0.00% 6836 6836 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mcp9808/main.go
44080 44080 0 0.00% 7160 7160 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/tmc2209/main.go
15068 15068 0 0.00% 5324 5324 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/tmc5160/main.go
12276 12276 0 0.00% 4528 4528 0 0.00% tinygo build -size short -o ./build/test.uf2 -target=nicenano ./examples/sharpmem/main.go
62396 62396 0 0.00% 5960 5960 0 0.00% tinygo build -size short -o ./build/test.hex -target=feather-nrf52840 ./examples/max6675/main.go
14612 14612 0 0.00% 5384 5384 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/ens160/main.go
24732 24732 0 0.00% 5408 5408 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/si5351/main.go
29684 29684 0 0.00% 6788 6788 0 0.00% tinygo build -size short -o ./build/test.hex -target=pico ./examples/w5500/main.go
88048 88048 0 0.00% 7236 7236 0 0.00% tinygo build -size short -o ./build/test.hex -target=challenger-rp2040 ./examples/net/ntpclient/
347224 347224 0 0.00% 16772 16772 0 0.00% tinygo build -size short -o ./build/test.hex -target=pyportal -stack-size 8kb ./examples/net/http-get/
119744 119744 0 0.00% 8036 8036 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-nano33 -stack-size 8kb ./examples/net/tcpclient/
308492 308492 0 0.00% 15932 15932 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/websocket/dial/
103384 103384 0 0.00% 10016 10016 0 0.00% tinygo build -size short -o ./build/test.hex -target=metro-m4-airlift -stack-size 8kb ./examples/net/socket/
388692 388692 0 0.00% 18784 18784 0 0.00% tinygo build -size short -o ./build/test.hex -target=matrixportal-m4 -stack-size 8kb ./examples/net/webstatic/
166132 166132 0 0.00% 10008 10008 0 0.00% tinygo build -size short -o ./build/test.hex -target=arduino-mkrwifi1010 -stack-size 8kb ./examples/net/tlsclient/
155644 155644 0 0.00% 8820 8820 0 0.00% tinygo build -size short -o ./build/test.hex -target=nano-rp2040 -stack-size 8kb ./examples/net/mqttclient/natiu/
116564 116564 0 0.00% 13312 13312 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webclient/
338164 338164 0 0.00% 21848 21848 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/webserver/
338396 338396 0 0.00% 21756 21756 0 0.00% tinygo build -size short -o ./build/test.hex -target=wioterminal -stack-size 8kb ./examples/net/mqttclient/paho/
174468 174468 0 0.00% 13848 13848 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2040 -stack-size 8kb ./examples/net/tlsclient/
120088 120088 0 0.00% 11880 11880 0 0.00% tinygo build -size short -o ./build/test.hex -target=elecrow-rp2350 -stack-size 8kb ./examples/net/ntpclient/
6319876 6319876 0 0.00% 981760 981760 0 0.00%
|
| fmt.Fprintln(os.Stderr, "Usage: alloc2cover <input-file> <source-root> [module-path]") | ||
| fmt.Fprintln(os.Stderr, " Reads TinyGo -print-allocs output and converts to cover.out format") | ||
| fmt.Fprintln(os.Stderr, " source-root: path to the root of the source files") | ||
| fmt.Fprintln(os.Stderr, " module-path: optional Go module path prefix (e.g., github.com/user/repo)") | ||
| fmt.Fprintln(os.Stderr, " Heap allocations are marked as uncovered (red in coverage reports)") |
There was a problem hiding this comment.
can we do this using Go's standard library flag package for automatic documentation generation and straightforward way of adding more options in the future?
var (
flagInputFile, flagSourceRoot, flagModulePath string
)
flag.StringVar(&flagInputFile, "i", "", "Input to alloc2cover is the output of print-allocs")
flag.StringVar(&flagSourceRoot, "root", "", "path to the root of the source files")
flag.StringVar(&flagModulePath, "mod", "", "Optional Go module path prefix (e.g., github.com/user/repo)")There was a problem hiding this comment.
and checking inputs:
if flagInputFile == "" || flagSourceRoot == "" {
flag.PrintDefaults()
log.Fatal("invalid flags")
}|
Please do feel free to submit an alternative better PR! I was not going too far into this as of yet. |
|
Could we potentially output it in the correct format instead of adding a conversion step? |
I was initially trying that out, but it was somewhat tricky due to the output format that the However, that would be the best option no doubt. I will take another run at it and see if I can get further. |
This PR adds a new
alloc2covertool to convert the TinyGo heap allocation report produced by using the-print-allocsflag to the same format asgo coverproduces, so you can then see an HTML report of where the heap allocations occur.How to use: