jvm-profiling-tools / honest-profiler

A sampling JVM profiler without the safepoint sample bias
https://github.com/RichardWarburton/honest-profiler/wiki
MIT License
1.25k stars 146 forks source link

Method event emitted after frame event #237

Open urisimchoni opened 6 years ago

urisimchoni commented 6 years ago

In: https://github.com/jvm-profiling-tools/honest-profiler/blob/89223b88d33e062fa1d0dc45091bcb9ba02f2ad5/src/main/cpp/log_writer.cpp#L120

Wouldn't it make sense to inspect the method first, so as to emit the method event before the frame event, thus making it easy on log consumers? That would ensure that when a log consumer gets an event with a method ID, it has already seen the mapping to method name, and it can emit the method name (for example, the ConsoleLogDumpApplication fails to emit the method name when it first encounters it).

Such a change at the very least would break tests, so I'm not issuing a PR yet, just asking if it makes sense and whether it breaks anything beside tests which depend on the exact current implementation.

nitsanw commented 6 years ago

It makes sense IMO