Skip to content

Commit f02190b

Browse files
author
Markus Grönlund
committed
8357829: Commented out sample limit in JfrSamplerThread::task_stacktrace
Reviewed-by: shade
1 parent 1e0caed commit f02190b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,11 @@ static inline bool is_excluded(JavaThread* jt) {
221221
return jt->is_Compiler_thread() || jt->is_hidden_from_external_view() || jt->is_JfrRecorder_thread() || jt->jfr_thread_local()->is_excluded();
222222
}
223223

224+
static const uint MAX_NR_OF_JAVA_SAMPLES = 5;
225+
static const uint MAX_NR_OF_NATIVE_SAMPLES = 1;
226+
224227
void JfrSamplerThread::task_stacktrace(JfrSampleRequestType type, JavaThread** last_thread) {
225-
const uint sample_limit = JAVA_SAMPLE == type ? 5 : 1;
228+
const uint sample_limit = JAVA_SAMPLE == type ? MAX_NR_OF_JAVA_SAMPLES : MAX_NR_OF_NATIVE_SAMPLES;
226229
uint num_samples = 0;
227230
JavaThread* start = nullptr;
228231
elapsedTimer sample_time;
@@ -235,8 +238,7 @@ void JfrSamplerThread::task_stacktrace(JfrSampleRequestType type, JavaThread** l
235238
_cur_index = tlh.list()->find_index_of_JavaThread(*last_thread);
236239
JavaThread* current = _cur_index != -1 ? *last_thread : nullptr;
237240

238-
// while (num_samples < sample_limit) {
239-
while (true) {
241+
while (num_samples < sample_limit) {
240242
current = next_thread(tlh.list(), start, current);
241243
if (current == nullptr) {
242244
break;

0 commit comments

Comments
 (0)