Package org.lwjgl.util.remotery
Class Remotery
- java.lang.Object
-
- org.lwjgl.util.remotery.Remotery
-
public class Remotery extends java.lang.Object
Bindings to Remotery, a realtime CPU/GPU profiler hosted in a single C file with a viewer that runs in a web browser.Supported features:
- Lightweight instrumentation of multiple threads running on the CPU.
- Web viewer that runs in Chrome, Firefox and Safari. Custom WebSockets server transmits sample data to the browser on a latent thread.
- Profiles itself and shows how it's performing in the viewer.
- Can optionally sample CUDA/D3D11/OpenGL GPU activity.
- Console output for logging text.
- Console input for sending commands to your game.
-
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
nrmt_BeginCPUSample(long name, int flags, long hash_cache)
Unsafe version of:BeginCPUSample
static int
nrmt_CreateGlobalInstance(long remotery)
static void
nrmt_DestroyGlobalInstance(long remotery)
static void
nrmt_LogText(long text)
static void
nrmt_SetCurrentThreadName(long thread_name)
static void
nrmt_SetGlobalInstance(long remotery)
static long
nrmt_Settings()
static void
rmt_BeginCPUSample(java.lang.CharSequence name, int flags, java.nio.IntBuffer hash_cache)
static void
rmt_BeginCPUSample(java.nio.ByteBuffer name, int flags, java.nio.IntBuffer hash_cache)
static int
rmt_CreateGlobalInstance(org.lwjgl.PointerBuffer remotery)
static void
rmt_DestroyGlobalInstance(long remotery)
static void
rmt_EndCPUSample()
static long
rmt_GetGlobalInstance()
static void
rmt_LogText(java.lang.CharSequence text)
static void
rmt_LogText(java.nio.ByteBuffer text)
static void
rmt_SetCurrentThreadName(java.lang.CharSequence thread_name)
static void
rmt_SetCurrentThreadName(java.nio.ByteBuffer thread_name)
static void
rmt_SetGlobalInstance(long remotery)
static RMTSettings
rmt_Settings()
-
-
-
Field Detail
-
RMT_ERROR_NONE, RMT_ERROR_RECURSIVE_SAMPLE, RMT_ERROR_MALLOC_FAIL, RMT_ERROR_TLS_ALLOC_FAIL, RMT_ERROR_VIRTUAL_MEMORY_BUFFER_FAIL, RMT_ERROR_CREATE_THREAD_FAIL, RMT_ERROR_SOCKET_INIT_NETWORK_FAIL, RMT_ERROR_SOCKET_CREATE_FAIL, RMT_ERROR_SOCKET_BIND_FAIL, RMT_ERROR_SOCKET_LISTEN_FAIL, RMT_ERROR_SOCKET_SET_NON_BLOCKING_FAIL, RMT_ERROR_SOCKET_INVALID_POLL, RMT_ERROR_SOCKET_SELECT_FAIL, RMT_ERROR_SOCKET_POLL_ERRORS, RMT_ERROR_SOCKET_ACCEPT_FAIL, RMT_ERROR_SOCKET_SEND_TIMEOUT, RMT_ERROR_SOCKET_SEND_FAIL, RMT_ERROR_SOCKET_RECV_NO_DATA, RMT_ERROR_SOCKET_RECV_TIMEOUT, RMT_ERROR_SOCKET_RECV_FAILED, RMT_ERROR_WEBSOCKET_HANDSHAKE_NOT_GET, RMT_ERROR_WEBSOCKET_HANDSHAKE_NO_VERSION, RMT_ERROR_WEBSOCKET_HANDSHAKE_BAD_VERSION, RMT_ERROR_WEBSOCKET_HANDSHAKE_NO_HOST, RMT_ERROR_WEBSOCKET_HANDSHAKE_BAD_HOST, RMT_ERROR_WEBSOCKET_HANDSHAKE_NO_KEY, RMT_ERROR_WEBSOCKET_HANDSHAKE_BAD_KEY, RMT_ERROR_WEBSOCKET_HANDSHAKE_STRING_FAIL, RMT_ERROR_WEBSOCKET_DISCONNECTED, RMT_ERROR_WEBSOCKET_BAD_FRAME_HEADER, RMT_ERROR_WEBSOCKET_BAD_FRAME_HEADER_SIZE, RMT_ERROR_WEBSOCKET_BAD_FRAME_HEADER_MASK, RMT_ERROR_WEBSOCKET_RECEIVE_TIMEOUT, RMT_ERROR_REMOTERY_NOT_CREATED, RMT_ERROR_SEND_ON_INCOMPLETE_PROFILE, RMT_ERROR_CUDA_DEINITIALIZED, RMT_ERROR_CUDA_NOT_INITIALIZED, RMT_ERROR_CUDA_INVALID_CONTEXT, RMT_ERROR_CUDA_INVALID_VALUE, RMT_ERROR_CUDA_INVALID_HANDLE, RMT_ERROR_CUDA_OUT_OF_MEMORY, RMT_ERROR_ERROR_NOT_READY, RMT_ERROR_D3D11_FAILED_TO_CREATE_QUERY, RMT_ERROR_OPENGL_ERROR, RMT_ERROR_CUDA_UNKNOWN
All possible error codes (rmtError
).Enum values:
ERROR_NONE
ERROR_RECURSIVE_SAMPLE
- Not an error but an internal message to calling codeERROR_MALLOC_FAIL
- Malloc call within remotery failedERROR_TLS_ALLOC_FAIL
- Attempt to allocate thread local storage failedERROR_VIRTUAL_MEMORY_BUFFER_FAIL
- Failed to create a virtual memory mirror bufferERROR_CREATE_THREAD_FAIL
- Failed to create a thread for the serverERROR_SOCKET_INIT_NETWORK_FAIL
- Network initialisation failure (e.g. on Win32, WSAStartup fails)ERROR_SOCKET_CREATE_FAIL
- Can't create a socket for connection to the remote viewerERROR_SOCKET_BIND_FAIL
- Can't bind a socket for the serverERROR_SOCKET_LISTEN_FAIL
- Created server socket failed to enter a listen stateERROR_SOCKET_SET_NON_BLOCKING_FAIL
- Created server socket failed to switch to a non-blocking stateERROR_SOCKET_INVALID_POLL
- Poll attempt on an invalid socketERROR_SOCKET_SELECT_FAIL
- Server failed to call select on socketERROR_SOCKET_POLL_ERRORS
- Poll notified that the socket has errorsERROR_SOCKET_ACCEPT_FAIL
- Server failed to accept connection from clientERROR_SOCKET_SEND_TIMEOUT
- Timed out trying to send dataERROR_SOCKET_SEND_FAIL
- Unrecoverable error occured while client/server tried to send dataERROR_SOCKET_RECV_NO_DATA
- No data available when attempting a receiveERROR_SOCKET_RECV_TIMEOUT
- Timed out trying to receive dataERROR_SOCKET_RECV_FAILED
- Unrecoverable error occured while client/server tried to receive dataERROR_WEBSOCKET_HANDSHAKE_NOT_GET
- WebSocket server handshake failed, not HTTP GETERROR_WEBSOCKET_HANDSHAKE_NO_VERSION
- WebSocket server handshake failed, can't locate WebSocket versionERROR_WEBSOCKET_HANDSHAKE_BAD_VERSION
- WebSocket server handshake failed, unsupported WebSocket versionERROR_WEBSOCKET_HANDSHAKE_NO_HOST
- WebSocket server handshake failed, can't locate hostERROR_WEBSOCKET_HANDSHAKE_BAD_HOST
- WebSocket server handshake failed, host is not allowed to connectERROR_WEBSOCKET_HANDSHAKE_NO_KEY
- WebSocket server handshake failed, can't locate WebSocket keyERROR_WEBSOCKET_HANDSHAKE_BAD_KEY
- WebSocket server handshake failed, WebSocket key is ill-formedERROR_WEBSOCKET_HANDSHAKE_STRING_FAIL
- WebSocket server handshake failed, internal error, bad string codeERROR_WEBSOCKET_DISCONNECTED
- WebSocket server received a disconnect request and closed the socketERROR_WEBSOCKET_BAD_FRAME_HEADER
- Couldn't parse WebSocket frame headerERROR_WEBSOCKET_BAD_FRAME_HEADER_SIZE
- Partially received wide frame header sizeERROR_WEBSOCKET_BAD_FRAME_HEADER_MASK
- Partially received frame header data maskERROR_WEBSOCKET_RECEIVE_TIMEOUT
- Timeout receiving frame headerERROR_REMOTERY_NOT_CREATED
- Remotery object has not been createdERROR_SEND_ON_INCOMPLETE_PROFILE
- An attempt was made to send an in,complete profile tree to the clientERROR_CUDA_DEINITIALIZED
- This indicates that the CUDA driver is in the process of shutting downERROR_CUDA_NOT_INITIALIZED
- This indicates that the CUDA driver has not been initialized with cuInit() or that initialization has failedERROR_CUDA_INVALID_CONTEXT
- This most frequently indicates that there is no context bound to the current threadERROR_CUDA_INVALID_VALUE
- This indicates that one or more of the parameters passed to the API call is not within an acceptable range of valuesERROR_CUDA_INVALID_HANDLE
- This indicates that a resource handle passed to the API call was not validERROR_CUDA_OUT_OF_MEMORY
- The API call failed because it was unable to allocate enough memory to perform the requested operationERROR_ERROR_NOT_READY
- This indicates that a resource handle passed to the API call was not validERROR_D3D11_FAILED_TO_CREATE_QUERY
- Failed to create query for sampleERROR_OPENGL_ERROR
- Generic OpenGL error, no need to expose detail since app will need an OpenGL error callback registeredERROR_CUDA_UNKNOWN
-
RMTSF_None, RMTSF_Aggregate, RMTSF_Recursive
rmtSampleFlags
Enum values:
RMTSF_None
- Default behaviourRMTSF_Aggregate
- Search parent for same-named samples and merge timing instead of adding a new sampleRMTSF_Recursive
- Merge sample with parent if it's the same sample
-
-
Method Detail
-
nrmt_Settings
public static long nrmt_Settings()
-
rmt_Settings
@Nullable public static RMTSettings rmt_Settings()
-
nrmt_CreateGlobalInstance
public static int nrmt_CreateGlobalInstance(long remotery)
-
rmt_CreateGlobalInstance
public static int rmt_CreateGlobalInstance(org.lwjgl.PointerBuffer remotery)
-
nrmt_DestroyGlobalInstance
public static void nrmt_DestroyGlobalInstance(long remotery)
-
rmt_DestroyGlobalInstance
public static void rmt_DestroyGlobalInstance(long remotery)
-
nrmt_SetGlobalInstance
public static void nrmt_SetGlobalInstance(long remotery)
-
rmt_SetGlobalInstance
public static void rmt_SetGlobalInstance(long remotery)
-
rmt_GetGlobalInstance
public static long rmt_GetGlobalInstance()
-
nrmt_SetCurrentThreadName
public static void nrmt_SetCurrentThreadName(long thread_name)
-
rmt_SetCurrentThreadName
public static void rmt_SetCurrentThreadName(java.nio.ByteBuffer thread_name)
-
rmt_SetCurrentThreadName
public static void rmt_SetCurrentThreadName(java.lang.CharSequence thread_name)
-
nrmt_LogText
public static void nrmt_LogText(long text)
-
rmt_LogText
public static void rmt_LogText(java.nio.ByteBuffer text)
-
rmt_LogText
public static void rmt_LogText(java.lang.CharSequence text)
-
nrmt_BeginCPUSample
public static void nrmt_BeginCPUSample(long name, int flags, long hash_cache)
Unsafe version of:BeginCPUSample
-
rmt_BeginCPUSample
public static void rmt_BeginCPUSample(java.nio.ByteBuffer name, int flags, @Nullable java.nio.IntBuffer hash_cache) public static void rmt_BeginCPUSample(java.lang.CharSequence name, int flags, @Nullable java.nio.IntBuffer hash_cache)
- Parameters:
flags
- one of:RMTSF_None
RMTSF_Aggregate
RMTSF_Recursive
-
rmt_EndCPUSample
public static void rmt_EndCPUSample()
-
-