1 /* 2 * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_TRACE_TRACEVM_HPP 26 #define SHARE_VM_TRACE_TRACEVM_HPP 27 28 #include "utilities/macros.hpp" 29 #if INCLUDE_TRACE 30 #include "jvmtifiles/jvmti.h" 31 32 /** The possible java.lang.Thread states a thread can have "in java". */ 33 34 #define MAKE_JAVATHREAD_STATES(state) \ 35 state(STATE_NEW, (u8)0) /* Only implicitely defined in JVMTI */ \ 36 state(STATE_RUNNABLE, (u8)(JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_RUNNABLE)) \ 37 state(STATE_SLEEPING, (u8)(JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT | JVMTI_THREAD_STATE_SLEEPING)) \ 38 state(STATE_IN_OBJECT_WAIT, (u8)(JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY | JVMTI_THREAD_STATE_IN_OBJECT_WAIT)) \ 39 state(STATE_IN_OBJECT_WAIT_TIMED, (u8)(JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT | JVMTI_THREAD_STATE_IN_OBJECT_WAIT)) \ 40 state(STATE_PARKED, (u8)(JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_INDEFINITELY | JVMTI_THREAD_STATE_PARKED)) \ 41 state(STATE_PARKED_TIMED, (u8)(JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_WAITING | JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT | JVMTI_THREAD_STATE_PARKED)) \ 42 state(STATE_BLOCKED_ON_MONITOR_ENTER, (u8)(JVMTI_THREAD_STATE_ALIVE | JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER)) \ 43 state(STATE_TERMINATED, (u8)(JVMTI_THREAD_STATE_TERMINATED)) 44 45 typedef enum { 46 #define _ts_enum(n, v) THREAD_##n = v, 47 MAKE_JAVATHREAD_STATES(_ts_enum) 48 LAST_JavaLangThreadState 49 } JavaLangThreadState; 50 51 #endif // INCLUDE_TRACE 52 #endif // SHARE_VM_TRACE_TRACEVM_HPP