plotProfileCallGraph {proftools} | R Documentation |
Plot Call Graph for Rprof Profile Data
Description
Uses the graph and Rgraphviz packages to plot a call graph for
profile data produced by Rprof
.
Usage
plotProfileCallGraph(pd, layout = "dot",
score = c("none", "total", "self"),
transfer = function(x) x, nodeColorMap = NULL,
edgeColorMap = NULL, mergeCycles = FALSE,
edgesColored = FALSE, rankDir = c("TB", "LR"),
nodeDetails = FALSE, edgeDetails = FALSE,
nodeSizeScore = c("none", "total", "self"),
edgeSizeScore = c("none", "total"),
shape = "ellipse", style, GC = TRUE,
maxnodes = NA, total.pct = 0, ...)
Arguments
pd |
profile data as returned by |
layout |
The layout method to use: One of |
score |
character string specifying whether to use total time or self time for coloring nodes/edges; no color used if missing. |
transfer |
function; maps score values in unit interval to unit interval |
nodeColorMap , edgeColorMap |
character vectors of color
specifications as produced by |
mergeCycles |
logical; whether to merge each cycle of recursion into a single node |
edgesColored |
logical; whether to color edges |
rankDir |
The direction that the plot is laid out in, one of
either |
nodeDetails , edgeDetails |
logical; whether count information should be shown. |
nodeSizeScore |
character; value to encode in the size of the nodes. |
edgeSizeScore |
character; value to encode in the width of the edges. |
shape |
character; node shape. |
style |
named list of values for arguments |
... |
additional arguments for the |
GC |
logical; include GC information or not. |
maxnodes |
integer; maximal number of nodes to use; nodes with lower total hit counts are dropped. |
total.pct |
numeric; if positive, nodes with hit percentages below this level are dropped. |
Details
Color is used to encode the fraction of total or self time spent in
each function or call. The scores used correspond to the values in
the printed representation produced by printProfileCallGraph
.
For now, see the gprof
manual for further details. The color
encoding for a score s
and a color map m
is
m[ceiling(length(m) * transfer(s))]
A style can be specified to set options to a set of cvalues that work well together.
Value
Used for side effect.
Note
Because of lazy evaluation, nested calls like f(g(x))
appear in the profile graph as f
or one of its callees
calling g
.
Calls to functions with names containing a |
character are
dropped as they cause problems in the graph package.
Author(s)
Luke Tierney
References
User manual for gprof
, the GNU profiler.
Graphviz: https://graphviz.gitlab.io/download/
See Also
Rprof
,
summaryRprof
,
readProfileData
,
flatProfile
,
profileCallGraph2Dot
printProfileCallGraph
plain.style
google.style
Examples
pd <- readProfileData(system.file("samples", "glmEx.out", package="proftools"))
plotProfileCallGraph(pd)
plotProfileCallGraph(pd, score = "none")
plotProfileCallGraph(pd, style = plain.style, score = "total")