diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2018-06-22 01:15:50 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2018-06-22 01:15:50 +0300 |
commit | 63611403ff735ee6afa0c59baf66a469a6e0277b (patch) | |
tree | 091734222340eaf7271d140bf44bd2488ebac16d /README.md | |
parent | 3404d191f01414165054d422eb972037b1bb79b6 (diff) |
Add memory profiling documentation.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -1,6 +1,6 @@ # Tracy Profiler -Tracy is a real time, nanosecond resolution frame profiler that can be used for remote or embedded telemetry of your application. It can profile both CPU (C++, Lua) and GPU (OpenGL, Vulkan). It also can display locks held by threads and their interactions with each other. +Tracy is a real time, nanosecond resolution frame profiler that can be used for remote or embedded telemetry of your application. It can profile CPU (C++, Lua), GPU (OpenGL, Vulkan) and memory. It also can display locks held by threads and their interactions with each other. ![](doc/profiler.png) @@ -85,7 +85,7 @@ Similarly, you can use `TracySharedLockable`, `TracySharedLockableN` and `Shared #### Plotting data -Tracy is able to capture and draw value changes over time. You may use it to analyse memory usage, draw call count, etc. To report data, use the `TracyPlot( name, value )` macro. +Tracy is able to capture and draw value changes over time. You may use it to analyse draw call count, number of performed queries, etc. To report data, use the `TracyPlot( name, value )` macro. ![](doc/plot.png) @@ -95,6 +95,18 @@ Fast navigation in large data set and correlation of zones with what was happeni ![](doc/messages.png) +#### Memory profiling + +Tracy can monitor memory usage of your application. Knowledge about each performed memory allocation enables the following: + +- Memory usage graph (like in massif, but fully interactable). +- List of active allocations at program exit (leak list). +- Visualization of memory map. +- Ability to rewind view of active allocations and memory map to any point of program execution. +- Information about memory statistics of each zone. + +To mark memory events, use the `TracyAlloc( ptr, size )` and `TracyFree( ptr )` macros. Typically you would do that in overloads of `operator new` and `operator delete`. + #### Lua support To profile Lua code using tracy, include the `tracy/TracyLua.hpp` header file in your Lua wrapper and execute `tracy::LuaRegister( lua_State* )` function to add instrumentation support. In your Lua code, add `tracy.ZoneBegin()` and `tracy.ZoneEnd()` calls to mark execution zones. Double check if you have included all return paths! Use `tracy.ZoneBeginN( name )` to set zone name. Use `tracy.ZoneText( text )` to set zone text. Use `tracy.Message( text )` to send messages. |