On Wednesday, 10 February 2021 at 23:42:31 UTC, mw wrote:
On Wednesday, 10 February 2021 at 11:52:51 UTC, JG wrote:
As a follow up question I would like to know what tool people
use to profile d programs?
I use this one:
https://code.dlang.org/packages/profdump
e.g.
```
dub build --build=debug --build=profile
# run your program to generate trace.log
profdump -b trace.log trace.log.b
profdump -f --dot --threshold 1 trace.log trace.log.dot
echo 'view it with: xdot trace.log.dot'
```
I tried to do this, but I am not sure how to install profdump.
What I did is cloned the repository using git.
Tried to build it using dub but got an error as described here:
https://github.com/AntonMeep/profdump/issues/6
I then modified the dub.json and got it to build but it only
produced a library. So I modified the dub.json again to tell
it to build an executable and got:
core.exception.AssertError@source/app.d(4): TODO
----------------
??:? [0x561af7b38025]
??:? [0x561af7b39aa6]
??:? [0x561af7b1cd8f]
??:? [0x561af7b15469]
app.d:4 [0x561af7aebc62]
??:? [0x561af7b1ca7b]
??:? [0x561af7b1c977]
??:? [0x561af7b1c7cd]
/home/james/dlang/ldc-1.26.0/bin/../import/core/internal/entrypoint.d:42
[0x561af7aebc94]
??:? __libc_start_main [0x7f5ba99accb1]
??:? [0x561af7aeb62d]
Program exited with code 1
I then looked inside source/app.d and found:
version(unittest) {
} else {
void main() { assert(0, "TODO"); }
}
How does one install profdump?