callTreeGraphs {proftools}R Documentation

Call Tree Graphs

Description

Produce a flame graph or a callee tree map for the call tree in a profile stack trace.

Usage

flameGraph(pd, svgfile, order = c("hot", "alpha", "time"),
           colormap = NULL, srclines = FALSE, cex = 0.75,
           main = "Call Graph", tooltip = FALSE)

calleeTreeMap(pd, srclines = FALSE, cex = 0.75, colormap = NULL,
              main = "Callee Tree Map", squarify = FALSE, border = NULL)

## S3 method for class 'proftools_calleeTreeMap'
identify(x, n = 1, print = FALSE, ...)

## S3 method for class 'proftools_flameGraph'
identify(x, n = 1, print = FALSE,
                                        outline = FALSE, ...)

Arguments

pd

profile data as returned by readProfileData.

svgfile

character; name for SVG output file.

order

character; see details below.

colormap

a function or NULL; see details below.

srclines

logical; include source information, if available, or not.

cex

numeric character expansion value.

main

character; plot title.

tooltip

logical; whether SVG should show details in tooltips.

border

character or NULL; border color for rectangles.

squarify

logical; whether the squarified tiling algorithm should be used.

x

flameGraph of calleeTreeMap object to use.

n

integer; number of items to identify.

print

logical; whether to print result on each click.

outline

logical; whether to outline rectangles corresponding to identified call.

...

Further arguments for the identify methods; currently ignored.

Details

calleeTreeMap shows a tree map of the calls in a stack trace's call tree. The tiling algorithm used depends on the squarify argument. If squarify is TRUE then the squarified algorithm is used; otherwise, the longer side is partitioned.

flameGraph produces a flame graph of the call tree. The vertical positions of rectangles represent call depth on the stack. The widths of the rectangles represent the amount of time spent in a call at a particular call or set of calls at a particular depth. The order argument determines the ordering of call rectangles at a particular level within a call at the lower level. The "alpha" ordering orders the calls alphabetically; "hot" uses the hot path ordering with the call with the largest amount of time first. The "time" ordering preserves the original time ordering within the stack trace file.

Default colors are based on the rainbow palette. Alternative colors can be specified by a colormap function. This function is called with three argument vectors, with one element for each rectangle. The arguments are the function name, call depth, and number of hits.

The results returned by flameGraph and calleeTreeMap can be passed to identify. The identify method for calleeTreeMap returns a list of the call stacks for the identified rectangles. The identify method for flameGraph returns a character vector of the labels of the identified rectangles.

Value

Objects that can be used with identify.

Author(s)

Luke Tierney

See Also

Rprof, summaryRprof, flatProfile, filterProfileData, readProfileData, plotProfileCallGraph, profileCallGraph2Dot, hotPaths

Examples

pd <- readProfileData(system.file("samples", "glmEx.out", package="proftools"))
flameGraph(pd)
calleeTreeMap(pd)

[Package proftools version 0.99-3 Index]