Top Description Fields Constructors Methods
org.lwjgl.util.remotery

public Class Remotery

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

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:

Supported Profiling Platforms:

Supported GPU Profiling APIs:

LWJGL: The current version of the Remotery bindings is compatible with commit cc32849. Run the following commands to clone the Remotery repository at that commit:


git clone --depth=1 https://github.com/Celtoys/Remotery.git
cd Remotery
git fetch --depth=1 origin cc32849f1075154c087fccdfff829662be69a23f
git branch --no-track lwjgl cc32849f1075154c087fccdfff829662be69a23f
git checkout lwjgl
git branch -D @{-1}

Now open vis/index.html in your favorite browser to view the profiler.

Field Summary

Modifier and TypeField and Description
private static final RMTPropertyValue
private static final RMTPropertyValue
public static final int
RMT_ERROR_CREATE_THREAD_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_CUDA_DEINITIALIZED

All possible error codes (rmtError).

public static final int
RMT_ERROR_CUDA_INVALID_CONTEXT

All possible error codes (rmtError).

public static final int
RMT_ERROR_CUDA_INVALID_HANDLE

All possible error codes (rmtError).

public static final int
RMT_ERROR_CUDA_INVALID_VALUE

All possible error codes (rmtError).

public static final int
RMT_ERROR_CUDA_NOT_INITIALIZED

All possible error codes (rmtError).

public static final int
RMT_ERROR_CUDA_OUT_OF_MEMORY

All possible error codes (rmtError).

public static final int
RMT_ERROR_CUDA_UNKNOWN

All possible error codes (rmtError).

public static final int
RMT_ERROR_D3D11_FAILED_TO_CREATE_QUERY

All possible error codes (rmtError).

public static final int
RMT_ERROR_ERROR_NOT_READY

All possible error codes (rmtError).

public static final int
RMT_ERROR_INVALID_INPUT

All possible error codes (rmtError).

public static final int
RMT_ERROR_MALLOC_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_NONE

All possible error codes (rmtError).

public static final int
RMT_ERROR_OPEN_THREAD_HANDLE_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_OPENGL_ERROR

All possible error codes (rmtError).

public static final int
RMT_ERROR_RECURSIVE_SAMPLE

All possible error codes (rmtError).

public static final int
RMT_ERROR_REMOTERY_NOT_CREATED

All possible error codes (rmtError).

public static final int
RMT_ERROR_RESOURCE_ACCESS_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_RESOURCE_CREATE_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_SEND_ON_INCOMPLETE_PROFILE

All possible error codes (rmtError).

public static final int
RMT_ERROR_SOCKET_INVALID_POLL

All possible error codes (rmtError).

public static final int
RMT_ERROR_SOCKET_POLL_ERRORS

All possible error codes (rmtError).

public static final int
RMT_ERROR_SOCKET_RECV_FAILED

All possible error codes (rmtError).

public static final int
RMT_ERROR_SOCKET_RECV_NO_DATA

All possible error codes (rmtError).

public static final int
RMT_ERROR_SOCKET_RECV_TIMEOUT

All possible error codes (rmtError).

public static final int
RMT_ERROR_SOCKET_SELECT_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_SOCKET_SEND_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_TIMEOUT

All possible error codes (rmtError).

public static final int
RMT_ERROR_TLS_ALLOC_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_UNKNOWN

All possible error codes (rmtError).

public static final int
RMT_ERROR_VIRTUAL_MEMORY_BUFFER_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_BAD_FRAME_HEADER

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_BAD_FRAME_HEADER_MASK

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_BAD_FRAME_HEADER_SIZE

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_DISCONNECTED

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_HANDSHAKE_BAD_HOST

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_HANDSHAKE_BAD_KEY

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_HANDSHAKE_BAD_VERSION

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_HANDSHAKE_NO_HOST

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_HANDSHAKE_NO_KEY

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_HANDSHAKE_NO_VERSION

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_HANDSHAKE_NOT_GET

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_HANDSHAKE_STRING_FAIL

All possible error codes (rmtError).

public static final int
RMT_ERROR_WEBSOCKET_RECEIVE_TIMEOUT

All possible error codes (rmtError).

public static final int
RMT_FALSE

Boolean

public static final int
RMT_PropertyFlags_FrameReset

Flags that control property behaviour.

public static final int
RMT_PropertyFlags_NoFlags

Flags that control property behaviour.

public static final int
RMT_PropertyType_rmtBool

All possible property types that can be recorded and sent to the viewer.

