profileD is a GTK2 GUI to display dmd's profiling information in a sorted
table with readable (demangled) function names.
How to build:
* Install the needed tools and libraries:
- Install dmd (v1) and libphobos (for D1)
- Under Arch Linux: sudo pacman -S dmd libphobos
- Or from http://www.digitalmars.com/d/download.html
- Install Code::Blocks (optional)
- Under Arch Linux: sudo pacman -S codeblocks
- Or from http://www.codeblocks.org/
- Install dsss
- Under Arch Linux: sudo pacman -S dsss
- Or from http://www.dsource.org/projects/dsss
- Get GtkD from http://www.dsource.org/projects/gtkd
- Open a terminal, unpack GtkD's archive and go inside the gtkd directory
- Run "dsss install"
(note: this will build a bunch of libs I'm not using and copy them to
~/d/lib/, but will also copy the includes profileD needs to ~/d/include/)
Alternatively, see http://www.dsource.org/projects/gtkd/wiki/BuildingWithDSSS
- Run "make gtkd"
- Copy libgtkd.a to your d libs directory (~/d/lib/)
* To build without Code::Blocks:
dmd -release -O -I/usr/lib/phobos -I~/d/include/d -c main.d
gcc -o profiled -L~/d/lib main.o -ldl -lgtkd -lphobos -lpthread
(Can probably be done with a one-liner and without gcc, too.)
* To build with Code::Blocks:
In Code::Blocks, Compiler Settings:
- Select Global compiler settings, Digital Mars D Compiler
- Linker settings:
- Link libraries:
- Other linker options:
-L/home/<your user name>/d/lib
- Search directories
- Toolchain executables
- Click "Auto-detect", I guess. Or type (in field order):
Now you are ready to open the profiled.cbp project in Code::Blocks and build it.
Copy profiled (from the bin/Release or bin/Debug directory if you used
Code::Blocks) into your path (maybe /usr/local/bin/).
How to use profileD:
- Build your project with the -profile option.
- Delete any old "trace.*" file.
- Run your project, do stuff, and exit.
- Run profiled from the directory containing the "trace.log" of your project,
or run "profiled /path/to/trace.log".
- Click on a column header to sort the table by this column.
Num calls : Number of times this function was called.
Tree time : Total time spent inside this function or in functions called by
% : Tree time / tree time of main().
Func time : Time spent inside this function (but not in functions called by
% : Func time / tree time of main().
Avg Func time: Average time taken by one call of this function.
Olivier Fabre (off -at- free.fr)
profileD is released under the MIT licence.
(See LICENCE or http://www.opensource.org/licenses/mit-license)