Scroll to navigation

XRPROF(1) General Commands Manual XRPROF(1)

NAME

xrprof - profile R programs

SYNOPSIS

xrprof [-h] [-m] [-F FREQ] [-d DURATION] [-o FILE] -p PID

DESCRIPTION

A sampling profiler for R(1) programs. xrprof writes to standard output the Rprof.out format widely used by existing R-based tools.

OPTIONS

Malformed arguments will fall back on the defaults, if possible.

Print usage and exit.
Specify the pid of the target R program.
Set the sampling frequency, in Hertz. The default is 1 Hz, i.e. one sample per second, and the maximum is 1000 Hz (though far fewer samples are usually required).
Set the duration for xrprof to take samples before exiting (provided the target program runs that long). The default is to last up to one hour.
Write output to FILE instead of standard output.
Run in “mixed mode”, where samples are drawn from both the R-level and native C/C++ stacks and collated together.

EXAMPLES

Sample from an existing R program for 5 seconds at a useful frequency:


$ xrprof -F 50 -d 5 -p `pidof R`

Start a new R program in the background and then start the profiler, writing samples to the file Rprof.out in the current directory:


$ Rscript myprogram.R &
$ xrprof -F 50 -p $! > Rprof.out

EXIT STATUS

0
Successful program execution.
1
A fatal error ocurred during sampling.

AUTHORS

xrprof was written by Aaron Jacobs.

SEE ALSO

R(1), Rscript(1)

2020-01-11