equal
deleted
inserted
replaced
117 writer.write("Native"); |
117 writer.write("Native"); |
118 } |
118 } |
119 }; |
119 }; |
120 |
120 |
121 bool JfrStackTraceRepository::initialize() { |
121 bool JfrStackTraceRepository::initialize() { |
122 return JfrSerializer::register_serializer(TYPE_FRAMETYPE, false, true, new JfrFrameType()); |
122 return JfrSerializer::register_serializer(TYPE_FRAMETYPE, true, new JfrFrameType()); |
123 } |
123 } |
124 |
124 |
125 size_t JfrStackTraceRepository::clear() { |
125 size_t JfrStackTraceRepository::clear() { |
126 MutexLocker lock(JfrStacktrace_lock, Mutex::_no_safepoint_check_flag); |
126 MutexLocker lock(JfrStacktrace_lock, Mutex::_no_safepoint_check_flag); |
127 if (_entries == 0) { |
127 if (_entries == 0) { |
194 |
194 |
195 if (tl->has_cached_stack_trace()) { |
195 if (tl->has_cached_stack_trace()) { |
196 *hash = tl->cached_stack_trace_hash(); |
196 *hash = tl->cached_stack_trace_hash(); |
197 return tl->cached_stack_trace_id(); |
197 return tl->cached_stack_trace_id(); |
198 } |
198 } |
199 if (!thread->is_Java_thread() || thread->is_hidden_from_external_view()) { |
199 if (!thread->is_Java_thread() || thread->is_hidden_from_external_view() || tl->is_excluded()) { |
200 return 0; |
200 return 0; |
201 } |
201 } |
202 JfrStackFrame* frames = tl->stackframes(); |
202 JfrStackFrame* frames = tl->stackframes(); |
203 if (frames == NULL) { |
203 if (frames == NULL) { |
204 // pending oom |
204 // pending oom |
365 |
365 |
366 void JfrStackFrame::resolve_lineno() { |
366 void JfrStackFrame::resolve_lineno() { |
367 assert(_method, "no method pointer"); |
367 assert(_method, "no method pointer"); |
368 assert(_line == 0, "already have linenumber"); |
368 assert(_line == 0, "already have linenumber"); |
369 _line = _method->line_number_from_bci(_bci); |
369 _line = _method->line_number_from_bci(_bci); |
370 _method = NULL; |
|
371 } |
370 } |
372 |
371 |
373 void JfrStackTrace::set_frame(u4 frame_pos, JfrStackFrame& frame) { |
372 void JfrStackTrace::set_frame(u4 frame_pos, JfrStackFrame& frame) { |
374 assert(frame_pos < _max_frames, "illegal frame_pos"); |
373 assert(frame_pos < _max_frames, "illegal frame_pos"); |
375 _frames[frame_pos] = frame; |
374 _frames[frame_pos] = frame; |
444 bci = st.bci(); |
443 bci = st.bci(); |
445 } |
444 } |
446 const int lineno = method->line_number_from_bci(bci); |
445 const int lineno = method->line_number_from_bci(bci); |
447 // Can we determine if it's inlined? |
446 // Can we determine if it's inlined? |
448 _hash = (_hash << 2) + (unsigned int)(((size_t)mid >> 2) + (bci << 4) + type); |
447 _hash = (_hash << 2) + (unsigned int)(((size_t)mid >> 2) + (bci << 4) + type); |
449 _frames[count] = JfrStackFrame(mid, bci, type, lineno); |
448 _frames[count] = JfrStackFrame(method, mid, bci, type, lineno); |
450 st.samples_next(); |
449 st.samples_next(); |
451 count++; |
450 count++; |
452 } |
451 } |
453 |
452 |
454 _lineno = true; |
453 _lineno = true; |