File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -450,6 +450,15 @@ struct jvmtiInterface_1_ jvmti</xsl:text>
450
450
<xsl : value-of select =" $space" />
451
451
<xsl : text >PreserveExceptionMark __em(this_thread);</xsl : text >
452
452
</xsl : if >
453
+ <xsl : value-of select =" $space" />
454
+ <xsl : if test =" $trace='Trace'" >
455
+ <xsl : text >if (trace_flags) {</xsl : text >
456
+ <xsl : value-of select =" $space" />
457
+ <xsl : text > curr_thread_name = JvmtiTrace::safe_get_current_thread_name();</xsl : text >
458
+ <xsl : value-of select =" $space" />
459
+ <xsl : text >}</xsl : text >
460
+ <xsl : value-of select =" $space" />
461
+ </xsl : if >
453
462
</xsl : if >
454
463
</xsl : template >
455
464
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2003, 2023 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2003, 2024 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
30
30
#include " memory/resourceArea.hpp"
31
31
#include " prims/jvmtiTrace.hpp"
32
32
#include " runtime/javaThread.hpp"
33
+ #include " runtime/javaThread.inline.hpp"
33
34
34
35
//
35
36
// class JvmtiTrace
@@ -277,6 +278,12 @@ const char *JvmtiTrace::safe_get_thread_name(Thread *thread) {
277
278
if (!thread->is_Java_thread ()) {
278
279
return thread->name ();
279
280
}
281
+ if (Thread::current ()->is_Java_thread ()) {
282
+ JavaThreadState current_state = JavaThread::cast (Thread::current ())->thread_state ();
283
+ if (current_state == _thread_in_native || current_state == _thread_blocked) {
284
+ return " not readable" ;
285
+ }
286
+ }
280
287
JavaThread* java_thread = JavaThread::cast (thread);
281
288
oop threadObj = java_thread->jvmti_vthread ();
282
289
if (threadObj == nullptr ) {
You can’t perform that action at this time.
0 commit comments