Support for Java Probing in SystemTap

by rgrunber

The Java support for SystemTap looks promising, and I can think of a few different usages for this.

I ran into an issue where Eclipse was throwing some ClassNotFoundExceptions during its shutdown in F20. Granted, it was possible to insert a breakpoint at the location mentioned and just resume at each point, or even perform a hot-code insertion to get the classes that weren’t being found, but these approaches can be a little tricky. In both cases you’d pretty much need to remotely debug one running Eclipse instance from another assuming the instance in question was severely broken.

Using the SystemTap Java probes seemed like a relatively simple solution. There are of course some limitations and a bit of setup necessary but with the small script below it was easy to narrow down the issue.

probe java("/usr/lib64/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20131104-1241.jar").class("java.net.URLClassLoader").method("findClass(String):366") {
printf("ClassNotFoundException : %s\n", user_string($arg1))
}

It was still necessary to remotely debug since there was no way of getting a stacktrace, but I’ve been assured by Lukas, one of the developers, that such a feature should be possible. You can also see his original post on the topic of Java probing.

Minor Amendment : Replace ‘assured’ with ‘given a wink and a maaayyybe’ . If it’s technically possible, I’m sure it’ll be added.

Advertisements