XRPROF(1)
π XRPROF π
okay so bestie, this is a page from the General Commands Manual, and the star of the show is xrprof β a whole tool for profiling R programs. yes, R as in the stats language. let's get into it π«Ά
β¨ NAME β¨
xrprof β profile R programs π
πΈ SYNOPSIS πΈ
xrprof [-h] [-m] [-F FREQ] [-d DURATION] [-o FILE] -p PID
π¦ DESCRIPTION π¦
It's a sampling profiler for R(1) programs, no cap. xrprof writes to standard output the Rprof.out format that literally all your existing R-based tools already vibe with. it's giving plug-and-play, fr fr β¨
π OPTIONS π
lowkey important heads-up first: malformed arguments will fall back on the defaults, if possible. so if you type something cursed, it just shrugs and does its best π
-hβ print usage and exit. the "help me bestie" button π«Ά-p PIDβ specify the pid of the target R program. like, which one are we profiling. point at it π-F FREQβ set the sampling frequency, in Hertz. default is 1 Hz, i.e. one sample per second, and the max is 1000 Hz (though honestly far fewer samples are usually required, so don't go feral).-d DURATIONβ set the duration forxrprofto take samples before exiting (provided the target program runs that long, whichβ¦ yeah, it has to actually still be alive π). default is to last up to one hour.-o FILEβ write output to FILE instead of standard output. you're the main character, you choose where it goes π-mβ run in "mixed mode", where samples are drawn from both the R-level and native C/C++ stacks and collated together. fancy β¨
π₯ 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. slay, it worked π1β a fatal error ocurred during sampling. it's giving tragedy π
π AUTHORS π
xrprof was written by Aaron Jacobs. king behavior, we love to see it π
πΈ SEE ALSO πΈ
reminder bestie: this whole page is dated2020-01-11and it lives in theXRPROF(1)section of theGeneral Commands Manual. that's the vibe check, and it passed. bye pookie πβ¨
π¦ where this page comes from
- debian bookworm: xrprof 0.3.1-3
- debian trixie: xrprof 0.3.1-3+b1
- ubuntu jammy: xrprof 0.3.1-2
- ubuntu noble: xrprof 0.3.1-3build2
- ubuntu questing: xrprof 0.3.1-3build2
- ubuntu resolute: xrprof 0.3.1-3build3
- ubuntu stonking: xrprof 0.3.1-4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms