https://github.com/antonmeep/profdump
Processes profiling output of the D compiler
https://github.com/antonmeep/profdump
cli converter dlang dot graph json profiler
Last synced: 11 months ago
JSON representation
Processes profiling output of the D compiler
- Host: GitHub
- URL: https://github.com/antonmeep/profdump
- Owner: AntonMeep
- License: mit
- Created: 2017-04-30T16:36:40.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-07-05T19:22:27.000Z (almost 5 years ago)
- Last Synced: 2025-07-15T09:43:28.578Z (11 months ago)
- Topics: cli, converter, dlang, dot, graph, json, profiler
- Language: D
- Homepage:
- Size: 4.85 MB
- Stars: 15
- Watchers: 1
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
profdump [](http://code.dlang.org/packages/profdump)
[](https://github.com/AntonMeep/profdump/blob/master/LICENSE)
=============
profdump converts output of D programming language profiler into:
- Plain text
- JSON
- DOT graph
## Why?
Because profiler gives you [this](./example/simple.log). It's very hard to read and understand it.
profdump can convert it to:
- [plain text](./example/sample/simple.txt)
- [json](./example/sample/simple.json)
or just draw this beautiful graph:

## Usage
```
Usage: profdump [options] [input file] [output file]
Converts the output of dlang compiler into a plain text, json or dot graph.
If input file is not specified, looks for 'trace.log' file.
You can set input and output file to stdin/stdout by passing '-' instead of file name.
Options:
-p --plain print detailed information about functions (default)
-j --json print JSON
-d --dot output dot graph
-b --blame print list of functions ordered by time
-t --threshold (% of main function) hide functions below this threshold (default: 0.0)
--pretty prettify JSON output (default: true)
--colour customize colours of dot graph nodes (default: [0:"limegreen", 10:"slateblue", 50:"royalblue", 95:"red", 25:"steelblue", 75:"navy"])
-f --force overwrite output file if exists
-v --verbose do not minimize function names
-h --help This help information.
```
## Graph output
Every node represents a function and has the following layout:
```
+----------------------------+
| Function name |
| total time % (self time %) |
+----------------------------+
```
And edge represents the calls between two functions and has the following layout:
```
calls
parent --------------> child
```
## Plain text output
Prints everything. Basically converts `trace.log` making it easier to read.
Check out examples:
- [Simple example](./example/sample/simple.txt)
- [Profdump's trace.log dump](./example/sample/profdump.txt)
## `--blame` option
Prints functions ordered by time:
```
void main() 0.01277s 100.00%
ulong example.fib(..) 0.01153s 90.25%
int example.child2(..) 0.00012s 0.91%
int example.child1(..) 0.00002s 0.12%
int example.sum(..) 0.00000s 0.03%
```
## JSON output
Has the following layout:
```
{
"functions": [
{
"name": , // Demangled name of function
"mangled": , // Mangled name of function
"time": , // Time spent on this function and all its children in ticks
"timeSec": , // Time spent on this function and all its children in seconds
"functionTime": , // Time spent on this function in ticks
"functionTimeSec": , // Time spent on this function in seconds
"perc": , // Time spent on this function and all its children in % of main function time
"functionPerc": , // Time spent on this function in % of main function time
"callsTo": [ // All children which are called by this function
{
"name": , // Demangled name of children
"mangled": , // Number of calls
}
<...>
],
"calledBy": [ // All functions that call this function
{
"name": , // Demangled name of parent
"mangled": , // Number of calls
}
<...>
]
}
<...>
],
"tps": // Number of ticks per second
}
```