JDKMissionControl / jmc

This mirror is deprecated - please start using https://github.com/openjdk/jmc
197 stars 46 forks source link

Provide instructions and or capability to de-obfusate obfuscated stacktraces, class and method names #17

Open billybong opened 3 years ago

billybong commented 3 years ago

Hi all!

Don't know exactly if this belongs to the JDK Flight Recorder project or JMC and if this should be posted in respective bug trackers or as GitHub issues, so forgive me if this is the wrong place. Anyhow... We would like to utilize JFR/JMC as a tool to get profiling and logs from our customers, but the problem is that our code is obfuscated for legal reasons. Where would the best place be to put mapping logic for reading jfr files and provide a mapping translation hook?

I can see two possible solutions:

Looking at both the OpenJDK FlightRecorder API's and JMC it's not entirely clear to me where the best place to put this would be, but in the end I'd like to be able to use JMC rather than i.e. utilizing the JSON format and writing our own tooling for exposing graphs etc.

Link to SO question: https://stackoverflow.com/questions/66743358/deobfuscating-stacktraces-and-class-method-names-in-jdk-flight-recorder-files

thegreystone commented 3 years ago

We do have parser extensions for the JMC JFR parser - perhaps they can be utilized?

billybong commented 3 years ago

That definitely sounds like a valid option. Is there a documented way on how to add those to a stock JMC?

billybong commented 3 years ago

Took a shot at this yesterday and I think I have something that sort of works now using the parser extensions. I have an implementation of the IParserExtension which I'm exposing through META-INF/services/org.openjdk.jmc.flightrecorder.parser.IParserExtension.

I can get it working properly in tests using the JfrLoaderToolkit.loadEvents, so now I just need to understand how to put this into the JMC/Eclipse classpath. Guess I would need to tweak jmc.ini somehow or is there a simpler solution without writing a proper eclipse plugin? Not too savvy with Eclipse unfortunately so I'm aiming for something dead simple.