justfalter / jruby-profiler-callgrind-printer

A printer for the Jruby profiler that produces callgrind formatted output for use with tools like Kcachegrind and Qcachegrind
MIT License
5 stars 3 forks source link

Fix broken code #3

Closed gvassallo closed 1 year ago

gvassallo commented 5 years ago

Hi, was digging a bit into JRuby profiling and I found out your gem was doing exactly what I needed. Problem is, I think it's a bit outdated.

I fixed it for now, but I'm using Java reflection to access the profiledMethods field in the ProfileData obj.

If I have time, I'll dig into the JRuby source code a little bit more to see if there's a more clear way to do this.

Cheers!

EDIT: yes, i saw the other PR (https://github.com/justfalter/jruby-profiler-callgrind-printer/pull/2/files), but getting the profiledMethods through self.getProfileData().getThreadContext().getRuntime().getProfiledMethods() doesn't work for me. The method returned by profiledMethods.getProfiledMethod(serial) is always nil.