$ remake --profile[=callgrind|json] # target...
The --profile option enables dependency and timing output
from build execution. The data can be used to determine where your
build system spends it’s time. By default, the --profile
option outputs profiling data in the callgrind format
4 which
can be used with
kcachegrind5
or other
tools6 that work with this
format. Each recursive call to GNU Remake generates its own
output in the starting directory named callgrind.out.<pid>
where pid is the PID of the GNU Remake process.
By default, profiling data is written in the same directory where
GNU Remake is executed. This includes recursive calls. The
--profile-directory argument can be used to specify a
single directory for all profiling data. This is taken to
be relative to the initial invocation of GNU Remake unless
the path begins with ~ or /.
The --profile option also accepts a json flag that
will output profiling data in json-formatted files. With the following
formatting:
{
"version":"1.0.0",
"pid":1234,
"parent":{
"pid":1230,
"target":"target-name"
},
"jobs": 8,
"server": true,
"creator":"remake"
"argv":[
"arg0",
"arg1",
"arg2"
],
"directory":"path/to/working/dir",
"status":"Normal program termination",
"start":1235.6789,
"end":1240.0123,
"resolution":1000,
"entry":[
"all",
"other"
],
"targets":[
{
"name":"all",
"file":"path/to/file/with/target",
"line":100,
"start":123.123,
"deps":null,
"recipe":124.0,
"end":124.124,
"depends":[
"dependent",
"target0",
"target1",
"target2"
]
}
]
}
versionThe version field specifies the version of build.json file.
pidThe PID of the GNU Remake execution that created this file
parent.pidIf present, this PID of the GNU Remake process that recursively called the current GNU Remake process
parent.targetIf present, the name of the target the parent GNU Remake process that recusively called the current GNU Remake process.
jobsIf present, either unlimited when parallel jobs were not restricted. Or
an integer value reprenting the maximum number of available jobs.
serverTrue if connected to a jobserver
creatorA string representing the version of GNU Remake that generated this file
argvAn array of strings that represent the command used to start GNU Remake
directoryPath to the starting directory, generally the path current directory or the value
passed to GNU Remake with -C path/to/subdir
statusString representing what caused GNU Remake to exit
startTimestamp in seconds representing when GNU Remake started
endTimestamp in seconds representing when GNU Remake ended
resolutionNumber of nanoseconds specifying the minimum resolution of timestamps in the output
entryAn array of targets that were requested to be built.
targetsAn array of target specifications
nameName of the target
filePath to the file that contains the target definition relative to the top-level
directory field
lineLine number of the name target in the file field
startTimestamp when the target was first considered by GNU Remake
depsTimestamp when GNU Remake marked the target as waiting on dependencies.
Or null if it was not marked as waiting.
recipeTimestamp when the recipe for the target began execution. Or null if
the recipe did not need to execute.
endTimestamp when the target was considered complete
dependsArray of target names that this target depended on.
http://valgrind.org/docs/manual/cl-format.html
http://kcachegrind.sourceforge.net/html/Home.html
https://github.com/icefox/callgrind_tools, https://github.com/zenkj/callgrind2dot