How to trace a java process with eBPF (BCC)

2k views Asked by At

I want to use Uprobe in eBPF to trace the Java program I wrote, but I do not know how to find the symbol table corresponding to the Java program. In C language, platform-related executable files will be generated after compilation, and the corresponding address of the method can be obtained through the executable file.But Java is an interpreted language, there are no executable files, and eBPF is a Linux tool, do not know the Java language related information.I know that methods in the JVM can be traced using USDT, such as method__entry, but that doesn't give you information about the arguments to the methods, so is there a way to trace Java functions using eBPF? BCC,using USDT to print a method flow graph in high-level languages.

1

There are 1 answers

2
Qeole On

Not a Java tracing expert, but I think that you need to look at perf-map-agent.

This is what Brendan Greggs mentions in his posts on perf and on CPU flame graphs, and I believe it applies to eBPF as well as perf. This post gives an example on how to call the tool from a container, to produce flame graphs with BCC tools.