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 for xrprof to 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 🌸

R(1), Rscript(1)


reminder bestie: this whole page is dated 2020-01-11 and it lives in the XRPROF(1) section of the General Commands Manual. that's the vibe check, and it passed. bye pookie πŸ’œβœ¨