writeCallGrindFile: Write Out Profile Data in Callgrind Format

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Writes the profile data in callgrind format suitable for use with kcachegrind or qcachegrind.

Usage

1
writeCallgrindFile(pd, file = "Rprof.cg", GC = TRUE, dropSource = TRUE)

Arguments

pd

profile data as returned by readProfileData.

file

a connection or the name of the file where the callgrind output will be written.

GC

logical; if true include GC information.

dropSource

logical; if true drop initial stack entried from a source call and add a top level marker.

Details

The callgrind format is used by Valgrind's callgrind tool. The KDE tool kcachegrind can be used to display the file; kcachegrind displays the summary statistics, a call graph, and annotated source code if source information is available. kcachegrind is available in Linux and Windows; on Mac OSX qcachegrind is available.

Value

Used for side effect.

Author(s)

Luke Tierney

See Also

Rprof, summaryRprof, flatProfile, readProfileData, plotProfileCallGraph, profileCallGraph2Dot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
pd <- readProfileData(system.file("samples", "glmEx.out", package="proftools"))
tmp <- tempfile()
writeCallgrindFile(pd, file = tmp)
file.show(tmp)
unlink(tmp)
## Not run: 
## If you have kcachegrind installed on a UNIX-like system then do:
tmp <- tempfile()
writeCallgrindFile(pd, file = tmp)
system(sprintf("kcachegrind 
unlink(tmp)
  
## End(Not run)

ltierney/Rpkg-proftools documentation built on July 12, 2020, 5:21 p.m.