public static final int
RMT_PropertyType_rmtF32

All possible property types that can be recorded and sent to the viewer.

public static final int
RMT_PropertyType_rmtF64

All possible property types that can be recorded and sent to the viewer.

public static final int
RMT_PropertyType_rmtGroup

All possible property types that can be recorded and sent to the viewer.

public static final int
RMT_PropertyType_rmtS32

All possible property types that can be recorded and sent to the viewer.

public static final int
RMT_PropertyType_rmtS64

All possible property types that can be recorded and sent to the viewer.

public static final int
RMT_PropertyType_rmtU32

All possible property types that can be recorded and sent to the viewer.

public static final int
RMT_PropertyType_rmtU64

All possible property types that can be recorded and sent to the viewer.

public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
RMT_TRUE

Boolean

public static final int
RMTSF_Aggregate

rmtSampleFlags Enum values:

  • RMTSF_None - Default behaviour
  • RMTSF_Aggregate - Search parent for same-named samples and merge timing instead of adding a new sample
  • RMTSF_Recursive - Merge sample with parent if it's the same sample
  • RMTSF_Root - Set this flag on any of your root samples so that Remotery will assert if it ends up not being the root sample.

    This will quickly allow you to detect Begin/End mismatches causing a sample tree imbalance.

  • RMTSF_SendOnClose - , Mainly for platforms other than Windows that don't support the thread sampler and can't detect stalling samples.

    Where you have a non-root sample that stays open indefinitely and never sends its contents to log/viewer. Send this sample to log/viewer when it closes. You can not have more than one sample open with this flag on the same thread at a time. This flag will be removed in a future version when all platforms support stalling samples.

public static final int
RMTSF_None

rmtSampleFlags Enum values:

  • RMTSF_None - Default behaviour
  • RMTSF_Aggregate - Search parent for same-named samples and merge timing instead of adding a new sample
  • RMTSF_Recursive - Merge sample with parent if it's the same sample
  • RMTSF_Root - Set this flag on any of your root samples so that Remotery will assert if it ends up not being the root sample.

    This will quickly allow you to detect Begin/End mismatches causing a sample tree imbalance.

  • RMTSF_SendOnClose - , Mainly for platforms other than Windows that don't support the thread sampler and can't detect stalling samples.

    Where you have a non-root sample that stays open indefinitely and never sends its contents to log/viewer. Send this sample to log/viewer when it closes. You can not have more than one sample open with this flag on the same thread at a time. This flag will be removed in a future version when all platforms support stalling samples.

public static final int
RMTSF_Recursive

rmtSampleFlags Enum values:

  • RMTSF_None - Default behaviour
  • RMTSF_Aggregate - Search parent for same-named samples and merge timing instead of adding a new sample
  • RMTSF_Recursive - Merge sample with parent if it's the same sample
  • RMTSF_Root - Set this flag on any of your root samples so that Remotery will assert if it ends up not being the root sample.

    This will quickly allow you to detect Begin/End mismatches causing a sample tree imbalance.

  • RMTSF_SendOnClose - , Mainly for platforms other than Windows that don't support the thread sampler and can't detect stalling samples.

    Where you have a non-root sample that stays open indefinitely and never sends its contents to log/viewer. Send this sample to log/viewer when it closes. You can not have more than one sample open with this flag on the same thread at a time. This flag will be removed in a future version when all platforms support stalling samples.

public static final int
RMTSF_Root

rmtSampleFlags Enum values:

  • RMTSF_None - Default behaviour
  • RMTSF_Aggregate - Search parent for same-named samples and merge timing instead of adding a new sample
  • RMTSF_Recursive - Merge sample with parent if it's the same sample
  • RMTSF_Root - Set this flag on any of your root samples so that Remotery will assert if it ends up not being the root sample.

    This will quickly allow you to detect Begin/End mismatches causing a sample tree imbalance.

  • RMTSF_SendOnClose - , Mainly for platforms other than Windows that don't support the thread sampler and can't detect stalling samples.

    Where you have a non-root sample that stays open indefinitely and never sends its contents to log/viewer. Send this sample to log/viewer when it closes. You can not have more than one sample open with this flag on the same thread at a time. This flag will be removed in a future version when all platforms support stalling samples.

public static final int
RMTSF_SendOnClose

