| 143 | } |
| 144 | |
| 145 | void ObjectSampler::recordAllocation(jvmtiEnv* jvmti, JNIEnv* jni, EventType event_type, |
| 146 | jobject object, jclass object_klass, jlong size) { |
| 147 | AllocEvent event; |
| 148 | event._start_time = TSC::ticks(); |
| 149 | event._total_size = size > _interval ? size : _interval; |
| 150 | event._instance_size = size; |
| 151 | event._class_id = lookupClassId(jvmti, object_klass); |
| 152 | |
| 153 | u64 trace = Profiler::instance()->recordSample(NULL, event._total_size, event_type, &event); |
| 154 | if (_live && trace != 0) { |
| 155 | live_refs.add(jni, object, size, trace); |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | void ObjectSampler::initLiveRefs(bool live) { |
| 160 | _live = live; |
nothing calls this directly
no test coverage detected