| 19 | |
| 20 | |
| 21 | Error AllocTracer::initialize() { |
| 22 | if (_in_new_tlab.entry() == 0 || _outside_tlab.entry() == 0) { |
| 23 | CodeCache* libjvm = VMStructs::libjvm(); |
| 24 | const void* ne; |
| 25 | const void* oe; |
| 26 | |
| 27 | if ((ne = libjvm->findSymbolByPrefix("_ZN11AllocTracer27send_allocation_in_new_tlab")) != NULL && |
| 28 | (oe = libjvm->findSymbolByPrefix("_ZN11AllocTracer28send_allocation_outside_tlab")) != NULL) { |
| 29 | _trap_kind = 1; // JDK 10+ |
| 30 | } else if ((ne = libjvm->findSymbolByPrefix("_ZN11AllocTracer33send_allocation_in_new_tlab_eventE11KlassHandleP8HeapWord")) != NULL && |
| 31 | (oe = libjvm->findSymbolByPrefix("_ZN11AllocTracer34send_allocation_outside_tlab_eventE11KlassHandleP8HeapWord")) != NULL) { |
| 32 | _trap_kind = 1; // JDK 8u262+ |
| 33 | } else if ((ne = libjvm->findSymbolByPrefix("_ZN11AllocTracer33send_allocation_in_new_tlab_event")) != NULL && |
| 34 | (oe = libjvm->findSymbolByPrefix("_ZN11AllocTracer34send_allocation_outside_tlab_event")) != NULL) { |
| 35 | _trap_kind = 2; // JDK 7-9 |
| 36 | } else { |
| 37 | return Error("No AllocTracer symbols found. Are JDK debug symbols installed?"); |
| 38 | } |
| 39 | |
| 40 | _in_new_tlab.assign(ne); |
| 41 | _outside_tlab.assign(oe); |
| 42 | _in_new_tlab.pair(_outside_tlab); |
| 43 | } |
| 44 | |
| 45 | return Error::OK; |
| 46 | } |
| 47 | |
| 48 | // Called whenever our breakpoint trap is hit |
| 49 | void AllocTracer::trapHandler(int signo, siginfo_t* siginfo, void* ucontext) { |
nothing calls this directly
no test coverage detected