Class TracyClient
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ZoneBegin a zone with the given name.static ZoneBegin a zone with the given name and source location.static ContinuousFramecreateContinuousFrame(String name) Creates a secondarycontinuous frametype with the given name.static DiscontinuousFrameCreates a secondarydiscontinuous frametype with the given name.static GpuContextcreateGpuContext(GpuApi api, long gpuTimestamp, float gpuPeriod) Creates a new GPU context that you can use to record GPU zones on.static MemoryPoolcreateMemoryPool(String name) Creates a pool of memory with the given name.static PlotcreatePlot(String name) Creates aplotwith the given name.static voidframeImage(ByteBuffer image, int width, int height, int offset, boolean flip) Upload an image representing a captured frame.static booleanReturnstrueif the Tracy client is available.static voidload()Attempt to load the Tracy client.static voidMark the boundary between two render frames.static voidRecords a message in Tracy's timeline.static voidRecords a colored message in Tracy's timeline.static voidRecords a message in Tracy's timeline.static voidRecords a colored message in Tracy's timeline.static voidreportAppInfo(String text) Records any information about this application into the profiled data.static voidsetThreadName(String name, int group) Set the name of the current thread in Tracy.
-
Constructor Details
-
TracyClient
public TracyClient()
-
-
Method Details
-
isAvailable
public static boolean isAvailable()Returnstrueif the Tracy client is available.This will only be the case if the natives have been loaded successfully. This will not be the case until the first call to
load(), and only if that call was successful.- Returns:
trueif Tracy is available
-
load
Attempt to load the Tracy client.This will only function if the client is so far unavailable. Repeated calls after it's loaded will do nothing. If the library fails to load, it will throw an exception.
- Throws:
UnsatisfiedLinkError- Any appropriate error that caused the library to not load.
-
markFrame
public static void markFrame()Mark the boundary between two render frames. This ideally should be after the swap buffers command, when all rendering is submitted to the gpu. -
frameImage
Upload an image representing a captured frame.It is strongly recommended to use a small an image as possible; ideally 320x180. A large image (256 KB after compression) may not be accepted.
- Parameters:
image- The image to upload. It must be a direct buffer.width- Width of the image, in pixels. It must be divisible by 4.height- Height of the image, in pixels. It must be divisible by 4.offset- The offset of this image from the current frame. 0 means this frame, 1 is last frame, etc.flip- If this image is upside-down (e.g. OpenGL)
-
beginZone
Begin a zone with the given name. You must end the zone after it is finished, in the correct (reverse) order they were created.- Parameters:
name- Name of the zone to displaycaptureSource- Whether to capture the callers source location. This adds more overhead.- Returns:
- A handle to a zone that you can end
-
beginZone
Begin a zone with the given name and source location.- Parameters:
name- Name of the zone to displayfunction- Name of the function that this zone belongs tofile- Name of the file that this zone belongs toline- Line number of the file that this zone belongs to- Returns:
- A handle to a zone that you can end
-
setThreadName
Set the name of the current thread in Tracy.- Parameters:
name- Name of the thread to displaygroup- An arbitrary group id; 0 means no group!
-
createPlot
Creates aplotwith the given name. Names should be unique, you should reuse the object returned instead of creating multipleplotsfor the same name.- Parameters:
name- Name of the plot- Returns:
- A plot that you can interact with
- See Also:
-
createDiscontinuousFrame
Creates a secondarydiscontinuous frametype with the given name. Names should be unique, you should reuse the object returned instead of creating multiplediscontinuous framesfor the same name.Unlike
continuous frames,discontinuous framesmust have their beginning and end explicitly marked, and there may be gaps.- Parameters:
name- Name of the frame- Returns:
- A frame that you can interact with
- See Also:
-
createContinuousFrame
Creates a secondarycontinuous frametype with the given name. Names should be unique, you should reuse the object returned instead of creating multiplecontinuous framesfor the same name.Unlike
discontinuous frames,continuous frameshave no gaps, and marking the end of one frame is immediately followed by the beginning of the next.- Parameters:
name- Name of the frame- Returns:
- A frame that you can interact with
- See Also:
-
createMemoryPool
Creates a pool of memory with the given name. Names should be unique, you should reuse the object returned instead of creating multipleMemoryPoolsfor the same name.This pool will not allocate, but should be used to inform Tracy of real allocations made by the application.
- Parameters:
name- Name of the pool of memory- Returns:
- A pool that you can interact with
-
reportAppInfo
Records any information about this application into the profiled data.This can be useful for recording the version, whether debugging is enabled, etc.
- Parameters:
text- Any information you wish to record
-
message
Records a message in Tracy's timeline. This might be used, for example, to capture the debug output of your application.- Parameters:
text- Message text to log- See Also:
-
message
Records a colored message in Tracy's timeline. This might be used, for example, to capture the debug output of your application.Color should be in 0xRRGGBB style.
- Parameters:
text- Message text to logcolor- Color for this message- See Also:
-
message
Records a message in Tracy's timeline. This might be used, for example, to capture the debug output of your application.- Parameters:
text-Supplierto provide the message text to log- See Also:
-
message
Records a colored message in Tracy's timeline. This might be used, for example, to capture the debug output of your application.Color should be in 0xRRGGBB style.
- Parameters:
text-Supplierto provide the message text to logcolor- Color for this message- See Also:
-
createGpuContext
Creates a new GPU context that you can use to record GPU zones on.Reuse the GpuContext returned by this object, as each context is unique. Multiple GPU contexts can live at the same time, but no more than 255.
- See Also:
-