rmtSampleFlags Enum values:

  • RMTSF_None - Default behaviour
  • RMTSF_Aggregate - Search parent for same-named samples and merge timing instead of adding a new sample
  • RMTSF_Recursive - Merge sample with parent if it's the same sample
  • RMTSF_Root - Set this flag on any of your root samples so that Remotery will assert if it ends up not being the root sample.

    This will quickly allow you to detect Begin/End mismatches causing a sample tree imbalance.

  • RMTSF_SendOnClose - , Mainly for platforms other than Windows that don't support the thread sampler and can't detect stalling samples.

    Where you have a non-root sample that stays open indefinitely and never sends its contents to log/viewer. Send this sample to log/viewer when it closes. You can not have more than one sample open with this flag on the same thread at a time. This flag will be removed in a future version when all platforms support stalling samples.

private static final RMTPropertyValue

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
_rmt_HashString32(ByteBuffer s, int len, int seed)

public static int
_rmt_HashString32(CharSequence s, int len, int seed)

public static void
public static void
public static native int
n_rmt_HashString32(long s, int len, int seed)

public static native void
n_rmt_PropertyAddValue(long property, long add_value)

public static native void
n_rmt_PropertySetValue(long property)

public static native void
nrmt_BeginCPUSample(long name, int flags, long hash_cache)

Unsafe version of: BeginCPUSample

public static native int
nrmt_CreateGlobalInstance(long remotery)

Unsafe version of: CreateGlobalInstance

public static native void
nrmt_DestroyGlobalInstance(long remotery)

Unsafe version of: DestroyGlobalInstance

public static native long
public static native void
nrmt_IterateChildren(long iter, long sample)

public static native int
nrmt_IterateNext(long iter)

public static native void
nrmt_LogText(long text)

public static native long
public static native long
nrmt_PropertyGetName(long property)

public static native int
nrmt_PropertyGetType(long property)

public static native void
nrmt_PropertyGetValue(long property, long __result)

public static native void
nrmt_PropertyIterateChildren(long iter, long sample)

public static native int
public static native int
public static native void
nrmt_SampleGetColour(long sample, long r, long g, long b)

public static native long
nrmt_SampleGetName(long sample)

Unsafe version of: SampleGetName

public static native int
public static native long
public static native long
nrmt_SampleGetStart(long sample)

public static native long
nrmt_SampleGetTime(long sample)

public static native int
nrmt_SampleGetType(long sample)

public static native long
nrmt_SampleTreeGetRootSample(long sample_tree)

public static native long
nrmt_SampleTreeGetThreadName(long sample_tree)

public static native void
nrmt_SetCurrentThreadName(long thread_name)

public static native void
nrmt_SetGlobalInstance(long remotery)

Unsafe version of: SetGlobalInstance

public static native long
nrmt_Settings()

Unsafe version of: Settings

public static void
rmt_BeginCPUSample(ByteBuffer name, int flags, IntBuffer
Stores a pointer to a sample name's hash value.

Internally this is used to identify unique callstacks and it would be ideal that it's not recalculated each time the sample is used. This can be statically cached at the point of call or stored elsewhere when dynamic names are required.

If NULL then this call becomes more expensive, as it has to recalculate the hash of the name.

hash_cache
)

public static void
rmt_BeginCPUSample(CharSequence name, int flags, IntBuffer
Stores a pointer to a sample name's hash value.

Internally this is used to identify unique callstacks and it would be ideal that it's not recalculated each time the sample is used. This can be statically cached at the point of call or stored elsewhere when dynamic names are required.

If NULL then this call becomes more expensive, as it has to recalculate the hash of the name.

hash_cache
)

public static int
rmt_CreateGlobalInstance(PointerBuffer
returns the pointer for further use
remotery
)

Initialises Remotery and sets its internal global instance pointer.

public static void
rmt_DestroyGlobalInstance(long remotery)

Shutsdown Remotery, requiring its pointer to be passed to ensure you are destroying the correct instance.

public static native void
public static native long
rmt_GetGlobalInstance()

Gets a pointer to the current global Remotery instance.

public static String
rmt_GetLastErrorMessage()

Gets the last error message issued on the calling thread

public static void
public static boolean
public static void
public static void
public static native int
rmt_MarkFrame()

Used for both CPU and GPU profiling.

public static void
rmt_PropertyAdd_F32(RMTProperty property, float add_value, MemoryStack frame)

public static void
public static void
rmt_PropertyAdd_F64(RMTProperty property, double add_value, MemoryStack frame)

public static void
public static void
rmt_PropertyAdd_S32(RMTProperty property, int add_value, MemoryStack frame)

public static void
public static void
rmt_PropertyAdd_S64(RMTProperty property, long add_value, MemoryStack frame)

