Which JVM has a full bytecode execution trace?

2019-06-11 22:23发布

问题:

I need a full bytecode-level execution trace of the entire Java program.

I found the JVM TI with the SingleStep event which allosw me to WRITE an agent which will produce the trace. But surely there is a ready-made JVM option somewhere?

回答1:

Use a debug build of the Hotspot JVM and run it with the -XX:+TraceBytecodes flag. See Trace java bytecode stream for how to build this debug JVM.



回答2:

A full Java bytecode trace? That sounds incredibly slow. HotSpot does not support this functionality using any options and I think your demands are a little crazy. Perhaps think of an alternate means of achieving your ultimate goal that isn't quite as naive.