r-prof / jointprof

Joint profiling of native and R code
https://r-prof.github.io/jointprof/
Other
55 stars 6 forks source link

Reading .prof files created by gperftools #1

Closed krlmlr closed 6 years ago

krlmlr commented 7 years ago

currently requires pprof, a Go program. Need to do one of the following:

  1. Parse the textual output of pprof
  2. Call Go from R via cgo
  3. Rebuild the parser for the profiler output in R
  4. Build a reader for the profiler data

A first implementation will focus on the first option and require a compatible version of pprof that can be found by the package.

krlmlr commented 7 years ago

pprof -traces aggregates consecutive identical stack traces; can disaggregate by looking at duration in output of pprof -unit us -traces .

krlmlr commented 6 years ago

pprof also parses the "legacy format" that might be replaced with a protobuf-based format. Options 3 and 4 are out of scope, it feels better to embed the pprof Go library (option 2).

Resources:

Thanks @romainfrancois!

romainfrancois commented 6 years ago

Cool. At some point I need to commit to do some proper R/go bridge. These articles just scratch the surface. Knowing there are potential use cases beyond "that would be cool" does help.

krlmlr commented 6 years ago

Unfortunately, at this point pprof doesn't export its symbolizer API. We'd need to fork the project and add our own API, or examine existing forks. At this point the easiest route seems to be 1), but we still can/should build the executable ourselves.

krlmlr commented 6 years ago

Opened a pprof issue: https://github.com/google/pprof/issues/281