public static void
public static void
rmt_PropertyAdd_U32(RMTProperty property, int add_value, MemoryStack frame)

public static void
public static void
rmt_PropertyAdd_U64(RMTProperty property, long add_value, MemoryStack frame)

public static void
public static RMTProperty

Returns:

the initialized property
rmt_PropertyDefine
(int type, int flags, RMTPropertyValue default_value, ByteBuffer name, ByteBuffer desc, RMTProperty parent, RMTProperty __result)

Initializes the __result RMTProperty with the specified values.

public static RMTProperty

Returns:

the new property
rmt_PropertyDefine
(int type, int flags, RMTPropertyValue default_value, String name, String desc, RMTProperty parent, MemoryStack frame)

Uses the specified MemoryStack frame to encode the name and desc strings and allocate memory for a new RMTProperty, then initializes the property with the specified values.

public static RMTProperty

Returns:

the new boolean property
rmt_PropertyDefine_Bool
(String name, boolean default_value, int flags, String desc, RMTProperty parent, MemoryStack frame)

Allocates a new boolean property on the specified MemoryStack frame and initializes it.

public static RMTProperty

Returns:

the new F32 property
rmt_PropertyDefine_F32
(String name, float default_value, int flags, String desc, RMTProperty parent, MemoryStack frame)

Allocates a new F32 property on the specified MemoryStack frame and initializes it.

public static RMTProperty

Returns:

the new F64 property
rmt_PropertyDefine_F64
(String name, double default_value, int flags, String desc, RMTProperty parent, MemoryStack frame)

Allocates a new F64 property on the specified MemoryStack frame and initializes it.

public static RMTProperty

Returns:

the new group property
rmt_PropertyDefine_Group
(String name, String desc, RMTProperty parent, MemoryStack frame)

Allocates a new group property on the specified MemoryStack frame and initializes it.

public static RMTProperty

Returns:

the new S32 property
rmt_PropertyDefine_S32
(String name, int default_value, int flags, String desc, RMTProperty parent, MemoryStack frame)

Allocates a new S32 property on the specified MemoryStack frame and initializes it.

public static RMTProperty

Returns:

the new S64 property
rmt_PropertyDefine_S64
(String name, long default_value, int flags, String desc, RMTProperty parent, MemoryStack frame)

Allocates a new S64 property on the specified MemoryStack frame and initializes it.

public static RMTProperty

Returns:

the new U32 property
rmt_PropertyDefine_U32
(String name, int default_value, int flags, String desc, RMTProperty parent, MemoryStack frame)

Allocates a new U32 property on the specified MemoryStack frame and initializes it.

public static RMTProperty

Returns:

the new U64 property
rmt_PropertyDefine_U64
(String name, long default_value, int flags, String desc, RMTProperty parent, MemoryStack frame)

Allocates a new U64 property on the specified MemoryStack frame and initializes it.

public static native void
rmt_PropertyFrameResetAll()

Resets all PropertyFlags_FrameReset properties to their default value.

public static String
public static String
public static int
public static RMTPropertyValue
public static void
public static boolean
public static void
rmt_PropertySet_Bool(RMTProperty property, boolean value)

public static void
rmt_PropertySet_F32(RMTProperty property, float value)

public static void
rmt_PropertySet_F64(RMTProperty property, double value)

public static void
rmt_PropertySet_S32(RMTProperty property, int value)

public static void
rmt_PropertySet_S64(RMTProperty property, long value)

public static void
rmt_PropertySet_U32(RMTProperty property, int value)

public static void
rmt_PropertySet_U64(RMTProperty property, long value)

public static native int
rmt_PropertySnapshotAll()

Sends all properties and their values to the viewer and log to file.

public static int
public static void
public static String
rmt_SampleGetName(long sample)

Should only called from within the sample tree callback, when the internal string lookup table is valid (i.e. on the main Remotery thread).

public static int
rmt_SampleGetNameHash(long sample)

public static long
rmt_SampleGetSelfTime(long sample)

public static long
rmt_SampleGetStart(long sample)

public static long
rmt_SampleGetTime(long sample)

public static int
rmt_SampleGetType(long sample)

public static long
rmt_SampleTreeGetRootSample(long sample_tree)

public static String
rmt_SampleTreeGetThreadName(long sample_tree)

public static void
public static void
public static void
rmt_SetGlobalInstance(long remotery)

For use in the presence of DLLs/SOs if each of them are linking Remotery statically.

public static RMTSettings
rmt_Settings()

Retrieve and configure the global rmtSettings object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait