mirror of
https://github.com/wolfpld/tracy.git
synced 2026-06-13 18:59:00 +00:00
Compare commits
3 Commits
master
...
slomp/webg
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f68dbcbbc | ||
|
|
3c90c2d7f8 | ||
|
|
7e572c55fb |
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -6,7 +6,7 @@
|
|||||||
"${workspaceFolder}/import",
|
"${workspaceFolder}/import",
|
||||||
"${workspaceFolder}/merge",
|
"${workspaceFolder}/merge",
|
||||||
"${workspaceFolder}/update",
|
"${workspaceFolder}/update",
|
||||||
"${workspaceFolder}/tests/tracy",
|
"${workspaceFolder}/test",
|
||||||
"${workspaceFolder}",
|
"${workspaceFolder}",
|
||||||
],
|
],
|
||||||
"cmake.buildDirectory": "${sourceDirectory}/build",
|
"cmake.buildDirectory": "${sourceDirectory}/build",
|
||||||
|
|||||||
29
NEWS
29
NEWS
@@ -5,16 +5,9 @@ here.
|
|||||||
vx.xx.x (2026-xx-xx)
|
vx.xx.x (2026-xx-xx)
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
- API break: removed "secure" variants of memory alloc and free macros. The
|
|
||||||
secure code path is now always enabled. Migrate by removing "Secure" from
|
|
||||||
the macros you use, e.g. TracySecureAlloc(...) -> TracyAlloc(...).
|
|
||||||
- Added tracy-capture-daemon for automated multi-client trace capture.
|
- Added tracy-capture-daemon for automated multi-client trace capture.
|
||||||
- Added tracy-merge utility for combining multiple trace files into one.
|
- Added tracy-merge utility for combining multiple trace files into one.
|
||||||
- Added support for Windows on ARM64 with MSVC.
|
- Added support for Windows on ARM64 with MSVC.
|
||||||
- Added support for WebGPU.
|
|
||||||
- Trace-specific settings storage has been completely overhauled. It is now
|
|
||||||
possible to make the settings sidecar file public, saved next to the trace
|
|
||||||
file.
|
|
||||||
- External frames are now omitted in the single-line call stack list visible
|
- External frames are now omitted in the single-line call stack list visible
|
||||||
in messages list, or in memory allocation info window.
|
in messages list, or in memory allocation info window.
|
||||||
- External frames are now hidden by default in various contexts where they
|
- External frames are now hidden by default in various contexts where they
|
||||||
@@ -154,13 +147,8 @@ vx.xx.x (2026-xx-xx)
|
|||||||
- There is now chapter tree and the manual contents are displayed section
|
- There is now chapter tree and the manual contents are displayed section
|
||||||
by section.
|
by section.
|
||||||
- Links to chapters are now properly working.
|
- Links to chapters are now properly working.
|
||||||
- The "bclogo" blocks are now correctly processed and displayed as proper
|
- The "bclogo" blocks are now correctly processed.
|
||||||
admonitions.
|
|
||||||
- The font awesome icons now show as in the rest of the UI.
|
- The font awesome icons now show as in the rest of the UI.
|
||||||
- Footnotes are now rendered as proper footnotes.
|
|
||||||
- Tables are now rendered as intended.
|
|
||||||
- LaTeX math is now converted to readable form.
|
|
||||||
- Added a button to download the full PDF manual to the user manual window.
|
|
||||||
- Call stack window will now show the thread viewed call stack originates
|
- Call stack window will now show the thread viewed call stack originates
|
||||||
from (if possible).
|
from (if possible).
|
||||||
- "Visible threads" checkboxes in messages, flame graph and wait stacks
|
- "Visible threads" checkboxes in messages, flame graph and wait stacks
|
||||||
@@ -184,21 +172,6 @@ vx.xx.x (2026-xx-xx)
|
|||||||
- Fixed NVCC builds.
|
- Fixed NVCC builds.
|
||||||
- Fixed possible lockups in Vulkan timer calibration loop.
|
- Fixed possible lockups in Vulkan timer calibration loop.
|
||||||
- The flame graph view now supports zooming in and panning with the mouse.
|
- The flame graph view now supports zooming in and panning with the mouse.
|
||||||
- General application crash information polish in the profiler UI.
|
|
||||||
- The achievements system has been converted to use markdown renderer.
|
|
||||||
- Offline symbol resolution with the update utility now supports custom
|
|
||||||
addr2line-compatible tools via -a and -A command line parameters.
|
|
||||||
Additionally, it is now possible to reset all call stack frame symbols to
|
|
||||||
unresolved with the -R parameter.
|
|
||||||
- Periodic recalibration of the clock drift in OpenGL contexts can be enabled
|
|
||||||
with the TRACY_OPENGL_AUTO_CALIBRATION compilation define. Note that this
|
|
||||||
requires a full CPU/GPU sync on each calibration event. These events will
|
|
||||||
not fire more often than once every second.
|
|
||||||
- Added missing C API for shared locks.
|
|
||||||
- Implemented semi-unique, nonsense random name generator.
|
|
||||||
- Can be used to set a trace description.
|
|
||||||
- Will be used to provide default description for newly added annotations.
|
|
||||||
- Polished look and feel of annotation regions on the timeline.
|
|
||||||
|
|
||||||
|
|
||||||
v0.13.1 (2025-12-11)
|
v0.13.1 (2025-12-11)
|
||||||
|
|||||||
@@ -78,12 +78,20 @@ if(APPLE)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Platform-specific source and link settings
|
# Platform — RGFW (cross-platform windowing, fetched automatically)
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
set(PLATFORM_GENERATED_INCLUDES "")
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(rgfw
|
||||||
|
GIT_REPOSITORY https://github.com/ColleagueRiley/RGFW.git
|
||||||
|
GIT_TAG main # pin to a specific commit for reproducible builds
|
||||||
|
GIT_SHALLOW TRUE
|
||||||
|
)
|
||||||
|
FetchContent_MakeAvailable(rgfw)
|
||||||
|
|
||||||
|
set(PLATFORM_SOURCES platform/platform_rgfw.cpp)
|
||||||
|
set(PLATFORM_INCLUDES ${rgfw_SOURCE_DIR})
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(PLATFORM_SOURCES platform/platform_macos.mm)
|
|
||||||
set(PLATFORM_LIBS
|
set(PLATFORM_LIBS
|
||||||
"-framework Cocoa"
|
"-framework Cocoa"
|
||||||
"-framework Metal"
|
"-framework Metal"
|
||||||
@@ -92,45 +100,14 @@ if(APPLE)
|
|||||||
"-framework IOKit"
|
"-framework IOKit"
|
||||||
"-framework IOSurface"
|
"-framework IOSurface"
|
||||||
)
|
)
|
||||||
set_source_files_properties(platform/platform_macos.mm
|
|
||||||
PROPERTIES COMPILE_FLAGS "-ObjC++"
|
|
||||||
)
|
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
set(PLATFORM_SOURCES platform/platform_windows.cpp)
|
|
||||||
set(PLATFORM_LIBS user32 gdi32)
|
set(PLATFORM_LIBS user32 gdi32)
|
||||||
else()
|
else()
|
||||||
# Linux / Wayland — generate xdg-shell protocol glue via wayland-scanner.
|
find_package(X11 REQUIRED)
|
||||||
find_package(PkgConfig REQUIRED)
|
if(NOT X11_Xrandr_FOUND)
|
||||||
pkg_check_modules(WAYLAND_PROTOCOLS REQUIRED wayland-protocols)
|
message(FATAL_ERROR "Xrandr not found — install libxrandr-dev")
|
||||||
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
|
endif()
|
||||||
find_program(WAYLAND_SCANNER wayland-scanner REQUIRED)
|
set(PLATFORM_LIBS X11::X11 X11::Xrandr)
|
||||||
|
|
||||||
set(XDG_SHELL_XML "${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml")
|
|
||||||
set(XDG_SHELL_H "${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-client-protocol.h")
|
|
||||||
set(XDG_SHELL_C "${CMAKE_CURRENT_BINARY_DIR}/xdg-shell-protocol.c")
|
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT "${XDG_SHELL_H}"
|
|
||||||
COMMAND "${WAYLAND_SCANNER}" client-header "${XDG_SHELL_XML}" "${XDG_SHELL_H}"
|
|
||||||
DEPENDS "${XDG_SHELL_XML}"
|
|
||||||
COMMENT "Generating xdg-shell-client-protocol.h"
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT "${XDG_SHELL_C}"
|
|
||||||
COMMAND "${WAYLAND_SCANNER}" private-code "${XDG_SHELL_XML}" "${XDG_SHELL_C}"
|
|
||||||
DEPENDS "${XDG_SHELL_XML}"
|
|
||||||
COMMENT "Generating xdg-shell-protocol.c"
|
|
||||||
VERBATIM
|
|
||||||
)
|
|
||||||
|
|
||||||
set(PLATFORM_SOURCES
|
|
||||||
platform/platform_wayland.cpp
|
|
||||||
"${XDG_SHELL_C}"
|
|
||||||
"${XDG_SHELL_H}"
|
|
||||||
)
|
|
||||||
set(PLATFORM_LIBS wayland-client)
|
|
||||||
set(PLATFORM_GENERATED_INCLUDES "${CMAKE_CURRENT_BINARY_DIR}")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
@@ -163,7 +140,7 @@ endif()
|
|||||||
target_include_directories(spinning_triangle PRIVATE
|
target_include_directories(spinning_triangle PRIVATE
|
||||||
"${WGPU_PATH}/include"
|
"${WGPU_PATH}/include"
|
||||||
"${TRACY_DIR}/public"
|
"${TRACY_DIR}/public"
|
||||||
${PLATFORM_GENERATED_INCLUDES}
|
${PLATFORM_INCLUDES}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_directories(spinning_triangle PRIVATE "${WGPU_PATH}/lib")
|
target_link_directories(spinning_triangle PRIVATE "${WGPU_PATH}/lib")
|
||||||
|
|||||||
@@ -1,121 +0,0 @@
|
|||||||
// platform_macos.mm — macOS backend (Cocoa + CAMetalLayer)
|
|
||||||
//
|
|
||||||
// Compile flags (see spinning_triangle.cpp header for full invocation):
|
|
||||||
// -ObjC++ -framework Cocoa -framework Metal -framework QuartzCore \
|
|
||||||
// -framework Foundation -framework IOKit -framework IOSurface
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
#import <QuartzCore/CAMetalLayer.h>
|
|
||||||
#include <CoreFoundation/CFDate.h>
|
|
||||||
#include <webgpu/webgpu.h>
|
|
||||||
#include "platform.h"
|
|
||||||
|
|
||||||
static CAMetalLayer* sMetalLayer = nullptr;
|
|
||||||
static CFAbsoluteTime sStartTime = 0;
|
|
||||||
static void (*sRenderCb)() = nullptr;
|
|
||||||
static void (*sShutdownCb)() = nullptr;
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Cocoa app — window, metal layer, render timer
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
@interface AppDelegate : NSObject <NSApplicationDelegate, NSWindowDelegate>
|
|
||||||
@property (strong) NSWindow* window;
|
|
||||||
@property (strong) NSTimer* timer;
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation AppDelegate
|
|
||||||
|
|
||||||
- (void)applicationDidFinishLaunching:(NSNotification*)notification {
|
|
||||||
// ~60 fps render loop
|
|
||||||
self.timer = [NSTimer scheduledTimerWithTimeInterval:1.0 / 60.0
|
|
||||||
target:self
|
|
||||||
selector:@selector(tick:)
|
|
||||||
userInfo:nil
|
|
||||||
repeats:YES];
|
|
||||||
[[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
|
|
||||||
|
|
||||||
[NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskKeyDown
|
|
||||||
handler:^NSEvent*(NSEvent* event) {
|
|
||||||
if (event.keyCode == 53) { // kVK_Escape
|
|
||||||
[NSApp terminate:nil];
|
|
||||||
return nil;
|
|
||||||
}
|
|
||||||
return event;
|
|
||||||
}];
|
|
||||||
|
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
|
||||||
[self.window makeKeyAndOrderFront:nil];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)tick:(NSTimer*)t {
|
|
||||||
if (sRenderCb) sRenderCb();
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)app {
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)applicationWillTerminate:(NSNotification*)notification {
|
|
||||||
[self.timer invalidate];
|
|
||||||
if (sShutdownCb) sShutdownCb();
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Platform interface implementation
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
bool platformInit(int width, int height, const char* title) {
|
|
||||||
NSApplication* app = [NSApplication sharedApplication];
|
|
||||||
[app setActivationPolicy:NSApplicationActivationPolicyRegular];
|
|
||||||
|
|
||||||
NSRect frame = NSMakeRect(200, 200, width, height);
|
|
||||||
NSWindow* window = [[NSWindow alloc]
|
|
||||||
initWithContentRect:frame
|
|
||||||
styleMask:(NSWindowStyleMaskTitled |
|
|
||||||
NSWindowStyleMaskClosable |
|
|
||||||
NSWindowStyleMaskMiniaturizable)
|
|
||||||
backing:NSBackingStoreBuffered
|
|
||||||
defer:NO];
|
|
||||||
[window setTitle:[NSString stringWithUTF8String:title]];
|
|
||||||
|
|
||||||
// Metal-backed layer
|
|
||||||
NSView* contentView = [window contentView];
|
|
||||||
[contentView setWantsLayer:YES];
|
|
||||||
sMetalLayer = [CAMetalLayer layer];
|
|
||||||
sMetalLayer.frame = contentView.bounds;
|
|
||||||
sMetalLayer.contentsScale = [window backingScaleFactor];
|
|
||||||
sMetalLayer.pixelFormat = MTLPixelFormatBGRA8Unorm;
|
|
||||||
[contentView.layer addSublayer:sMetalLayer];
|
|
||||||
|
|
||||||
AppDelegate* del = [[AppDelegate alloc] init];
|
|
||||||
del.window = window;
|
|
||||||
[app setDelegate:del];
|
|
||||||
|
|
||||||
sStartTime = CFAbsoluteTimeGetCurrent();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
WGPUSurface platformCreateSurface(WGPUInstance instance) {
|
|
||||||
WGPUSurfaceSourceMetalLayer metalSrc = {};
|
|
||||||
metalSrc.chain.sType = WGPUSType_SurfaceSourceMetalLayer;
|
|
||||||
metalSrc.layer = sMetalLayer;
|
|
||||||
|
|
||||||
WGPUSurfaceDescriptor surfDesc = {};
|
|
||||||
surfDesc.nextInChain = (WGPUChainedStruct*)&metalSrc;
|
|
||||||
return wgpuInstanceCreateSurface(instance, &surfDesc);
|
|
||||||
}
|
|
||||||
|
|
||||||
double platformGetTime() {
|
|
||||||
return CFAbsoluteTimeGetCurrent() - sStartTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
void platformRunLoop(void (*render)(), void (*shutdown)()) {
|
|
||||||
sRenderCb = render;
|
|
||||||
sShutdownCb = shutdown;
|
|
||||||
@autoreleasepool {
|
|
||||||
[[NSApplication sharedApplication] run];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
72
examples/webgpu/triangle/platform/platform_rgfw.cpp
Normal file
72
examples/webgpu/triangle/platform/platform_rgfw.cpp
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
// platform_rgfw.cpp — RGFW windowing backend for the WebGPU example
|
||||||
|
// https://github.com/ColleagueRiley/RGFW
|
||||||
|
|
||||||
|
#include "platform.h" // webgpu/webgpu.h first so RGFW sees WGPUSurface
|
||||||
|
|
||||||
|
#define RGFW_WEBGPU
|
||||||
|
#define RGFW_IMPLEMENTATION
|
||||||
|
#include <RGFW.h>
|
||||||
|
|
||||||
|
#include <chrono>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
|
#if defined(__linux__)
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
static bool platformHasDisplay() {
|
||||||
|
// RGFW workaround: RGFW indiscriminately passes XOpenDisplay(0) unchecked
|
||||||
|
// to X11 functions like XCreateWindow(), which will lead to SIGSEGV.
|
||||||
|
Display* display = XOpenDisplay(0);
|
||||||
|
if (display == nullptr) {
|
||||||
|
fprintf(stderr, "ERROR: failed to open X11 display (is $DISPLAY set?)\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
XCloseDisplay(display);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
static bool platformHasDisplay() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static RGFW_window* sWin = nullptr;
|
||||||
|
static std::chrono::steady_clock::time_point sStartTime;
|
||||||
|
|
||||||
|
bool platformInit(int width, int height, const char* title) {
|
||||||
|
if (!platformHasDisplay()) {
|
||||||
|
fprintf(stderr, "ERROR: no display found\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
sWin = RGFW_createWindow(title, 0, 0, width, height, RGFW_windowCenter);
|
||||||
|
if (!sWin) {
|
||||||
|
fprintf(stderr, "ERROR: failed to create window\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
RGFW_window_setExitKey(sWin, RGFW_keyEscape);
|
||||||
|
sStartTime = std::chrono::steady_clock::now();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
WGPUSurface platformCreateSurface(WGPUInstance instance) {
|
||||||
|
return RGFW_window_createSurface_WebGPU(sWin, instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
double platformGetTime() {
|
||||||
|
return std::chrono::duration<double>(
|
||||||
|
std::chrono::steady_clock::now() - sStartTime).count();
|
||||||
|
}
|
||||||
|
|
||||||
|
void platformRunLoop(void (*render)(), void (*shutdown)()) {
|
||||||
|
while (RGFW_window_shouldClose(sWin) == RGFW_FALSE) {
|
||||||
|
RGFW_event event;
|
||||||
|
while (RGFW_window_checkEvent(sWin, &event)) {
|
||||||
|
if (event.type == RGFW_windowClose) goto done;
|
||||||
|
}
|
||||||
|
render();
|
||||||
|
}
|
||||||
|
done:
|
||||||
|
shutdown();
|
||||||
|
RGFW_window_close(sWin);
|
||||||
|
sWin = nullptr;
|
||||||
|
}
|
||||||
@@ -1,213 +0,0 @@
|
|||||||
// platform_wayland.cpp — Linux/Wayland backend
|
|
||||||
//
|
|
||||||
// Dependencies:
|
|
||||||
// libwayland-client, wayland-protocols (for xdg-shell)
|
|
||||||
//
|
|
||||||
// Generate xdg-shell protocol glue before building:
|
|
||||||
// XML=$(pkg-config --variable=pkgdatadir wayland-protocols)/stable/xdg-shell/xdg-shell.xml
|
|
||||||
// wayland-scanner client-header $XML xdg-shell-client-protocol.h
|
|
||||||
// wayland-scanner private-code $XML xdg-shell-protocol.c
|
|
||||||
//
|
|
||||||
// Compile flags (see spinning_triangle.cpp header for full invocation):
|
|
||||||
// g++ -std=c++17 spinning_triangle.cpp platform_wayland.cpp \
|
|
||||||
// xdg-shell-protocol.c \
|
|
||||||
// -I/path/to/wgpu/include -L/path/to/wgpu/lib -lwgpu_native \
|
|
||||||
// $(pkg-config --cflags --libs wayland-client) \
|
|
||||||
// -o spinning_triangle
|
|
||||||
|
|
||||||
#include <wayland-client.h>
|
|
||||||
#include "xdg-shell-client-protocol.h"
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <cstring>
|
|
||||||
#include <time.h>
|
|
||||||
#include <webgpu/webgpu.h>
|
|
||||||
#include "platform.h"
|
|
||||||
|
|
||||||
static wl_display* sDisplay = nullptr;
|
|
||||||
static wl_compositor* sCompositor = nullptr;
|
|
||||||
static xdg_wm_base* sWmBase = nullptr;
|
|
||||||
static wl_seat* sSeat = nullptr;
|
|
||||||
static wl_keyboard* sKeyboard = nullptr;
|
|
||||||
static wl_surface* sSurface = nullptr;
|
|
||||||
static xdg_surface* sXdgSurface = nullptr;
|
|
||||||
static xdg_toplevel* sToplevel = nullptr;
|
|
||||||
static bool sConfigured = false;
|
|
||||||
static bool sRunning = false;
|
|
||||||
static struct timespec sStartTime = {};
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// xdg_wm_base listener — ping/pong keepalive
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static void wmBasePing(void*, xdg_wm_base* wm, uint32_t serial) {
|
|
||||||
xdg_wm_base_pong(wm, serial);
|
|
||||||
}
|
|
||||||
static const xdg_wm_base_listener kWmBaseListener = { wmBasePing };
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// xdg_surface listener — acknowledge configure events
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static void xdgSurfaceConfigure(void*, xdg_surface* surf, uint32_t serial) {
|
|
||||||
xdg_surface_ack_configure(surf, serial);
|
|
||||||
sConfigured = true;
|
|
||||||
}
|
|
||||||
static const xdg_surface_listener kXdgSurfaceListener = { xdgSurfaceConfigure };
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// xdg_toplevel listener — window close / resize
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static void toplevelClose(void*, xdg_toplevel*) {
|
|
||||||
sRunning = false;
|
|
||||||
}
|
|
||||||
static void toplevelConfigure(void*, xdg_toplevel*, int32_t, int32_t, wl_array*) {}
|
|
||||||
static const xdg_toplevel_listener kToplevelListener = { toplevelConfigure, toplevelClose };
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Keyboard listener — Escape to quit
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static void kbdKeymap(void*, wl_keyboard*, uint32_t, int32_t, uint32_t) {}
|
|
||||||
static void kbdEnter(void*, wl_keyboard*, uint32_t, wl_surface*, wl_array*) {}
|
|
||||||
static void kbdLeave(void*, wl_keyboard*, uint32_t, wl_surface*) {}
|
|
||||||
static void kbdKey(void*, wl_keyboard*, uint32_t, uint32_t, uint32_t key, uint32_t state) {
|
|
||||||
// key 1 == KEY_ESC in Linux evdev (linux/input-event-codes.h)
|
|
||||||
if (key == 1 && state == WL_KEYBOARD_KEY_STATE_PRESSED)
|
|
||||||
sRunning = false;
|
|
||||||
}
|
|
||||||
static void kbdModifiers(void*, wl_keyboard*, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t) {}
|
|
||||||
static void kbdRepeatInfo(void*, wl_keyboard*, int32_t, int32_t) {}
|
|
||||||
static const wl_keyboard_listener kKbdListener = {
|
|
||||||
kbdKeymap, kbdEnter, kbdLeave, kbdKey, kbdModifiers, kbdRepeatInfo
|
|
||||||
};
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// wl_seat listener — grab keyboard capability
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static void seatCapabilities(void*, wl_seat* seat, uint32_t caps) {
|
|
||||||
if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !sKeyboard) {
|
|
||||||
sKeyboard = wl_seat_get_keyboard(seat);
|
|
||||||
wl_keyboard_add_listener(sKeyboard, &kKbdListener, nullptr);
|
|
||||||
} else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && sKeyboard) {
|
|
||||||
wl_keyboard_release(sKeyboard);
|
|
||||||
sKeyboard = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void seatName(void*, wl_seat*, const char*) {}
|
|
||||||
static const wl_seat_listener kSeatListener = { seatCapabilities, seatName };
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Registry listener — bind global interfaces
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static void registryGlobal(void*, wl_registry* reg,
|
|
||||||
uint32_t name, const char* iface, uint32_t ver) {
|
|
||||||
if (strcmp(iface, wl_compositor_interface.name) == 0)
|
|
||||||
sCompositor = (wl_compositor*)wl_registry_bind(reg, name, &wl_compositor_interface, 4);
|
|
||||||
else if (strcmp(iface, xdg_wm_base_interface.name) == 0) {
|
|
||||||
sWmBase = (xdg_wm_base*)wl_registry_bind(reg, name, &xdg_wm_base_interface, 1);
|
|
||||||
xdg_wm_base_add_listener(sWmBase, &kWmBaseListener, nullptr);
|
|
||||||
} else if (strcmp(iface, wl_seat_interface.name) == 0) {
|
|
||||||
sSeat = (wl_seat*)wl_registry_bind(reg, name, &wl_seat_interface, 5);
|
|
||||||
wl_seat_add_listener(sSeat, &kSeatListener, nullptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void registryGlobalRemove(void*, wl_registry*, uint32_t) {}
|
|
||||||
static const wl_registry_listener kRegistryListener = { registryGlobal, registryGlobalRemove };
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Platform interface implementation
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
bool platformInit(int width, int height, const char* title) {
|
|
||||||
sDisplay = wl_display_connect(nullptr);
|
|
||||||
if (!sDisplay) { fprintf(stderr, "Cannot connect to Wayland display\n"); return false; }
|
|
||||||
|
|
||||||
wl_registry* registry = wl_display_get_registry(sDisplay);
|
|
||||||
wl_registry_add_listener(registry, &kRegistryListener, nullptr);
|
|
||||||
|
|
||||||
// Two roundtrips: first to enumerate globals, second for seat capabilities
|
|
||||||
wl_display_roundtrip(sDisplay);
|
|
||||||
wl_display_roundtrip(sDisplay);
|
|
||||||
|
|
||||||
if (!sCompositor) { fprintf(stderr, "No wl_compositor\n"); return false; }
|
|
||||||
if (!sWmBase) { fprintf(stderr, "No xdg_wm_base\n"); return false; }
|
|
||||||
|
|
||||||
sSurface = wl_compositor_create_surface(sCompositor);
|
|
||||||
sXdgSurface = xdg_wm_base_get_xdg_surface(sWmBase, sSurface);
|
|
||||||
sToplevel = xdg_surface_get_toplevel(sXdgSurface);
|
|
||||||
|
|
||||||
xdg_surface_add_listener(sXdgSurface, &kXdgSurfaceListener, nullptr);
|
|
||||||
xdg_toplevel_add_listener(sToplevel, &kToplevelListener, nullptr);
|
|
||||||
xdg_toplevel_set_title(sToplevel, title);
|
|
||||||
xdg_toplevel_set_app_id(sToplevel, "spinning_triangle");
|
|
||||||
|
|
||||||
wl_surface_commit(sSurface);
|
|
||||||
|
|
||||||
// Wait for the compositor to send the first configure
|
|
||||||
while (!sConfigured) wl_display_dispatch(sDisplay);
|
|
||||||
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &sStartTime);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
WGPUSurface platformCreateSurface(WGPUInstance instance) {
|
|
||||||
WGPUSurfaceSourceWaylandSurface waylandSrc = {};
|
|
||||||
waylandSrc.chain.sType = WGPUSType_SurfaceSourceWaylandSurface;
|
|
||||||
waylandSrc.display = sDisplay;
|
|
||||||
waylandSrc.surface = sSurface;
|
|
||||||
|
|
||||||
WGPUSurfaceDescriptor surfDesc = {};
|
|
||||||
surfDesc.nextInChain = (WGPUChainedStruct*)&waylandSrc;
|
|
||||||
return wgpuInstanceCreateSurface(instance, &surfDesc);
|
|
||||||
}
|
|
||||||
|
|
||||||
double platformGetTime() {
|
|
||||||
struct timespec now;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
|
||||||
return (double)(now.tv_sec - sStartTime.tv_sec)
|
|
||||||
+ (double)(now.tv_nsec - sStartTime.tv_nsec) * 1e-9;
|
|
||||||
}
|
|
||||||
|
|
||||||
void platformRunLoop(void (*render)(), void (*shutdown)()) {
|
|
||||||
// Target ~16.67 ms per frame (60 fps)
|
|
||||||
static const long kFrameNs = 1000000000L / 60;
|
|
||||||
|
|
||||||
sRunning = true;
|
|
||||||
while (sRunning) {
|
|
||||||
struct timespec frameStart;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &frameStart);
|
|
||||||
|
|
||||||
// Dispatch pending Wayland events without blocking
|
|
||||||
if (wl_display_dispatch_pending(sDisplay) < 0) break;
|
|
||||||
wl_display_flush(sDisplay);
|
|
||||||
|
|
||||||
if (sRunning) render();
|
|
||||||
|
|
||||||
// Sleep for the remainder of the frame budget
|
|
||||||
struct timespec frameEnd;
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &frameEnd);
|
|
||||||
long elapsed = (frameEnd.tv_sec - frameStart.tv_sec) * 1000000000L
|
|
||||||
+ (frameEnd.tv_nsec - frameStart.tv_nsec);
|
|
||||||
long remaining = kFrameNs - elapsed;
|
|
||||||
if (remaining > 0) {
|
|
||||||
struct timespec ts = { 0, remaining };
|
|
||||||
nanosleep(&ts, nullptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shutdown();
|
|
||||||
|
|
||||||
// Cleanup Wayland objects
|
|
||||||
if (sKeyboard) { wl_keyboard_release(sKeyboard); sKeyboard = nullptr; }
|
|
||||||
if (sToplevel) { xdg_toplevel_destroy(sToplevel); sToplevel = nullptr; }
|
|
||||||
if (sXdgSurface) { xdg_surface_destroy(sXdgSurface); sXdgSurface = nullptr; }
|
|
||||||
if (sSurface) { wl_surface_destroy(sSurface); sSurface = nullptr; }
|
|
||||||
if (sWmBase) { xdg_wm_base_destroy(sWmBase); sWmBase = nullptr; }
|
|
||||||
if (sSeat) { wl_seat_release(sSeat); sSeat = nullptr; }
|
|
||||||
if (sCompositor) { wl_compositor_destroy(sCompositor); sCompositor = nullptr; }
|
|
||||||
wl_display_disconnect(sDisplay);
|
|
||||||
}
|
|
||||||
@@ -1,135 +0,0 @@
|
|||||||
// platform_windows.cpp — Windows backend (Win32)
|
|
||||||
//
|
|
||||||
// Compile flags (MSVC, console subsystem):
|
|
||||||
// cl /std:c++17 spinning_triangle.cpp platform_windows.cpp \
|
|
||||||
// /I\path\to\wgpu\include \path\to\wgpu\lib\wgpu_native.lib \
|
|
||||||
// user32.lib gdi32.lib /Fe:spinning_triangle.exe
|
|
||||||
//
|
|
||||||
// MinGW/Clang equivalent:
|
|
||||||
// clang++ -std=c++17 spinning_triangle.cpp platform_windows.cpp \
|
|
||||||
// -I/path/to/wgpu/include -L/path/to/wgpu/lib -lwgpu_native \
|
|
||||||
// -luser32 -lgdi32 -o spinning_triangle.exe
|
|
||||||
|
|
||||||
#ifndef WIN32_LEAN_AND_MEAN
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
|
||||||
#endif
|
|
||||||
#include <windows.h>
|
|
||||||
#include <webgpu/webgpu.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include "platform.h"
|
|
||||||
|
|
||||||
#pragma comment(lib, "user32.lib")
|
|
||||||
#pragma comment(lib, "gdi32.lib")
|
|
||||||
#pragma comment(lib, "dxguid.lib") // Dawn: WKPDID_D3DDebugObjectName
|
|
||||||
#pragma comment(lib, "OneCore") // Dawn: CompareObjectHandles
|
|
||||||
#pragma comment(lib, "ntdll.lib") // wgpu-native: NtReadFile et al.
|
|
||||||
|
|
||||||
static HWND sHwnd = nullptr;
|
|
||||||
static bool sRunning = false;
|
|
||||||
static LARGE_INTEGER sFreq = {};
|
|
||||||
static LARGE_INTEGER sStartTime = {};
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Win32 window procedure
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
static LRESULT CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) {
|
|
||||||
switch (msg) {
|
|
||||||
case WM_KEYDOWN:
|
|
||||||
if (wp == VK_ESCAPE) { sRunning = false; return 0; }
|
|
||||||
break;
|
|
||||||
case WM_CLOSE:
|
|
||||||
case WM_DESTROY:
|
|
||||||
sRunning = false;
|
|
||||||
PostQuitMessage(0);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return DefWindowProcA(hwnd, msg, wp, lp);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
// Platform interface implementation
|
|
||||||
// ---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
bool platformInit(int width, int height, const char* title) {
|
|
||||||
WNDCLASSEXA wc = {};
|
|
||||||
wc.cbSize = sizeof(wc);
|
|
||||||
wc.style = CS_HREDRAW | CS_VREDRAW;
|
|
||||||
wc.lpfnWndProc = wndProc;
|
|
||||||
wc.hInstance = GetModuleHandleA(nullptr);
|
|
||||||
wc.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
|
||||||
wc.lpszClassName = "SpinningTriangle";
|
|
||||||
if (!RegisterClassExA(&wc)) {
|
|
||||||
fprintf(stderr, "RegisterClassExA failed (%lu)\n", GetLastError());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adjust client area to match the requested dimensions
|
|
||||||
RECT rect = { 0, 0, width, height };
|
|
||||||
AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW & ~(WS_THICKFRAME | WS_MAXIMIZEBOX), FALSE);
|
|
||||||
|
|
||||||
sHwnd = CreateWindowExA(
|
|
||||||
0, "SpinningTriangle", title,
|
|
||||||
WS_OVERLAPPEDWINDOW & ~(WS_THICKFRAME | WS_MAXIMIZEBOX),
|
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT,
|
|
||||||
rect.right - rect.left, rect.bottom - rect.top,
|
|
||||||
nullptr, nullptr, GetModuleHandleA(nullptr), nullptr);
|
|
||||||
if (!sHwnd) {
|
|
||||||
fprintf(stderr, "CreateWindowExA failed (%lu)\n", GetLastError());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ShowWindow(sHwnd, SW_SHOW);
|
|
||||||
UpdateWindow(sHwnd);
|
|
||||||
|
|
||||||
QueryPerformanceFrequency(&sFreq);
|
|
||||||
QueryPerformanceCounter(&sStartTime);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
WGPUSurface platformCreateSurface(WGPUInstance instance) {
|
|
||||||
WGPUSurfaceSourceWindowsHWND hwndSrc = {};
|
|
||||||
hwndSrc.chain.sType = WGPUSType_SurfaceSourceWindowsHWND;
|
|
||||||
hwndSrc.hinstance = GetModuleHandleA(nullptr);
|
|
||||||
hwndSrc.hwnd = sHwnd;
|
|
||||||
|
|
||||||
WGPUSurfaceDescriptor surfDesc = {};
|
|
||||||
surfDesc.nextInChain = (WGPUChainedStruct*)&hwndSrc;
|
|
||||||
return wgpuInstanceCreateSurface(instance, &surfDesc);
|
|
||||||
}
|
|
||||||
|
|
||||||
double platformGetTime() {
|
|
||||||
LARGE_INTEGER now;
|
|
||||||
QueryPerformanceCounter(&now);
|
|
||||||
return (double)(now.QuadPart - sStartTime.QuadPart) / (double)sFreq.QuadPart;
|
|
||||||
}
|
|
||||||
|
|
||||||
void platformRunLoop(void (*render)(), void (*shutdown)()) {
|
|
||||||
// Target ~16.67 ms per frame (60 fps)
|
|
||||||
static const double kFrameTime = 1.0 / 60.0;
|
|
||||||
|
|
||||||
sRunning = true;
|
|
||||||
while (sRunning) {
|
|
||||||
double frameStart = platformGetTime();
|
|
||||||
|
|
||||||
// Drain the Win32 message queue
|
|
||||||
MSG msg;
|
|
||||||
while (PeekMessageA(&msg, nullptr, 0, 0, PM_REMOVE)) {
|
|
||||||
if (msg.message == WM_QUIT) { sRunning = false; break; }
|
|
||||||
TranslateMessage(&msg);
|
|
||||||
DispatchMessageA(&msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sRunning) render();
|
|
||||||
|
|
||||||
// Sleep for the remainder of the frame budget
|
|
||||||
double elapsed = platformGetTime() - frameStart;
|
|
||||||
if (elapsed < kFrameTime) {
|
|
||||||
DWORD ms = (DWORD)((kFrameTime - elapsed) * 1000.0);
|
|
||||||
if (ms > 0) Sleep(ms);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shutdown();
|
|
||||||
if (sHwnd) DestroyWindow(sHwnd);
|
|
||||||
}
|
|
||||||
@@ -11,7 +11,7 @@ The user manual
|
|||||||
|
|
||||||
**Bartosz Taudul** [\<wolf@nereid.pl\>](mailto:wolf@nereid.pl)
|
**Bartosz Taudul** [\<wolf@nereid.pl\>](mailto:wolf@nereid.pl)
|
||||||
|
|
||||||
2026-06-12 <https://github.com/wolfpld/tracy>
|
2026-06-09 <https://github.com/wolfpld/tracy>
|
||||||
|
|
||||||
# Quick overview {#quick-overview .unnumbered}
|
# Quick overview {#quick-overview .unnumbered}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ Tracy is a real-time, nanosecond resolution *hybrid frame and sampling profiler*
|
|||||||
|
|
||||||
[^1]: Direct support is provided for C, C++, Lua, Python and Fortran integration. At the same time, third-party bindings to many other languages exist on the internet, such as Rust, Zig, C#, OCaml, Odin, etc.
|
[^1]: Direct support is provided for C, C++, Lua, Python and Fortran integration. At the same time, third-party bindings to many other languages exist on the internet, such as Rust, Zig, C#, OCaml, Odin, etc.
|
||||||
|
|
||||||
[^2]: All major graphics/compute APIs: OpenGL, Vulkan, Direct3D 11/12, Metal, OpenCL, CUDA, WebGPU.
|
[^2]: All major graphic APIs: OpenGL, Vulkan, Direct3D 11/12, Metal, OpenCL.
|
||||||
|
|
||||||
While Tracy can perform statistical analysis of sampled call stack data, just like other *statistical profilers* (such as VTune, perf, or Very Sleepy), it mainly focuses on manual markup of the source code. Such markup allows frame-by-frame inspection of the program execution. For example, you will be able to see exactly which functions are called, how much time they require, and how they interact with each other in a multi-threaded environment. In contrast, the statistical analysis may show you the hot spots in your code, but it cannot accurately pinpoint the underlying cause for semi-random frame stutter that may occur every couple of seconds.
|
While Tracy can perform statistical analysis of sampled call stack data, just like other *statistical profilers* (such as VTune, perf, or Very Sleepy), it mainly focuses on manual markup of the source code. Such markup allows frame-by-frame inspection of the program execution. For example, you will be able to see exactly which functions are called, how much time they require, and how they interact with each other in a multi-threaded environment. In contrast, the statistical analysis may show you the hot spots in your code, but it cannot accurately pinpoint the underlying cause for semi-random frame stutter that may occur every couple of seconds.
|
||||||
|
|
||||||
@@ -905,8 +905,6 @@ Some features of the profiler are only available on selected platforms. Please r
|
|||||||
| GPU zones (OpenGL) | | | | | | | |
|
| GPU zones (OpenGL) | | | | | | | |
|
||||||
| GPU zones (Vulkan) | | | | | | | |
|
| GPU zones (Vulkan) | | | | | | | |
|
||||||
| GPU zones (Metal) | | | | ^*b*^ | ^*b*^ | | |
|
| GPU zones (Metal) | | | | ^*b*^ | ^*b*^ | | |
|
||||||
| GPU zones (CUDA) | | | | | | ? | |
|
|
||||||
| GPU zones (WebGPU) | | | | | | ? | ? |
|
|
||||||
| Call stacks | | | | | | | |
|
| Call stacks | | | | | | | |
|
||||||
| Symbol resolution | | | | | | | |
|
| Symbol resolution | | | | | | | |
|
||||||
| Crash handling | | | | | | | |
|
| Crash handling | | | | | | | |
|
||||||
@@ -1418,6 +1416,8 @@ To mark memory events, use the `TracyAlloc(ptr, size)` and `TracyFree(ptr)` macr
|
|||||||
free(ptr);
|
free(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In some rare cases (e.g., destruction of TLS block), events may be reported after the profiler is no longer available, which would lead to a crash. To work around this issue, you may use `TracySecureAlloc` and `TracySecureFree` variants of the macros.
|
||||||
|
|
||||||
> [!IMPORTANT]
|
> [!IMPORTANT]
|
||||||
> **Important**
|
> **Important**
|
||||||
>
|
>
|
||||||
@@ -1446,11 +1446,9 @@ Sometimes an application will use more than one memory pool. For example, in add
|
|||||||
|
|
||||||
To mark that a separate memory pool is to be tracked you should use the named version of memory macros, for example `TracyAllocN(ptr, size, name)` and `TracyFreeN(ptr, name)`, where `name` is an unique pointer to a string literal (section [3.1.2](#uniquepointers)) identifying the memory pool.
|
To mark that a separate memory pool is to be tracked you should use the named version of memory macros, for example `TracyAllocN(ptr, size, name)` and `TracyFreeN(ptr, name)`, where `name` is an unique pointer to a string literal (section [3.1.2](#uniquepointers)) identifying the memory pool.
|
||||||
|
|
||||||
Certain memory allocator designs (\"arena allocators\") use an always-incrementing pointer to track the next region to allocate and do not support deallocation of individual objects. The only way to free memory with such an allocator is to simultaneously release all the objects that were allocated (reset the allocator state). You can mark such a mass-deallocation event in a memory pool with the `TracyMemoryDiscard(name)` macro.
|
|
||||||
|
|
||||||
## GPU profiling {#gpuprofiling}
|
## GPU profiling {#gpuprofiling}
|
||||||
|
|
||||||
Tracy provides bindings for profiling OpenGL, Vulkan, Direct3D 11, Direct3D 12, Metal, OpenCL, CUDA and WebGPU execution time on GPU.
|
Tracy provides bindings for profiling OpenGL, Vulkan, Direct3D 11, Direct3D 12, Metal, OpenCL and CUDA execution time on GPU.
|
||||||
|
|
||||||
Note that the CPU and GPU timers may be unsynchronized unless you create a calibrated context, but the availability of calibrated contexts is limited. You can try to correct the desynchronization of uncalibrated contexts in the profiler's options (section [5.4](#options)).
|
Note that the CPU and GPU timers may be unsynchronized unless you create a calibrated context, but the availability of calibrated contexts is limited. You can try to correct the desynchronization of uncalibrated contexts in the profiler's options (section [5.4](#options)).
|
||||||
|
|
||||||
@@ -1591,16 +1589,6 @@ Unlike other GPU backends in Tracy, there is no need to call `TracyCUDACollect(c
|
|||||||
|
|
||||||
To stop profiling, call the `TracyCUDAStopProfiling(ctx)` macro.
|
To stop profiling, call the `TracyCUDAStopProfiling(ctx)` macro.
|
||||||
|
|
||||||
### WebGPU
|
|
||||||
|
|
||||||
WebGPU support is enabled by including the `public/tracy/TracyWebGPU.hpp` header file. Both major implementations of WebGPU (Dawn and wgpu-native) are supported.
|
|
||||||
|
|
||||||
Before creating the WebGPU device, make sure to call `TracyWebGPUSetupDeviceDescriptor()` to let Tracy request the necessary device features and extensions necessary for profiling. After the device is created, use the `TracyWebGPUContext()` macro to instantiate the necessary `WebGPUQueueCtx` object required for GPU instrumentation. The object should later be cleaned up with the `TracyWebGPUDestroy()` macro. To set a custom name for the context, use the `TracyWebGPUContextName()` macro.
|
|
||||||
|
|
||||||
To instrument a GPU zone, use the various `TracyWebGPU*Zone*()` macros. Note that WebGPU only offers command instrumentation at the \"pass\"-level. While command-level granularity is possible through implementation-specific WebGPU extensions, Tracy does not support it at the moment. Supply the corresponding WebGPU pass descriptor to the instrumentation macro *before* creating the WebGPU pass encoder.
|
|
||||||
|
|
||||||
You are required to periodically collect the GPU events using the `TracyWebGPUCollect()` macro. Good places for collection are: after synchronous waits, after event processing `wgpuInstanceProcessEvents`, after present drawable calls (`wgpuSurfacePresent`), and inside the completion callback of command queues (`wgpuQueueOnSubmittedWorkDone`).
|
|
||||||
|
|
||||||
### ROCm
|
### ROCm
|
||||||
|
|
||||||
On Linux, if rocprofiler-sdk is installed, tracy can automatically trace GPU dispatches and collect performance counter values. If CMake can't find rocprofiler-sdk, you can set the CMake variable `rocprofiler-sdk_DIR` to point it at the correct module directory. Use the `TRACY_ROCPROF_COUNTERS` environment variable with the desired counters separated by commas to control what values are collected. The results will appear for each dispatch in the tool tip and zone detail window. Results are summed across dimensions. You can get a list of the counters available for your hardware with this command:
|
On Linux, if rocprofiler-sdk is installed, tracy can automatically trace GPU dispatches and collect performance counter values. If CMake can't find rocprofiler-sdk, you can set the CMake variable `rocprofiler-sdk_DIR` to point it at the correct module directory. Use the `TRACY_ROCPROF_COUNTERS` environment variable with the desired counters separated by commas to control what values are collected. The results will appear for each dispatch in the tool tip and zone detail window. Results are summed across dimensions. You can get a list of the counters available for your hardware with this command:
|
||||||
@@ -1625,13 +1613,13 @@ rocprofv3 -L
|
|||||||
|
|
||||||
Putting more than one GPU zone macro in a single scope features the same issue as with the `ZoneScoped` macros, described in section [3.4.2](#multizone) (but this time the variable name is `___tracy_gpu_zone`).
|
Putting more than one GPU zone macro in a single scope features the same issue as with the `ZoneScoped` macros, described in section [3.4.2](#multizone) (but this time the variable name is `___tracy_gpu_zone`).
|
||||||
|
|
||||||
To solve this problem, in case of OpenGL use the `TracyGpuNamedZone` macro in place of `TracyGpuZone` (or the color variant). The same applies to Vulkan, Direct3D 11/12, Metal and WebGPU -- replace `TracyVkZone` with `TracyVkNamedZone`, `TracyD3D11Zone`/`TracyD3D12Zone` with `TracyD3D11NamedZone`/`TracyD3D12NamedZone`, `TracyMetalZone` with `TracyMetalNamedZone`, and `TracyWebGPUZone` with `TracyWebGPUNamedZone`.
|
To solve this problem, in case of OpenGL use the `TracyGpuNamedZone` macro in place of `TracyGpuZone` (or the color variant). The same applies to Vulkan, Direct3D 11/12 and Metal -- replace `TracyVkZone` with `TracyVkNamedZone`, `TracyD3D11Zone`/`TracyD3D12Zone` with `TracyD3D11NamedZone`/`TracyD3D12NamedZone`, and `TracyMetalZone` with `TracyMetalNamedZone`.
|
||||||
|
|
||||||
Remember to provide your name for the created stack variable as the first parameter to the macros.
|
Remember to provide your name for the created stack variable as the first parameter to the macros.
|
||||||
|
|
||||||
### Transient GPU zones
|
### Transient GPU zones
|
||||||
|
|
||||||
Transient zones (see section [3.4.4](#transientzones) for details) are available in OpenGL, Vulkan, Direct3D 11/12 and WebGPU macros. Transient zones are not available for Metal at this moment.
|
Transient zones (see section [3.4.4](#transientzones) for details) are available in OpenGL, Vulkan, and Direct3D 11/12 macros. Transient zones are not available for Metal at this moment.
|
||||||
|
|
||||||
## Fibers
|
## Fibers
|
||||||
|
|
||||||
@@ -1676,7 +1664,7 @@ As you can see, there are two threads, `t1` and `t2`, which are simulating worke
|
|||||||
|
|
||||||
## Collecting call stacks {#collectingcallstacks}
|
## Collecting call stacks {#collectingcallstacks}
|
||||||
|
|
||||||
Capture of true calls stacks can be performed by using macros with the `S` postfix, which require an additional parameter, specifying the depth of call stack to be captured. The greater the depth, the longer it will take to perform capture. Currently you can use the following macros: `ZoneScopedS`, `ZoneScopedNS`, `ZoneScopedCS`, `ZoneScopedNCS`, `TracyAllocS`, `TracyFreeS`, `TracyMessageS`, `TracyMessageLS`, `TracyMessageCS`, `TracyMessageLCS`, `TracyGpuZoneS`, `TracyGpuZoneCS`, `TracyVkZoneS`, `TracyVkZoneCS`, and the named and transient variants.
|
Capture of true calls stacks can be performed by using macros with the `S` postfix, which require an additional parameter, specifying the depth of call stack to be captured. The greater the depth, the longer it will take to perform capture. Currently you can use the following macros: `ZoneScopedS`, `ZoneScopedNS`, `ZoneScopedCS`, `ZoneScopedNCS`, `TracyAllocS`, `TracyFreeS`, `TracySecureAllocS`, `TracySecureFreeS`, `TracyMessageS`, `TracyMessageLS`, `TracyMessageCS`, `TracyMessageLCS`, `TracyGpuZoneS`, `TracyGpuZoneCS`, `TracyVkZoneS`, `TracyVkZoneCS`, and the named and transient variants.
|
||||||
|
|
||||||
Be aware that call stack collection is a relatively slow operation. Table [6](#CallstackTimes) and figure [6](#CallstackPlot) show how long it took to perform a single capture of varying depth on multiple CPU architectures.
|
Be aware that call stack collection is a relatively slow operation. Table [6](#CallstackTimes) and figure [6](#CallstackPlot) show how long it took to perform a single capture of varying depth on multiple CPU architectures.
|
||||||
|
|
||||||
@@ -2051,6 +2039,10 @@ Use the following macros in your implementations of `malloc` and `free`:
|
|||||||
|
|
||||||
- `TracyCFree(ptr)`
|
- `TracyCFree(ptr)`
|
||||||
|
|
||||||
|
- `TracyCSecureAlloc(ptr, size)`
|
||||||
|
|
||||||
|
- `TracyCSecureFree(ptr)`
|
||||||
|
|
||||||
Correctly using this functionality can be pretty tricky. You also will need to handle all the memory allocations made by external libraries (which typically allow usage of custom memory allocation functions) and the allocations made by system functions. If you can't track such an allocation, you will need to make sure freeing is not reported[^56].
|
Correctly using this functionality can be pretty tricky. You also will need to handle all the memory allocations made by external libraries (which typically allow usage of custom memory allocation functions) and the allocations made by system functions. If you can't track such an allocation, you will need to make sure freeing is not reported[^56].
|
||||||
|
|
||||||
[^56]: It's not uncommon to see a pattern where a system function returns some allocated memory, which you then need to release.
|
[^56]: It's not uncommon to see a pattern where a system function returns some allocated memory, which you then need to release.
|
||||||
@@ -2554,9 +2546,9 @@ To collect frame images, use `tracy_image(image, w, h, offset, flip)` call.
|
|||||||
|
|
||||||
Use the following calls in your implementations of allocator/deallocator:
|
Use the following calls in your implementations of allocator/deallocator:
|
||||||
|
|
||||||
- `tracy_memory_alloc(ptr, size, name, depth)`
|
- `tracy_memory_alloc(ptr, size, name, depth, secure)`
|
||||||
|
|
||||||
- `tracy_memory_free(ptr, name, depth)`
|
- `tracy_memory_free(ptr, name, depth, secure)`
|
||||||
|
|
||||||
Correctly using this functionality can be pretty tricky especially in Fortran. In Fortran, you can not redefine `allocate` statement (as well as `deallocate` statement) to profile memory usage by `allocatable` variables. However, many applications[^58] uses stack allocator on memory tape where these calls can be useful.
|
Correctly using this functionality can be pretty tricky especially in Fortran. In Fortran, you can not redefine `allocate` statement (as well as `deallocate` statement) to profile memory usage by `allocatable` variables. However, many applications[^58] uses stack allocator on memory tape where these calls can be useful.
|
||||||
|
|
||||||
@@ -3411,7 +3403,7 @@ You will find the zones with locks and their associated threads on this combined
|
|||||||
|
|
||||||
The left-hand side *index area* of the timeline view displays various labels (threads, locks), which can be categorized in the following way:
|
The left-hand side *index area* of the timeline view displays various labels (threads, locks), which can be categorized in the following way:
|
||||||
|
|
||||||
- *Light blue label* -- GPU context. Multi-threaded Vulkan, OpenCL, Direct3D 12, Metal and WebGPU contexts are additionally split into separate threads.
|
- *Light blue label* -- GPU context. Multi-threaded Vulkan, OpenCL, Direct3D 12 and Metal contexts are additionally split into separate threads.
|
||||||
|
|
||||||
- *Pink label* -- CPU data graph.
|
- *Pink label* -- CPU data graph.
|
||||||
|
|
||||||
@@ -3445,7 +3437,7 @@ In an example in figure [18](#zoneslocks) you can see that there are two thread
|
|||||||
|
|
||||||
Meanwhile, the *Streaming thread* is performing some *Streaming jobs*. The first *Streaming job* sent a message (section [3.7](#messagelog)). In addition to being listed in the message log, it is indicated by a triangle over the thread separator. When multiple messages are in one place, the triangle outline shape changes to a filled triangle.
|
Meanwhile, the *Streaming thread* is performing some *Streaming jobs*. The first *Streaming job* sent a message (section [3.7](#messagelog)). In addition to being listed in the message log, it is indicated by a triangle over the thread separator. When multiple messages are in one place, the triangle outline shape changes to a filled triangle.
|
||||||
|
|
||||||
The GPU zones are displayed just like CPU zones, with an OpenGL/Vulkan/Direct3D/Metal/OpenCL/CUDA/WebGPU context in place of a thread name.
|
The GPU zones are displayed just like CPU zones, with an OpenGL/Vulkan/Direct3D/Metal/OpenCL context in place of a thread name.
|
||||||
|
|
||||||
Hovering the mouse pointer over a zone will highlight all other zones that have the exact source location with a white outline. Clicking the left mouse button on a zone will open the zone information window (section [5.14](#zoneinfo)). Holding the Ctrl key and clicking the left mouse button on a zone will open the zone statistics window (section [5.7](#findzone)). Clicking the middle mouse button on a zone will zoom the view to the extent of the zone.
|
Hovering the mouse pointer over a zone will highlight all other zones that have the exact source location with a white outline. Clicking the left mouse button on a zone will open the zone information window (section [5.14](#zoneinfo)). Holding the Ctrl key and clicking the left mouse button on a zone will open the zone statistics window (section [5.7](#findzone)). Clicking the middle mouse button on a zone will zoom the view to the extent of the zone.
|
||||||
|
|
||||||
@@ -3667,7 +3659,7 @@ In this window, you can set various trace-related options. For example, the time
|
|||||||
|
|
||||||
- * Draw CPU usage graph* -- You can disable drawing of the CPU usage graph here.
|
- * Draw CPU usage graph* -- You can disable drawing of the CPU usage graph here.
|
||||||
|
|
||||||
- * Draw GPU zones* -- Allows disabling display of OpenGL/Vulkan/Metal/Direct3D/OpenCL/CUDA/WebGPU zones. The *GPU zones* drop-down allows disabling individual GPU contexts and setting CPU/GPU drift offsets of uncalibrated contexts (see section [3.9](#gpuprofiling) for more information). The * Auto* button automatically measures the GPU drift value[^78].
|
- * Draw GPU zones* -- Allows disabling display of OpenGL/Vulkan/Metal/Direct3D/OpenCL zones. The *GPU zones* drop-down allows disabling individual GPU contexts and setting CPU/GPU drift offsets of uncalibrated contexts (see section [3.9](#gpuprofiling) for more information). The * Auto* button automatically measures the GPU drift value[^78].
|
||||||
|
|
||||||
- * Draw CPU zones* -- Determines whether CPU zones are displayed.
|
- * Draw CPU zones* -- Determines whether CPU zones are displayed.
|
||||||
|
|
||||||
|
|||||||
@@ -1609,6 +1609,8 @@ void operator delete(void* ptr) noexcept
|
|||||||
}
|
}
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
|
In some rare cases (e.g., destruction of TLS block), events may be reported after the profiler is no longer available, which would lead to a crash. To work around this issue, you may use \texttt{TracySecureAlloc} and \texttt{TracySecureFree} variants of the macros.
|
||||||
|
|
||||||
\begin{bclogo}[
|
\begin{bclogo}[
|
||||||
noborder=true,
|
noborder=true,
|
||||||
couleur=black!5,
|
couleur=black!5,
|
||||||
@@ -1642,8 +1644,6 @@ Sometimes an application will use more than one memory pool. For example, in add
|
|||||||
|
|
||||||
To mark that a separate memory pool is to be tracked you should use the named version of memory macros, for example \texttt{TracyAllocN(ptr, size, name)} and \texttt{TracyFreeN(ptr, name)}, where \texttt{name} is an unique pointer to a string literal (section~\ref{uniquepointers}) identifying the memory pool.
|
To mark that a separate memory pool is to be tracked you should use the named version of memory macros, for example \texttt{TracyAllocN(ptr, size, name)} and \texttt{TracyFreeN(ptr, name)}, where \texttt{name} is an unique pointer to a string literal (section~\ref{uniquepointers}) identifying the memory pool.
|
||||||
|
|
||||||
Certain memory allocator designs ("arena allocators") use an always-incrementing pointer to track the next region to allocate and do not support deallocation of individual objects. The only way to free memory with such an allocator is to simultaneously release all the objects that were allocated (reset the allocator state). You can mark such a mass-deallocation event in a memory pool with the \texttt{TracyMemoryDiscard(name)} macro.
|
|
||||||
|
|
||||||
\subsection{GPU profiling}
|
\subsection{GPU profiling}
|
||||||
\label{gpuprofiling}
|
\label{gpuprofiling}
|
||||||
|
|
||||||
@@ -1889,7 +1889,7 @@ As you can see, there are two threads, \texttt{t1} and \texttt{t2}, which are si
|
|||||||
\subsection{Collecting call stacks}
|
\subsection{Collecting call stacks}
|
||||||
\label{collectingcallstacks}
|
\label{collectingcallstacks}
|
||||||
|
|
||||||
Capture of true calls stacks can be performed by using macros with the \texttt{S} postfix, which require an additional parameter, specifying the depth of call stack to be captured. The greater the depth, the longer it will take to perform capture. Currently you can use the following macros: \texttt{ZoneScopedS}, \texttt{ZoneScopedNS}, \texttt{ZoneScopedCS}, \texttt{ZoneScopedNCS}, \texttt{TracyAllocS}, \texttt{TracyFreeS}, \texttt{TracyMessageS}, \texttt{TracyMessageLS}, \texttt{TracyMessageCS}, \texttt{TracyMessageLCS}, \texttt{TracyGpuZoneS}, \texttt{TracyGpuZoneCS}, \texttt{TracyVkZoneS}, \texttt{TracyVkZoneCS}, and the named and transient variants.
|
Capture of true calls stacks can be performed by using macros with the \texttt{S} postfix, which require an additional parameter, specifying the depth of call stack to be captured. The greater the depth, the longer it will take to perform capture. Currently you can use the following macros: \texttt{ZoneScopedS}, \texttt{ZoneScopedNS}, \texttt{ZoneScopedCS}, \texttt{ZoneScopedNCS}, \texttt{TracyAllocS}, \texttt{TracyFreeS}, \texttt{TracySecureAllocS}, \texttt{TracySecureFreeS}, \texttt{TracyMessageS}, \texttt{TracyMessageLS}, \texttt{TracyMessageCS}, \texttt{TracyMessageLCS}, \texttt{TracyGpuZoneS}, \texttt{TracyGpuZoneCS}, \texttt{TracyVkZoneS}, \texttt{TracyVkZoneCS}, and the named and transient variants.
|
||||||
|
|
||||||
Be aware that call stack collection is a relatively slow operation. Table~\ref{CallstackTimes} and figure~\ref{CallstackPlot} show how long it took to perform a single capture of varying depth on multiple CPU architectures.
|
Be aware that call stack collection is a relatively slow operation. Table~\ref{CallstackTimes} and figure~\ref{CallstackPlot} show how long it took to perform a single capture of varying depth on multiple CPU architectures.
|
||||||
|
|
||||||
@@ -2318,6 +2318,8 @@ Use the following macros in your implementations of \texttt{malloc} and \texttt{
|
|||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item \texttt{TracyCAlloc(ptr, size)}
|
\item \texttt{TracyCAlloc(ptr, size)}
|
||||||
\item \texttt{TracyCFree(ptr)}
|
\item \texttt{TracyCFree(ptr)}
|
||||||
|
\item \texttt{TracyCSecureAlloc(ptr, size)}
|
||||||
|
\item \texttt{TracyCSecureFree(ptr)}
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
Correctly using this functionality can be pretty tricky. You also will need to handle all the memory allocations made by external libraries (which typically allow usage of custom memory allocation functions) and the allocations made by system functions. If you can't track such an allocation, you will need to make sure freeing is not reported\footnote{It's not uncommon to see a pattern where a system function returns some allocated memory, which you then need to release.}.
|
Correctly using this functionality can be pretty tricky. You also will need to handle all the memory allocations made by external libraries (which typically allow usage of custom memory allocation functions) and the allocations made by system functions. If you can't track such an allocation, you will need to make sure freeing is not reported\footnote{It's not uncommon to see a pattern where a system function returns some allocated memory, which you then need to release.}.
|
||||||
@@ -2877,8 +2879,8 @@ logo=\bclampe
|
|||||||
Use the following calls in your implementations of allocator/deallocator:
|
Use the following calls in your implementations of allocator/deallocator:
|
||||||
|
|
||||||
\begin{itemize}
|
\begin{itemize}
|
||||||
\item \texttt{tracy\_memory\_alloc(ptr, size, name, depth)}
|
\item \texttt{tracy\_memory\_alloc(ptr, size, name, depth, secure)}
|
||||||
\item \texttt{tracy\_memory\_free(ptr, name, depth)}
|
\item \texttt{tracy\_memory\_free(ptr, name, depth, secure)}
|
||||||
\end{itemize}
|
\end{itemize}
|
||||||
|
|
||||||
Correctly using this functionality can be pretty tricky especially in Fortran.
|
Correctly using this functionality can be pretty tricky especially in Fortran.
|
||||||
|
|||||||
@@ -44,16 +44,10 @@ ExternalProject_Add(embed
|
|||||||
)
|
)
|
||||||
|
|
||||||
function(Embed LIST NAME FILE)
|
function(Embed LIST NAME FILE)
|
||||||
cmake_parse_arguments(EMBED "TEXT" "" "" ${ARGN})
|
|
||||||
if(EMBED_TEXT)
|
|
||||||
set(EMBED_FLAGS -t)
|
|
||||||
else()
|
|
||||||
set(EMBED_FLAGS)
|
|
||||||
endif()
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT data/${NAME}.cpp data/${NAME}.hpp
|
OUTPUT data/${NAME}.cpp data/${NAME}.hpp
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory data
|
COMMAND ${CMAKE_COMMAND} -E make_directory data
|
||||||
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/embed ${EMBED_FLAGS} ${NAME} ${CMAKE_CURRENT_LIST_DIR}/${FILE} data/${NAME}
|
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/embed ${NAME} ${CMAKE_CURRENT_LIST_DIR}/${FILE} data/${NAME}
|
||||||
DEPENDS embed ${CMAKE_CURRENT_LIST_DIR}/${FILE}
|
DEPENDS embed ${CMAKE_CURRENT_LIST_DIR}/${FILE}
|
||||||
)
|
)
|
||||||
list(APPEND ${LIST} data/${NAME}.cpp)
|
list(APPEND ${LIST} data/${NAME}.cpp)
|
||||||
@@ -152,10 +146,10 @@ set(PROFILER_FILES
|
|||||||
src/winmainArchDiscovery.cpp
|
src/winmainArchDiscovery.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
Embed(PROFILER_FILES SystemPrompt src/llm/system.prompt.md TEXT)
|
Embed(PROFILER_FILES SystemPrompt src/llm/system.prompt.md)
|
||||||
Embed(PROFILER_FILES SkillCallstack src/llm/skill.callstack.md TEXT)
|
Embed(PROFILER_FILES SkillCallstack src/llm/skill.callstack.md)
|
||||||
Embed(PROFILER_FILES SkillOptimization src/llm/skill.optimization.md TEXT)
|
Embed(PROFILER_FILES SkillOptimization src/llm/skill.optimization.md)
|
||||||
Embed(PROFILER_FILES ToolsJson src/llm/tools.json TEXT)
|
Embed(PROFILER_FILES ToolsJson src/llm/tools.json)
|
||||||
|
|
||||||
Embed(PROFILER_FILES FontFixed src/font/FiraCode-Retina.ttf)
|
Embed(PROFILER_FILES FontFixed src/font/FiraCode-Retina.ttf)
|
||||||
Embed(PROFILER_FILES FontIcons src/font/Font\ Awesome\ 7\ Free-Solid-900.otf)
|
Embed(PROFILER_FILES FontIcons src/font/Font\ Awesome\ 7\ Free-Solid-900.otf)
|
||||||
@@ -165,20 +159,20 @@ Embed(PROFILER_FILES FontItalic src/font/Roboto-Italic.ttf)
|
|||||||
Embed(PROFILER_FILES FontBoldItalic src/font/Roboto-BoldItalic.ttf)
|
Embed(PROFILER_FILES FontBoldItalic src/font/Roboto-BoldItalic.ttf)
|
||||||
Embed(PROFILER_FILES FontEmoji src/font/NotoEmoji-Regular.ttf)
|
Embed(PROFILER_FILES FontEmoji src/font/NotoEmoji-Regular.ttf)
|
||||||
|
|
||||||
Embed(PROFILER_FILES Manual ../manual/tracy.md TEXT)
|
Embed(PROFILER_FILES Manual ../manual/tracy.md)
|
||||||
|
|
||||||
Embed(PROFILER_FILES Text100Million src/achievements/100Million.md TEXT)
|
Embed(PROFILER_FILES Text100Million src/achievements/100Million.md)
|
||||||
Embed(PROFILER_FILES TextConnectToClient src/achievements/ConnectToClient.md TEXT)
|
Embed(PROFILER_FILES TextConnectToClient src/achievements/ConnectToClient.md)
|
||||||
Embed(PROFILER_FILES TextFindZone src/achievements/FindZone.md TEXT)
|
Embed(PROFILER_FILES TextFindZone src/achievements/FindZone.md)
|
||||||
Embed(PROFILER_FILES TextFrameImages src/achievements/FrameImages.md TEXT)
|
Embed(PROFILER_FILES TextFrameImages src/achievements/FrameImages.md)
|
||||||
Embed(PROFILER_FILES TextGlobalSettings src/achievements/GlobalSettings.md TEXT)
|
Embed(PROFILER_FILES TextGlobalSettings src/achievements/GlobalSettings.md)
|
||||||
Embed(PROFILER_FILES TextInstrumentationIntro src/achievements/InstrumentationIntro.md TEXT)
|
Embed(PROFILER_FILES TextInstrumentationIntro src/achievements/InstrumentationIntro.md)
|
||||||
Embed(PROFILER_FILES TextInstrumentationStatistics src/achievements/InstrumentationStatistics.md TEXT)
|
Embed(PROFILER_FILES TextInstrumentationStatistics src/achievements/InstrumentationStatistics.md)
|
||||||
Embed(PROFILER_FILES TextInstrumentFrames src/achievements/InstrumentFrames.md TEXT)
|
Embed(PROFILER_FILES TextInstrumentFrames src/achievements/InstrumentFrames.md)
|
||||||
Embed(PROFILER_FILES TextIntro src/achievements/Intro.md TEXT)
|
Embed(PROFILER_FILES TextIntro src/achievements/Intro.md)
|
||||||
Embed(PROFILER_FILES TextLoadTrace src/achievements/LoadTrace.md TEXT)
|
Embed(PROFILER_FILES TextLoadTrace src/achievements/LoadTrace.md)
|
||||||
Embed(PROFILER_FILES TextSamplingIntro src/achievements/SamplingIntro.md TEXT)
|
Embed(PROFILER_FILES TextSamplingIntro src/achievements/SamplingIntro.md)
|
||||||
Embed(PROFILER_FILES TextSaveTrace src/achievements/SaveTrace.md TEXT)
|
Embed(PROFILER_FILES TextSaveTrace src/achievements/SaveTrace.md)
|
||||||
|
|
||||||
set(INCLUDES "${CMAKE_CURRENT_BINARY_DIR}")
|
set(INCLUDES "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
set(LIBS "")
|
set(LIBS "")
|
||||||
|
|||||||
@@ -1,27 +1,17 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "../../public/common/tracy_lz4hc.hpp"
|
#include "../../public/common/tracy_lz4hc.hpp"
|
||||||
|
|
||||||
static void Usage()
|
static void Usage()
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Usage: embed [-t] <objectName> <source> <destination>\n" );
|
fprintf( stderr, "Usage: embed <objectName> <source> <destination>\n" );
|
||||||
fprintf( stderr, " destination should be without extension, will create cpp, hpp pair\n" );
|
fprintf( stderr, " destination should be without extension, will create cpp, hpp pair\n" );
|
||||||
fprintf( stderr, " -t: treat source as text, convert line endings to unix\n" );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int main( int argc, char** argv )
|
int main( int argc, char** argv )
|
||||||
{
|
{
|
||||||
bool text = false;
|
|
||||||
if( argc >= 2 && strcmp( argv[1], "-t" ) == 0 )
|
|
||||||
{
|
|
||||||
text = true;
|
|
||||||
argc--;
|
|
||||||
argv++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( argc < 4 )
|
if( argc < 4 )
|
||||||
{
|
{
|
||||||
Usage();
|
Usage();
|
||||||
@@ -48,16 +38,6 @@ int main( int argc, char** argv )
|
|||||||
fread( data, 1, sz, src );
|
fread( data, 1, sz, src );
|
||||||
fclose( src );
|
fclose( src );
|
||||||
|
|
||||||
if( text )
|
|
||||||
{
|
|
||||||
size_t pos = 0;
|
|
||||||
for( size_t i=0; i<sz; i++ )
|
|
||||||
{
|
|
||||||
if( data[i] != '\r' ) data[pos++] = data[i];
|
|
||||||
}
|
|
||||||
sz = pos;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto lz4szMax = tracy::LZ4_compressBound( sz );
|
const auto lz4szMax = tracy::LZ4_compressBound( sz );
|
||||||
auto lz4data = new uint8_t[lz4szMax];
|
auto lz4data = new uint8_t[lz4szMax];
|
||||||
const auto lz4sz = tracy::LZ4_compress_HC( (const char*)data, (char*)lz4data, sz, lz4szMax, 6 );
|
const auto lz4sz = tracy::LZ4_compress_HC( (const char*)data, (char*)lz4data, sz, lz4szMax, 6 );
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ struct Config
|
|||||||
std::string llmSearchIdentifier;
|
std::string llmSearchIdentifier;
|
||||||
std::string llmSearchApiKey;
|
std::string llmSearchApiKey;
|
||||||
std::string llmSearchBraveApiKey;
|
std::string llmSearchBraveApiKey;
|
||||||
bool llmSeparateFastModel = false;
|
bool llmSeparateFastModel = true;
|
||||||
bool llmAnnotateCallstacks = false;
|
bool llmAnnotateCallstacks = false;
|
||||||
bool llmLimitToolReplySize = false;
|
bool llmLimitToolReplySize = false;
|
||||||
int llmMaxToolReplySizeValue = 48*1024;
|
int llmMaxToolReplySizeValue = 48*1024;
|
||||||
|
|||||||
@@ -861,38 +861,43 @@ module tracy
|
|||||||
end interface
|
end interface
|
||||||
|
|
||||||
interface
|
interface
|
||||||
subroutine impl_tracy_emit_memory_alloc_callstack(ptr, size, depth) &
|
subroutine impl_tracy_emit_memory_alloc_callstack(ptr, size, depth, secure) &
|
||||||
bind(C, name="___tracy_emit_memory_alloc_callstack")
|
bind(C, name="___tracy_emit_memory_alloc_callstack")
|
||||||
import
|
import
|
||||||
type(c_ptr), intent(in), value :: ptr
|
type(c_ptr), intent(in), value :: ptr
|
||||||
integer(c_size_t), intent(in), value :: size
|
integer(c_size_t), intent(in), value :: size
|
||||||
integer(c_int32_t), intent(in), value :: depth
|
integer(c_int32_t), intent(in), value :: depth
|
||||||
|
integer(c_int32_t), intent(in), value :: secure
|
||||||
end subroutine impl_tracy_emit_memory_alloc_callstack
|
end subroutine impl_tracy_emit_memory_alloc_callstack
|
||||||
subroutine impl_tracy_emit_memory_alloc_callstack_named(ptr, size, depth, name) &
|
subroutine impl_tracy_emit_memory_alloc_callstack_named(ptr, size, depth, secure, name) &
|
||||||
bind(C, name="___tracy_emit_memory_alloc_callstack_named")
|
bind(C, name="___tracy_emit_memory_alloc_callstack_named")
|
||||||
import
|
import
|
||||||
type(c_ptr), intent(in), value :: ptr
|
type(c_ptr), intent(in), value :: ptr
|
||||||
integer(c_size_t), intent(in), value :: size
|
integer(c_size_t), intent(in), value :: size
|
||||||
integer(c_int32_t), intent(in), value :: depth
|
integer(c_int32_t), intent(in), value :: depth
|
||||||
|
integer(c_int32_t), intent(in), value :: secure
|
||||||
type(c_ptr), intent(in), value :: name
|
type(c_ptr), intent(in), value :: name
|
||||||
end subroutine impl_tracy_emit_memory_alloc_callstack_named
|
end subroutine impl_tracy_emit_memory_alloc_callstack_named
|
||||||
subroutine impl_tracy_emit_memory_free_callstack(ptr, depth) &
|
subroutine impl_tracy_emit_memory_free_callstack(ptr, depth, secure) &
|
||||||
bind(C, name="___tracy_emit_memory_free_callstack")
|
bind(C, name="___tracy_emit_memory_free_callstack")
|
||||||
import
|
import
|
||||||
type(c_ptr), intent(in), value :: ptr
|
type(c_ptr), intent(in), value :: ptr
|
||||||
integer(c_int32_t), intent(in), value :: depth
|
integer(c_int32_t), intent(in), value :: depth
|
||||||
|
integer(c_int32_t), intent(in), value :: secure
|
||||||
end subroutine impl_tracy_emit_memory_free_callstack
|
end subroutine impl_tracy_emit_memory_free_callstack
|
||||||
subroutine impl_tracy_emit_memory_free_callstack_named(ptr, depth, name) &
|
subroutine impl_tracy_emit_memory_free_callstack_named(ptr, depth, secure, name) &
|
||||||
bind(C, name="___tracy_emit_memory_free_callstack_named")
|
bind(C, name="___tracy_emit_memory_free_callstack_named")
|
||||||
import
|
import
|
||||||
type(c_ptr), intent(in), value :: ptr
|
type(c_ptr), intent(in), value :: ptr
|
||||||
integer(c_int32_t), intent(in), value :: depth
|
integer(c_int32_t), intent(in), value :: depth
|
||||||
|
integer(c_int32_t), intent(in), value :: secure
|
||||||
type(c_ptr), intent(in), value :: name
|
type(c_ptr), intent(in), value :: name
|
||||||
end subroutine impl_tracy_emit_memory_free_callstack_named
|
end subroutine impl_tracy_emit_memory_free_callstack_named
|
||||||
subroutine impl_tracy_emit_memory_discard_callstack(name, depth) &
|
subroutine impl_tracy_emit_memory_discard_callstack(name, secure, depth) &
|
||||||
bind(C, name="___tracy_emit_memory_discard_callstack")
|
bind(C, name="___tracy_emit_memory_discard_callstack")
|
||||||
import
|
import
|
||||||
type(c_ptr), intent(in), value :: name
|
type(c_ptr), intent(in), value :: name
|
||||||
|
integer(c_int32_t), intent(in), value :: secure
|
||||||
integer(c_int32_t), intent(in), value :: depth
|
integer(c_int32_t), intent(in), value :: depth
|
||||||
end subroutine impl_tracy_emit_memory_discard_callstack
|
end subroutine impl_tracy_emit_memory_discard_callstack
|
||||||
end interface
|
end interface
|
||||||
@@ -1123,43 +1128,58 @@ contains
|
|||||||
tracy_connected = impl_tracy_connected() /= 0_c_int32_t
|
tracy_connected = impl_tracy_connected() /= 0_c_int32_t
|
||||||
end function tracy_connected
|
end function tracy_connected
|
||||||
|
|
||||||
subroutine tracy_memory_alloc(ptr, size, name, depth)
|
subroutine tracy_memory_alloc(ptr, size, name, depth, secure)
|
||||||
type(c_ptr), intent(in) :: ptr
|
type(c_ptr), intent(in) :: ptr
|
||||||
integer(c_size_t), intent(in) :: size
|
integer(c_size_t), intent(in) :: size
|
||||||
character(kind=c_char, len=*), target, intent(in), optional :: name
|
character(kind=c_char, len=*), target, intent(in), optional :: name
|
||||||
integer(c_int32_t), intent(in), optional :: depth
|
integer(c_int32_t), intent(in), optional :: depth
|
||||||
|
logical(1), intent(in), optional :: secure
|
||||||
!
|
!
|
||||||
integer(c_int32_t) :: depth_
|
integer(c_int32_t) :: depth_, secure_
|
||||||
|
secure_ = 0_c_int32_t
|
||||||
depth_ = 0_c_int32_t
|
depth_ = 0_c_int32_t
|
||||||
|
if (present(secure)) then
|
||||||
|
if (secure) secure_ = 1_c_int32_t
|
||||||
|
end if
|
||||||
if (present(depth)) depth_ = depth
|
if (present(depth)) depth_ = depth
|
||||||
if (present(name)) then
|
if (present(name)) then
|
||||||
call impl_tracy_emit_memory_alloc_callstack_named(ptr, size, depth_, c_loc(name))
|
call impl_tracy_emit_memory_alloc_callstack_named(ptr, size, depth_, secure_, c_loc(name))
|
||||||
else
|
else
|
||||||
call impl_tracy_emit_memory_alloc_callstack(ptr, size, depth_)
|
call impl_tracy_emit_memory_alloc_callstack(ptr, size, depth_, secure_)
|
||||||
end if
|
end if
|
||||||
end subroutine tracy_memory_alloc
|
end subroutine tracy_memory_alloc
|
||||||
subroutine tracy_memory_free(ptr, name, depth)
|
subroutine tracy_memory_free(ptr, name, depth, secure)
|
||||||
type(c_ptr), intent(in) :: ptr
|
type(c_ptr), intent(in) :: ptr
|
||||||
character(kind=c_char, len=*), target, intent(in), optional :: name
|
character(kind=c_char, len=*), target, intent(in), optional :: name
|
||||||
integer(c_int32_t), intent(in), optional :: depth
|
integer(c_int32_t), intent(in), optional :: depth
|
||||||
|
logical(1), intent(in), optional :: secure
|
||||||
!
|
!
|
||||||
integer(c_int32_t) :: depth_
|
integer(c_int32_t) :: depth_, secure_
|
||||||
|
secure_ = 0_c_int32_t
|
||||||
depth_ = 0_c_int32_t
|
depth_ = 0_c_int32_t
|
||||||
|
if (present(secure)) then
|
||||||
|
if (secure) secure_ = 1_c_int32_t
|
||||||
|
end if
|
||||||
if (present(depth)) depth_ = depth
|
if (present(depth)) depth_ = depth
|
||||||
if (present(name)) then
|
if (present(name)) then
|
||||||
call impl_tracy_emit_memory_free_callstack_named(ptr, depth_, c_loc(name))
|
call impl_tracy_emit_memory_free_callstack_named(ptr, depth_, secure_, c_loc(name))
|
||||||
else
|
else
|
||||||
call impl_tracy_emit_memory_free_callstack(ptr, depth_)
|
call impl_tracy_emit_memory_free_callstack(ptr, depth_, secure_)
|
||||||
end if
|
end if
|
||||||
end subroutine tracy_memory_free
|
end subroutine tracy_memory_free
|
||||||
subroutine tracy_memory_discard(name, depth)
|
subroutine tracy_memory_discard(name, depth, secure)
|
||||||
character(kind=c_char, len=*), target, intent(in) :: name
|
character(kind=c_char, len=*), target, intent(in) :: name
|
||||||
integer(c_int32_t), intent(in), optional :: depth
|
integer(c_int32_t), intent(in), optional :: depth
|
||||||
|
logical(1), intent(in), optional :: secure
|
||||||
!
|
!
|
||||||
integer(c_int32_t) :: depth_
|
integer(c_int32_t) :: depth_, secure_
|
||||||
|
secure_ = 0_c_int32_t
|
||||||
depth_ = 0_c_int32_t
|
depth_ = 0_c_int32_t
|
||||||
|
if (present(secure)) then
|
||||||
|
if (secure) secure_ = 1_c_int32_t
|
||||||
|
end if
|
||||||
if (present(depth)) depth_ = depth
|
if (present(depth)) depth_ = depth
|
||||||
call impl_tracy_emit_memory_discard_callstack(c_loc(name), depth_)
|
call impl_tracy_emit_memory_discard_callstack(c_loc(name), depth_, secure_)
|
||||||
end subroutine tracy_memory_discard
|
end subroutine tracy_memory_discard
|
||||||
|
|
||||||
subroutine tracy_message(msg, color, depth)
|
subroutine tracy_message(msg, color, depth)
|
||||||
|
|||||||
@@ -4709,64 +4709,64 @@ TRACY_API void ___tracy_emit_zone_value( TracyCZoneCtx ctx, uint64_t value )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACY_API void ___tracy_emit_memory_alloc( const void* ptr, size_t size ) { tracy::Profiler::MemAlloc( ptr, size ); }
|
TRACY_API void ___tracy_emit_memory_alloc( const void* ptr, size_t size, int32_t secure ) { tracy::Profiler::MemAlloc( ptr, size, secure != 0 ); }
|
||||||
TRACY_API void ___tracy_emit_memory_alloc_callstack( const void* ptr, size_t size, int32_t depth )
|
TRACY_API void ___tracy_emit_memory_alloc_callstack( const void* ptr, size_t size, int32_t depth, int32_t secure )
|
||||||
{
|
{
|
||||||
if( depth > 0 && tracy::has_callstack() )
|
if( depth > 0 && tracy::has_callstack() )
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemAllocCallstack( ptr, size, depth );
|
tracy::Profiler::MemAllocCallstack( ptr, size, depth, secure != 0 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemAlloc( ptr, size );
|
tracy::Profiler::MemAlloc( ptr, size, secure != 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACY_API void ___tracy_emit_memory_free( const void* ptr ) { tracy::Profiler::MemFree( ptr ); }
|
TRACY_API void ___tracy_emit_memory_free( const void* ptr, int32_t secure ) { tracy::Profiler::MemFree( ptr, secure != 0 ); }
|
||||||
TRACY_API void ___tracy_emit_memory_free_callstack( const void* ptr, int32_t depth )
|
TRACY_API void ___tracy_emit_memory_free_callstack( const void* ptr, int32_t depth, int32_t secure )
|
||||||
{
|
{
|
||||||
if( depth > 0 && tracy::has_callstack() )
|
if( depth > 0 && tracy::has_callstack() )
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemFreeCallstack( ptr, depth );
|
tracy::Profiler::MemFreeCallstack( ptr, depth, secure != 0 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemFree( ptr );
|
tracy::Profiler::MemFree( ptr, secure != 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACY_API void ___tracy_emit_memory_discard( const char* name ) { tracy::Profiler::MemDiscard( name ); }
|
TRACY_API void ___tracy_emit_memory_discard( const char* name, int32_t secure ) { tracy::Profiler::MemDiscard( name, secure != 0 ); }
|
||||||
TRACY_API void ___tracy_emit_memory_discard_callstack( const char* name, int32_t depth )
|
TRACY_API void ___tracy_emit_memory_discard_callstack( const char* name, int32_t secure, int32_t depth )
|
||||||
{
|
{
|
||||||
if( depth > 0 && tracy::has_callstack() )
|
if( depth > 0 && tracy::has_callstack() )
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemDiscardCallstack( name, depth );
|
tracy::Profiler::MemDiscardCallstack( name, secure != 0, depth );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemDiscard( name );
|
tracy::Profiler::MemDiscard( name, secure != 0 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACY_API void ___tracy_emit_memory_alloc_named( const void* ptr, size_t size, const char* name ) { tracy::Profiler::MemAllocNamed( ptr, size, name ); }
|
TRACY_API void ___tracy_emit_memory_alloc_named( const void* ptr, size_t size, int32_t secure, const char* name ) { tracy::Profiler::MemAllocNamed( ptr, size, secure != 0, name ); }
|
||||||
TRACY_API void ___tracy_emit_memory_alloc_callstack_named( const void* ptr, size_t size, int32_t depth, const char* name )
|
TRACY_API void ___tracy_emit_memory_alloc_callstack_named( const void* ptr, size_t size, int32_t depth, int32_t secure, const char* name )
|
||||||
{
|
{
|
||||||
if( depth > 0 && tracy::has_callstack() )
|
if( depth > 0 && tracy::has_callstack() )
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemAllocCallstackNamed( ptr, size, depth, name );
|
tracy::Profiler::MemAllocCallstackNamed( ptr, size, depth, secure != 0, name );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemAllocNamed( ptr, size, name );
|
tracy::Profiler::MemAllocNamed( ptr, size, secure != 0, name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACY_API void ___tracy_emit_memory_free_named( const void* ptr, const char* name ) { tracy::Profiler::MemFreeNamed( ptr, name ); }
|
TRACY_API void ___tracy_emit_memory_free_named( const void* ptr, int32_t secure, const char* name ) { tracy::Profiler::MemFreeNamed( ptr, secure != 0, name ); }
|
||||||
TRACY_API void ___tracy_emit_memory_free_callstack_named( const void* ptr, int32_t depth, const char* name )
|
TRACY_API void ___tracy_emit_memory_free_callstack_named( const void* ptr, int32_t depth, int32_t secure, const char* name )
|
||||||
{
|
{
|
||||||
if( depth > 0 && tracy::has_callstack() )
|
if( depth > 0 && tracy::has_callstack() )
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemFreeCallstackNamed( ptr, depth, name );
|
tracy::Profiler::MemFreeCallstackNamed( ptr, depth, secure != 0, name );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tracy::Profiler::MemFreeNamed( ptr, name );
|
tracy::Profiler::MemFreeNamed( ptr, secure != 0, name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TRACY_API void ___tracy_emit_frame_mark( const char* name ) { tracy::Profiler::SendFrameMark( name ); }
|
TRACY_API void ___tracy_emit_frame_mark( const char* name ) { tracy::Profiler::SendFrameMark( name ); }
|
||||||
|
|||||||
@@ -535,9 +535,9 @@ public:
|
|||||||
TracyLfqCommit;
|
TracyLfqCommit;
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemAlloc( const void* ptr, size_t size )
|
static tracy_force_inline void MemAlloc( const void* ptr, size_t size, bool secure )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
if( !GetProfiler().IsConnected() ) return;
|
if( !GetProfiler().IsConnected() ) return;
|
||||||
#endif
|
#endif
|
||||||
@@ -548,9 +548,9 @@ public:
|
|||||||
GetProfiler().m_serialLock.unlock();
|
GetProfiler().m_serialLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemFree( const void* ptr )
|
static tracy_force_inline void MemFree( const void* ptr, bool secure )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
if( !GetProfiler().IsConnected() ) return;
|
if( !GetProfiler().IsConnected() ) return;
|
||||||
#endif
|
#endif
|
||||||
@@ -561,9 +561,9 @@ public:
|
|||||||
GetProfiler().m_serialLock.unlock();
|
GetProfiler().m_serialLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemAllocCallstack( const void* ptr, size_t size, int32_t depth )
|
static tracy_force_inline void MemAllocCallstack( const void* ptr, size_t size, int32_t depth, bool secure )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
if( depth > 0 && has_callstack() )
|
if( depth > 0 && has_callstack() )
|
||||||
{
|
{
|
||||||
auto& profiler = GetProfiler();
|
auto& profiler = GetProfiler();
|
||||||
@@ -581,16 +581,16 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MemAlloc( ptr, size );
|
MemAlloc( ptr, size, secure );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemFreeCallstack( const void* ptr, int32_t depth )
|
static tracy_force_inline void MemFreeCallstack( const void* ptr, int32_t depth, bool secure )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
if( !ProfilerAllocatorAvailable() )
|
if( !ProfilerAllocatorAvailable() )
|
||||||
{
|
{
|
||||||
MemFree( ptr );
|
MemFree( ptr, secure );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( depth > 0 && has_callstack() )
|
if( depth > 0 && has_callstack() )
|
||||||
@@ -610,13 +610,13 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MemFree( ptr );
|
MemFree( ptr, secure );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemAllocNamed( const void* ptr, size_t size, const char* name )
|
static tracy_force_inline void MemAllocNamed( const void* ptr, size_t size, bool secure, const char* name )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
if( !GetProfiler().IsConnected() ) return;
|
if( !GetProfiler().IsConnected() ) return;
|
||||||
#endif
|
#endif
|
||||||
@@ -628,9 +628,9 @@ public:
|
|||||||
GetProfiler().m_serialLock.unlock();
|
GetProfiler().m_serialLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemFreeNamed( const void* ptr, const char* name )
|
static tracy_force_inline void MemFreeNamed( const void* ptr, bool secure, const char* name )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
if( !GetProfiler().IsConnected() ) return;
|
if( !GetProfiler().IsConnected() ) return;
|
||||||
#endif
|
#endif
|
||||||
@@ -642,9 +642,9 @@ public:
|
|||||||
GetProfiler().m_serialLock.unlock();
|
GetProfiler().m_serialLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemAllocCallstackNamed( const void* ptr, size_t size, int32_t depth, const char* name )
|
static tracy_force_inline void MemAllocCallstackNamed( const void* ptr, size_t size, int32_t depth, bool secure, const char* name )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
if( depth > 0 && has_callstack() )
|
if( depth > 0 && has_callstack() )
|
||||||
{
|
{
|
||||||
auto& profiler = GetProfiler();
|
auto& profiler = GetProfiler();
|
||||||
@@ -663,13 +663,13 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MemAllocNamed( ptr, size, name );
|
MemAllocNamed( ptr, size, secure, name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemFreeCallstackNamed( const void* ptr, int32_t depth, const char* name )
|
static tracy_force_inline void MemFreeCallstackNamed( const void* ptr, int32_t depth, bool secure, const char* name )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
if( depth > 0 && has_callstack() )
|
if( depth > 0 && has_callstack() )
|
||||||
{
|
{
|
||||||
auto& profiler = GetProfiler();
|
auto& profiler = GetProfiler();
|
||||||
@@ -688,13 +688,13 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MemFreeNamed( ptr, name );
|
MemFreeNamed( ptr, secure, name );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemDiscard( const char* name )
|
static tracy_force_inline void MemDiscard( const char* name, bool secure )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
#ifdef TRACY_ON_DEMAND
|
#ifdef TRACY_ON_DEMAND
|
||||||
if( !GetProfiler().IsConnected() ) return;
|
if( !GetProfiler().IsConnected() ) return;
|
||||||
#endif
|
#endif
|
||||||
@@ -705,9 +705,9 @@ public:
|
|||||||
GetProfiler().m_serialLock.unlock();
|
GetProfiler().m_serialLock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
static tracy_force_inline void MemDiscardCallstack( const char* name, int32_t depth )
|
static tracy_force_inline void MemDiscardCallstack( const char* name, bool secure, int32_t depth )
|
||||||
{
|
{
|
||||||
if( !ProfilerAvailable() ) return;
|
if( secure && !ProfilerAvailable() ) return;
|
||||||
if( depth > 0 && has_callstack() )
|
if( depth > 0 && has_callstack() )
|
||||||
{
|
{
|
||||||
# ifdef TRACY_ON_DEMAND
|
# ifdef TRACY_ON_DEMAND
|
||||||
@@ -719,12 +719,12 @@ public:
|
|||||||
|
|
||||||
GetProfiler().m_serialLock.lock();
|
GetProfiler().m_serialLock.lock();
|
||||||
SendCallstackSerial( callstack );
|
SendCallstackSerial( callstack );
|
||||||
SendMemDiscard( QueueType::MemDiscardCallstack, thread, name );
|
SendMemDiscard( QueueType::MemDiscard, thread, name );
|
||||||
GetProfiler().m_serialLock.unlock();
|
GetProfiler().m_serialLock.unlock();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MemDiscard( name );
|
MemDiscard( name, secure );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,9 +76,14 @@
|
|||||||
#define TracyAlloc(x,y)
|
#define TracyAlloc(x,y)
|
||||||
#define TracyFree(x)
|
#define TracyFree(x)
|
||||||
#define TracyMemoryDiscard(x)
|
#define TracyMemoryDiscard(x)
|
||||||
|
#define TracySecureAlloc(x,y)
|
||||||
|
#define TracySecureFree(x)
|
||||||
|
#define TracySecureMemoryDiscard(x)
|
||||||
|
|
||||||
#define TracyAllocN(x,y,z)
|
#define TracyAllocN(x,y,z)
|
||||||
#define TracyFreeN(x,y)
|
#define TracyFreeN(x,y)
|
||||||
|
#define TracySecureAllocN(x,y,z)
|
||||||
|
#define TracySecureFreeN(x,y)
|
||||||
|
|
||||||
#define ZoneNamedS(x,y,z)
|
#define ZoneNamedS(x,y,z)
|
||||||
#define ZoneNamedNS(x,y,z,w)
|
#define ZoneNamedNS(x,y,z,w)
|
||||||
@@ -96,9 +101,14 @@
|
|||||||
#define TracyAllocS(x,y,z)
|
#define TracyAllocS(x,y,z)
|
||||||
#define TracyFreeS(x,y)
|
#define TracyFreeS(x,y)
|
||||||
#define TracyMemoryDiscardS(x,y)
|
#define TracyMemoryDiscardS(x,y)
|
||||||
|
#define TracySecureAllocS(x,y,z)
|
||||||
|
#define TracySecureFreeS(x,y)
|
||||||
|
#define TracySecureMemoryDiscardS(x,y)
|
||||||
|
|
||||||
#define TracyAllocNS(x,y,z,w)
|
#define TracyAllocNS(x,y,z,w)
|
||||||
#define TracyFreeNS(x,y,z)
|
#define TracyFreeNS(x,y,z)
|
||||||
|
#define TracySecureAllocNS(x,y,z,w)
|
||||||
|
#define TracySecureFreeNS(x,y,z)
|
||||||
|
|
||||||
#define TracyMessageS(x,y,z)
|
#define TracyMessageS(x,y,z)
|
||||||
#define TracyMessageLS(x,y)
|
#define TracyMessageLS(x,y)
|
||||||
@@ -211,12 +221,17 @@
|
|||||||
#define TracyMessageC( txt, size, color ) tracy::Profiler::LogString( tracy::MessageSourceType::User, tracy::MessageSeverity::Info, color, TRACY_CALLSTACK, size, txt )
|
#define TracyMessageC( txt, size, color ) tracy::Profiler::LogString( tracy::MessageSourceType::User, tracy::MessageSeverity::Info, color, TRACY_CALLSTACK, size, txt )
|
||||||
#define TracyMessageLC( txt, color ) tracy::Profiler::LogString( tracy::MessageSourceType::User, tracy::MessageSeverity::Info, color, TRACY_CALLSTACK, txt )
|
#define TracyMessageLC( txt, color ) tracy::Profiler::LogString( tracy::MessageSourceType::User, tracy::MessageSeverity::Info, color, TRACY_CALLSTACK, txt )
|
||||||
|
|
||||||
#define TracyAlloc( ptr, size ) tracy::Profiler::MemAllocCallstack( ptr, size, TRACY_CALLSTACK )
|
#define TracyAlloc( ptr, size ) tracy::Profiler::MemAllocCallstack( ptr, size, TRACY_CALLSTACK, false )
|
||||||
#define TracyFree( ptr ) tracy::Profiler::MemFreeCallstack( ptr, TRACY_CALLSTACK )
|
#define TracyFree( ptr ) tracy::Profiler::MemFreeCallstack( ptr, TRACY_CALLSTACK, false )
|
||||||
|
#define TracySecureAlloc( ptr, size ) tracy::Profiler::MemAllocCallstack( ptr, size, TRACY_CALLSTACK, true )
|
||||||
|
#define TracySecureFree( ptr ) tracy::Profiler::MemFreeCallstack( ptr, TRACY_CALLSTACK, true )
|
||||||
|
|
||||||
#define TracyAllocN( ptr, size, name ) tracy::Profiler::MemAllocCallstackNamed( ptr, size, TRACY_CALLSTACK, name )
|
#define TracyAllocN( ptr, size, name ) tracy::Profiler::MemAllocCallstackNamed( ptr, size, TRACY_CALLSTACK, false, name )
|
||||||
#define TracyFreeN( ptr, name ) tracy::Profiler::MemFreeCallstackNamed( ptr, TRACY_CALLSTACK, name )
|
#define TracyFreeN( ptr, name ) tracy::Profiler::MemFreeCallstackNamed( ptr, TRACY_CALLSTACK, false, name )
|
||||||
#define TracyMemoryDiscard( name ) tracy::Profiler::MemDiscardCallstack( name, TRACY_CALLSTACK )
|
#define TracyMemoryDiscard( name ) tracy::Profiler::MemDiscardCallstack( name, false, TRACY_CALLSTACK )
|
||||||
|
#define TracySecureAllocN( ptr, size, name ) tracy::Profiler::MemAllocCallstackNamed( ptr, size, TRACY_CALLSTACK, true, name )
|
||||||
|
#define TracySecureFreeN( ptr, name ) tracy::Profiler::MemFreeCallstackNamed( ptr, TRACY_CALLSTACK, true, name )
|
||||||
|
#define TracySecureMemoryDiscard( name ) tracy::Profiler::MemDiscardCallstack( name, true, TRACY_CALLSTACK )
|
||||||
|
|
||||||
#define ZoneNamedS( varname, depth, active ) static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location,TracyLine) { nullptr, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,TracyLine), depth, active )
|
#define ZoneNamedS( varname, depth, active ) static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location,TracyLine) { nullptr, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,TracyLine), depth, active )
|
||||||
#define ZoneNamedNS( varname, name, depth, active ) static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location,TracyLine) { name, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,TracyLine), depth, active )
|
#define ZoneNamedNS( varname, name, depth, active ) static constexpr tracy::SourceLocationData TracyConcat(__tracy_source_location,TracyLine) { name, TracyFunction, TracyFile, (uint32_t)TracyLine, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,TracyLine), depth, active )
|
||||||
@@ -231,12 +246,17 @@
|
|||||||
#define ZoneScopedCS( color, depth ) ZoneNamedCS( ___tracy_scoped_zone, color, depth, true )
|
#define ZoneScopedCS( color, depth ) ZoneNamedCS( ___tracy_scoped_zone, color, depth, true )
|
||||||
#define ZoneScopedNCS( name, color, depth ) ZoneNamedNCS( ___tracy_scoped_zone, name, color, depth, true )
|
#define ZoneScopedNCS( name, color, depth ) ZoneNamedNCS( ___tracy_scoped_zone, name, color, depth, true )
|
||||||
|
|
||||||
#define TracyAllocS( ptr, size, depth ) tracy::Profiler::MemAllocCallstack( ptr, size, depth )
|
#define TracyAllocS( ptr, size, depth ) tracy::Profiler::MemAllocCallstack( ptr, size, depth, false )
|
||||||
#define TracyFreeS( ptr, depth ) tracy::Profiler::MemFreeCallstack( ptr, depth )
|
#define TracyFreeS( ptr, depth ) tracy::Profiler::MemFreeCallstack( ptr, depth, false )
|
||||||
|
#define TracySecureAllocS( ptr, size, depth ) tracy::Profiler::MemAllocCallstack( ptr, size, depth, true )
|
||||||
|
#define TracySecureFreeS( ptr, depth ) tracy::Profiler::MemFreeCallstack( ptr, depth, true )
|
||||||
|
|
||||||
#define TracyAllocNS( ptr, size, depth, name ) tracy::Profiler::MemAllocCallstackNamed( ptr, size, depth, name )
|
#define TracyAllocNS( ptr, size, depth, name ) tracy::Profiler::MemAllocCallstackNamed( ptr, size, depth, false, name )
|
||||||
#define TracyFreeNS( ptr, depth, name ) tracy::Profiler::MemFreeCallstackNamed( ptr, depth, name )
|
#define TracyFreeNS( ptr, depth, name ) tracy::Profiler::MemFreeCallstackNamed( ptr, depth, false, name )
|
||||||
#define TracyMemoryDiscardS( name, depth ) tracy::Profiler::MemDiscardCallstack( name, depth )
|
#define TracyMemoryDiscardS( name, depth ) tracy::Profiler::MemDiscardCallstack( name, false, depth )
|
||||||
|
#define TracySecureAllocNS( ptr, size, depth, name ) tracy::Profiler::MemAllocCallstackNamed( ptr, size, depth, true, name )
|
||||||
|
#define TracySecureFreeNS( ptr, depth, name ) tracy::Profiler::MemFreeCallstackNamed( ptr, depth, true, name )
|
||||||
|
#define TracySecureMemoryDiscardS( name, depth ) tracy::Profiler::MemDiscardCallstack( name, true, depth )
|
||||||
|
|
||||||
#define TracyMessageS( txt, size, depth ) tracy::Profiler::LogString( tracy::MessageSourceType::User, tracy::MessageSeverity::Info, 0, depth, size, txt )
|
#define TracyMessageS( txt, size, depth ) tracy::Profiler::LogString( tracy::MessageSourceType::User, tracy::MessageSeverity::Info, 0, depth, size, txt )
|
||||||
#define TracyMessageLS( txt, depth ) tracy::Profiler::LogString( tracy::MessageSourceType::User, tracy::MessageSeverity::Info, 0, depth, txt )
|
#define TracyMessageLS( txt, depth ) tracy::Profiler::LogString( tracy::MessageSourceType::User, tracy::MessageSeverity::Info, 0, depth, txt )
|
||||||
|
|||||||
@@ -64,9 +64,14 @@ typedef const void* TracyCSharedLockCtx;
|
|||||||
#define TracyCAlloc(x,y)
|
#define TracyCAlloc(x,y)
|
||||||
#define TracyCFree(x)
|
#define TracyCFree(x)
|
||||||
#define TracyCMemoryDiscard(x)
|
#define TracyCMemoryDiscard(x)
|
||||||
|
#define TracyCSecureAlloc(x,y)
|
||||||
|
#define TracyCSecureFree(x)
|
||||||
|
#define TracyCSecureMemoryDiscard(x)
|
||||||
|
|
||||||
#define TracyCAllocN(x,y,z)
|
#define TracyCAllocN(x,y,z)
|
||||||
#define TracyCFreeN(x,y)
|
#define TracyCFreeN(x,y)
|
||||||
|
#define TracyCSecureAllocN(x,y,z)
|
||||||
|
#define TracyCSecureFreeN(x,y)
|
||||||
|
|
||||||
#define TracyCFrameMark
|
#define TracyCFrameMark
|
||||||
#define TracyCFrameMarkNamed(x)
|
#define TracyCFrameMarkNamed(x)
|
||||||
@@ -93,9 +98,14 @@ typedef const void* TracyCSharedLockCtx;
|
|||||||
#define TracyCAllocS(x,y,z)
|
#define TracyCAllocS(x,y,z)
|
||||||
#define TracyCFreeS(x,y)
|
#define TracyCFreeS(x,y)
|
||||||
#define TracyCMemoryDiscardS(x,y)
|
#define TracyCMemoryDiscardS(x,y)
|
||||||
|
#define TracyCSecureAllocS(x,y,z)
|
||||||
|
#define TracyCSecureFreeS(x,y)
|
||||||
|
#define TracyCSecureMemoryDiscardS(x,y)
|
||||||
|
|
||||||
#define TracyCAllocNS(x,y,z,w)
|
#define TracyCAllocNS(x,y,z,w)
|
||||||
#define TracyCFreeNS(x,y,z)
|
#define TracyCFreeNS(x,y,z)
|
||||||
|
#define TracyCSecureAllocNS(x,y,z,w)
|
||||||
|
#define TracyCSecureFreeNS(x,y,z)
|
||||||
|
|
||||||
#define TracyCMessageS(x,y,z)
|
#define TracyCMessageS(x,y,z)
|
||||||
#define TracyCMessageLS(x,y)
|
#define TracyCMessageLS(x,y)
|
||||||
@@ -285,26 +295,31 @@ TRACY_API int32_t ___tracy_connected(void);
|
|||||||
#define TracyCZoneValue( ctx, value ) ___tracy_emit_zone_value( ctx, value );
|
#define TracyCZoneValue( ctx, value ) ___tracy_emit_zone_value( ctx, value );
|
||||||
|
|
||||||
|
|
||||||
TRACY_API void ___tracy_emit_memory_alloc( const void* ptr, size_t size );
|
TRACY_API void ___tracy_emit_memory_alloc( const void* ptr, size_t size, int32_t secure );
|
||||||
TRACY_API void ___tracy_emit_memory_alloc_callstack( const void* ptr, size_t size, int32_t depth );
|
TRACY_API void ___tracy_emit_memory_alloc_callstack( const void* ptr, size_t size, int32_t depth, int32_t secure );
|
||||||
TRACY_API void ___tracy_emit_memory_free( const void* ptr );
|
TRACY_API void ___tracy_emit_memory_free( const void* ptr, int32_t secure );
|
||||||
TRACY_API void ___tracy_emit_memory_free_callstack( const void* ptr, int32_t depth );
|
TRACY_API void ___tracy_emit_memory_free_callstack( const void* ptr, int32_t depth, int32_t secure );
|
||||||
TRACY_API void ___tracy_emit_memory_alloc_named( const void* ptr, size_t size, const char* name );
|
TRACY_API void ___tracy_emit_memory_alloc_named( const void* ptr, size_t size, int32_t secure, const char* name );
|
||||||
TRACY_API void ___tracy_emit_memory_alloc_callstack_named( const void* ptr, size_t size, int32_t depth, const char* name );
|
TRACY_API void ___tracy_emit_memory_alloc_callstack_named( const void* ptr, size_t size, int32_t depth, int32_t secure, const char* name );
|
||||||
TRACY_API void ___tracy_emit_memory_free_named( const void* ptr, const char* name );
|
TRACY_API void ___tracy_emit_memory_free_named( const void* ptr, int32_t secure, const char* name );
|
||||||
TRACY_API void ___tracy_emit_memory_free_callstack_named( const void* ptr, int32_t depth, const char* name );
|
TRACY_API void ___tracy_emit_memory_free_callstack_named( const void* ptr, int32_t depth, int32_t secure, const char* name );
|
||||||
TRACY_API void ___tracy_emit_memory_discard( const char* name );
|
TRACY_API void ___tracy_emit_memory_discard( const char* name, int32_t secure );
|
||||||
TRACY_API void ___tracy_emit_memory_discard_callstack( const char* name, int32_t depth );
|
TRACY_API void ___tracy_emit_memory_discard_callstack( const char* name, int32_t secure, int32_t depth );
|
||||||
|
|
||||||
TRACY_API void ___tracy_emit_logString( int8_t severity, int32_t color, int32_t callstack_depth, size_t size, const char* txt );
|
TRACY_API void ___tracy_emit_logString( int8_t severity, int32_t color, int32_t callstack_depth, size_t size, const char* txt );
|
||||||
TRACY_API void ___tracy_emit_logStringL( int8_t severity, int32_t color, int32_t callstack_depth, const char* txt );
|
TRACY_API void ___tracy_emit_logStringL( int8_t severity, int32_t color, int32_t callstack_depth, const char* txt );
|
||||||
|
|
||||||
#define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK )
|
#define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK, 0 )
|
||||||
#define TracyCFree( ptr ) ___tracy_emit_memory_free_callstack( ptr, TRACY_CALLSTACK )
|
#define TracyCFree( ptr ) ___tracy_emit_memory_free_callstack( ptr, TRACY_CALLSTACK, 0 )
|
||||||
#define TracyCMemoryDiscard( name ) ___tracy_emit_memory_discard_callstack( name, TRACY_CALLSTACK );
|
#define TracyCMemoryDiscard( name ) ___tracy_emit_memory_discard_callstack( name, 0, TRACY_CALLSTACK );
|
||||||
|
#define TracyCSecureAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK, 1 )
|
||||||
|
#define TracyCSecureFree( ptr ) ___tracy_emit_memory_free_callstack( ptr, TRACY_CALLSTACK, 1 )
|
||||||
|
#define TracyCSecureMemoryDiscard( name ) ___tracy_emit_memory_discard_callstack( name, 1, TRACY_CALLSTACK );
|
||||||
|
|
||||||
#define TracyCAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, TRACY_CALLSTACK, name )
|
#define TracyCAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, TRACY_CALLSTACK, 0, name )
|
||||||
#define TracyCFreeN( ptr, name ) ___tracy_emit_memory_free_callstack_named( ptr, TRACY_CALLSTACK, name )
|
#define TracyCFreeN( ptr, name ) ___tracy_emit_memory_free_callstack_named( ptr, TRACY_CALLSTACK, 0, name )
|
||||||
|
#define TracyCSecureAllocN( ptr, size, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, TRACY_CALLSTACK, 1, name )
|
||||||
|
#define TracyCSecureFreeN( ptr, name ) ___tracy_emit_memory_free_callstack_named( ptr, TRACY_CALLSTACK, 1, name )
|
||||||
|
|
||||||
#define TracyCMessage( txt, size ) ___tracy_emit_logString( TracyMessageSeverityInfo, 0, TRACY_CALLSTACK, size, txt )
|
#define TracyCMessage( txt, size ) ___tracy_emit_logString( TracyMessageSeverityInfo, 0, TRACY_CALLSTACK, size, txt )
|
||||||
#define TracyCMessageL( txt ) ___tracy_emit_logStringL( TracyMessageSeverityInfo, 0, TRACY_CALLSTACK, txt )
|
#define TracyCMessageL( txt ) ___tracy_emit_logStringL( TracyMessageSeverityInfo, 0, TRACY_CALLSTACK, txt )
|
||||||
@@ -342,12 +357,17 @@ TRACY_API void ___tracy_emit_message_appinfo( const char* txt, size_t size );
|
|||||||
#define TracyCZoneCS( ctx, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,TracyLine) = { NULL, __func__, TracyFile, (uint32_t)TracyLine, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,TracyLine), depth, active );
|
#define TracyCZoneCS( ctx, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,TracyLine) = { NULL, __func__, TracyFile, (uint32_t)TracyLine, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,TracyLine), depth, active );
|
||||||
#define TracyCZoneNCS( ctx, name, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,TracyLine) = { name, __func__, TracyFile, (uint32_t)TracyLine, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,TracyLine), depth, active );
|
#define TracyCZoneNCS( ctx, name, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,TracyLine) = { name, __func__, TracyFile, (uint32_t)TracyLine, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,TracyLine), depth, active );
|
||||||
|
|
||||||
#define TracyCAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth )
|
#define TracyCAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth, 0 )
|
||||||
#define TracyCFreeS( ptr, depth ) ___tracy_emit_memory_free_callstack( ptr, depth )
|
#define TracyCFreeS( ptr, depth ) ___tracy_emit_memory_free_callstack( ptr, depth, 0 )
|
||||||
#define TracyCMemoryDiscardS( name, depth ) ___tracy_emit_memory_discard_callstack( name, depth )
|
#define TracyCMemoryDiscardS( name, depth ) ___tracy_emit_memory_discard_callstack( name, 0, depth )
|
||||||
|
#define TracyCSecureAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth, 1 )
|
||||||
|
#define TracyCSecureFreeS( ptr, depth ) ___tracy_emit_memory_free_callstack( ptr, depth, 1 )
|
||||||
|
#define TracyCSecureMemoryDiscardS( name, depth ) ___tracy_emit_memory_discard_callstack( name, 1, depth )
|
||||||
|
|
||||||
#define TracyCAllocNS( ptr, size, depth, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, depth, name )
|
#define TracyCAllocNS( ptr, size, depth, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, depth, 0, name )
|
||||||
#define TracyCFreeNS( ptr, depth, name ) ___tracy_emit_memory_free_callstack_named( ptr, depth, name )
|
#define TracyCFreeNS( ptr, depth, name ) ___tracy_emit_memory_free_callstack_named( ptr, depth, 0, name )
|
||||||
|
#define TracyCSecureAllocNS( ptr, size, depth, name ) ___tracy_emit_memory_alloc_callstack_named( ptr, size, depth, 1, name )
|
||||||
|
#define TracyCSecureFreeNS( ptr, depth, name ) ___tracy_emit_memory_free_callstack_named( ptr, depth, 1, name )
|
||||||
|
|
||||||
#define TracyCMessageS( txt, size, depth ) ___tracy_emit_logString( TracyMessageSeverityInfo, 0, depth, size, txt )
|
#define TracyCMessageS( txt, size, depth ) ___tracy_emit_logString( TracyMessageSeverityInfo, 0, depth, size, txt )
|
||||||
#define TracyCMessageLS( txt, depth ) ___tracy_emit_logStringL( TracyMessageSeverityInfo, 0, depth, txt )
|
#define TracyCMessageLS( txt, depth ) ___tracy_emit_logStringL( TracyMessageSeverityInfo, 0, depth, txt )
|
||||||
|
|||||||
Reference in New Issue
Block a user