1
0
mirror of https://github.com/wolfpld/tracy synced 2025-04-29 12:23:53 +00:00

Compare commits

...

3871 Commits
v0.7 ... master

Author SHA1 Message Date
Bartosz Taudul
a03c7580b9
Merge pull request #1038 from simonvanbernem/save-ui-scale
Added saving of user ui scale via global configuration.
2025-04-28 17:02:54 +02:00
Simon van Bernem
132a4ba320 Revert "The config is now always saved on exit."
This reverts commit 6b03d1dd9e80069fef12e9f5043b627bfea99f17.
2025-04-28 17:01:29 +02:00
Simon van Bernem
6b03d1dd9e The config is now always saved on exit. 2025-04-28 15:37:04 +02:00
Simon van Bernem
7474127bbb Fixed typo 2025-04-27 21:38:23 +02:00
Simon van Bernem
a277453acb Added saving of user ui scale in the global configuration. Moved userScale into s_config. Prevented "Get started" and "Loading trace..." windows from having their position saved between restarts, because if you change scale and then restart, they might get pushed to the edge of the window, which is confusing. 2025-04-27 21:33:08 +02:00
Bartosz Taudul
cc0c53496d
Merge pull request #1037 from simonvanbernem/per-monitor-dpi
Adding per-monitor DPI awareness
2025-04-25 21:37:55 +02:00
Simon van Bernem
a150fdfc35 Adding per-monitor DPI awareness by using glfwGetWindowContentScale instead of glfwGetMonitorContentScale and ensuring that the window is also resized appropriately by using GLFW_SCALE_TO_MONITOR 2025-04-25 19:44:30 +02:00
Bartosz Taudul
753305a797
Merge pull request #1031 from shtanko-sv/csvexport-values
Add exporting user values into CSV
2025-04-17 12:46:18 +02:00
Sergey Shtanko
0039895398 Add exporting user values into CSV 2025-04-17 11:11:02 +01:00
Bartosz Taudul
1fc7c9f160
Merge pull request #1024 from siliceum/update-batch-addr2line
tracy-update: Batch addr2line calls per 1024 addresses and escape paths
2025-04-14 17:04:02 +02:00
Clément Grégoire
f02c6fe4d5 Batch addr2line calls per 1024 addresses and escape paths
addr2line starts failing when given too many addresses to resolve.
Batching per 1024 addresses allows not only to see progress but also fixes resolution for images with high number of addresses to resolve.
Escaping is also required when image paths have spaces for example.
2025-04-14 15:39:26 +02:00
Bartosz Taudul
0d1d28415c
Merge pull request #1022 from siliceum/TracyLine-Evaluate-to-a-constant
Change TracyLine to be evaluate as a constant even with Edit-and-Cont…
2025-04-14 15:00:52 +02:00
Bartosz Taudul
54d6dd9662
Merge pull request #1023 from slomp/master
More context about the MSVC "Edit and Continue" issue
2025-04-12 16:50:20 +02:00
Marcos Slomp
195d79fc67
More context about the MSVC "Edit and Continue" issue 2025-04-12 07:38:19 -07:00
Gabriel Bon
f41c4672cb Change TracyLine to be evaluate as a constant even with Edit-and-Continue 2025-04-10 09:26:47 +02:00
Bartosz Taudul
e656d49f53
Merge pull request #1020 from GabTux/master
Bump PPQSort version to 1.0.5.
2025-04-08 00:24:38 +02:00
Gabriel Hevr
85a9d5e284 Bump PPQSort version to 1.0.5. 2025-04-07 21:27:57 +02:00
Bartosz Taudul
3f9c4736f3
Merge pull request #1018 from tealsnow/master
Update link to zig bindings to an up-to-date and maintained version
2025-04-02 18:50:42 +02:00
Ketan Reynolds
49d8a2c082
Update link to zig bindings to an up-to-date and maintained version
The original link was out of date and unmaintained
I've changed it to an up-to-date and maintained one
2025-04-02 18:32:15 +02:00
Bartosz Taudul
2d9169e3d1
Merge pull request #1015 from mcourteaux/fix-lockmark
Adjust LockMark() macro to allow member access expressions, like LockMark(object.mutex);
2025-03-28 16:21:09 +01:00
Martijn Courteaux
bb474a12c7 Adjust LockMark() macro to allow member access expressions, like LockMark(object.mutex); 2025-03-28 16:08:53 +01:00
Bartosz Taudul
684400b45c
Merge pull request #1012 from stalkopat/clipboard-user-text
Add clipboard button for user text in ZoneInfo
2025-03-25 22:31:31 +01:00
stalkopat
e5482580cd add clipboard button for user text in ZoneInfo 2025-03-25 18:13:59 +00:00
Bartosz Taudul
9074461ffb
Merge pull request #1005 from jrng/gpu-zero-callstack
Handle callstack of zero in Vulkan and Direct3D 11
2025-03-10 22:23:21 +01:00
Julius Range-Lüdemann
eb47afe1f0 Handle callstack of zero in Vulkan and Direct3D 11
With TRACY_CALLSTACK set to 0 when not defined, these gpu functions get
called with depth=0. In other places this was alread fixed.
2025-03-10 21:38:59 +01:00
Bartosz Taudul
873c6ecac8
Merge pull request #1004 from bbb651/xdg-activation
wayland: Activate window with `XDG_ACTIVATION_TOKEN`.
2025-03-09 12:23:47 +01:00
bbb651
ae2e6d0a7b wayland: Activate window with XDG_ACTIVATION_TOKEN. 2025-03-09 00:45:51 +02:00
Bartosz Taudul
1530884256
Merge pull request #1003 from Lectem/cmake-require-python
Let CMake discover python3 and make it required
2025-03-08 17:31:35 +01:00
Clément Grégoire
7455e5890e Let CMake discover python3 and make it required since it is effectively needed to build
This gives a better error message and helps finding the correct python executable since python3 may actually be only named python on windows for example.
2025-03-08 16:37:09 +01:00
Bartosz Taudul
2183962ef7
Merge pull request #995 from anthofoxo/lua-hook
Provide Lua hook function for automatic Lua instrumentation.
2025-03-01 11:43:06 +01:00
AnthoFoxo
bc7ec5b89b
Improve wording in tracy.tex for automatic lua instrumentation 2025-02-28 23:52:23 -05:00
AnthoFoxo
9b3c46dd5e
Document automatic Lua instrumentation in tracy.tex 2025-02-28 08:41:42 -05:00
AnthoFoxo
54dcbc87ad
implement lua hook function 2025-02-26 21:09:31 -05:00
FrK5E
b8c2e25c3d
Fix a build of OpelCLVectorAdd example on linux (#989)
* Add a <cmath> as to fix unknown symbol sqrt whist building on linux (gcc). Remove <algorithm> as a consequence of clangd suggestion.

* adjust according to the review comment
2025-02-26 15:37:49 +01:00
Bartosz Taudul
b04dfcd43d
Use ccache if available. 2025-02-21 23:27:15 +01:00
Bartosz Taudul
48efd98df7
Unmap icon buffer memory. 2025-02-20 00:14:24 +01:00
Bartosz Taudul
c5dc5f4455
Bump zstd to 1.5.7, use CPM to download. 2025-02-19 23:47:37 +01:00
Bartosz Taudul
8ad05c66ae
Merge pull request #987 from mtreglia-gpsw/meson/fixes
Change meson install settings to correctly copy directory hierarchy
2025-02-19 13:34:05 +01:00
Bartosz Taudul
6566d6a8d8
Merge pull request #988 from mtreglia-gpsw/tools/install
Add install target for binaries in capture and csvexport
2025-02-19 13:34:00 +01:00
Marco Treglia
ad61037925 Add install target for binaries in capture and csvexport 2025-02-19 09:41:32 +01:00
Marco Treglia
2d53818e55 Changed mesong.build 2025-02-19 09:36:55 +01:00
Marco Treglia
d966ecf9f7 add TracyKCore in meson.build 2025-02-19 09:36:50 +01:00
Bartosz Taudul
d71fc39577
Merge pull request #986 from Xnuman/master
Change cmake export settings to correctly copy directory hierarchy
2025-02-19 00:46:12 +01:00
Xnum
40d12b6a53 Changed CMakeLists.txt 2025-02-18 23:38:25 +01:00
Bartosz Taudul
4a5a21cdb0
Merge pull request #982 from brad-anderson/patch-1
Include <chrono> explicitly in TraceyView
2025-02-12 20:05:58 +01:00
Brad Anderson
50ff279aad
Include <chrono> explicitly in TraceyView
In Visual Studio 17.13 the STL team at Microsoft cleaned up internal includes of other public STL headers (most notably <chrono>) to increase build throughput for STL users, but now you need to include them yourself rather than rely on the indirect inclusion.
2025-02-12 11:40:27 -07:00
Bartosz Taudul
367ed69501
Use XDG toplevel icon protocol to set the icon. 2025-02-12 00:21:27 +01:00
Bartosz Taudul
8b3638e8e2
Merge pull request #981 from slomp/patch-1
quick-fix for TracyD3D11.hpp
2025-02-10 18:45:58 +01:00
Marcos Slomp
5c069f9d8d
quick-fix for TracyD3D11.hpp
Apparently, waiting for an enclosing query does not guarantee that the inner queries also become readily available... Need to wait for them too.
2025-02-10 09:13:33 -08:00
Bartosz Taudul
9b7d53a979
Add short images option to callstack / wait stacks window. 2025-02-07 17:34:19 +01:00
Bartosz Taudul
ad5615cda2
Short image names in sample entry stacks window. 2025-02-07 17:28:55 +01:00
Bartosz Taudul
b8a64190dc
Add external frames checkbox to sample entry stacks window. 2025-02-07 17:16:18 +01:00
Bartosz Taudul
3b48252bb3
Move "group by function name" checkbox to a more appropriate place. 2025-02-07 17:15:52 +01:00
Bartosz Taudul
526e41b5dc
Don't show image tooltip, if there's no shortening and it fits the space. 2025-02-07 02:43:32 +01:00
Bartosz Taudul
cfc67727a0
Add button to view entry stacks from the symbol view. 2025-02-07 02:39:00 +01:00
Bartosz Taudul
015a27bb4e
Cosmetics. 2025-02-07 02:29:08 +01:00
Bartosz Taudul
f1128f825d
Rename "sample entry call stacks" to "sample entry stacks". 2025-02-07 02:27:43 +01:00
Bartosz Taudul
c38764db3c
Add appropriate tooltips for image names. 2025-02-07 02:21:52 +01:00
Bartosz Taudul
408939862b
Add an option to display only the file part of image name. 2025-02-07 02:17:40 +01:00
Bartosz Taudul
3ac95e6902
Bump imgui to 1.91.8. 2025-02-03 19:54:39 +01:00
Bartosz Taudul
0c228533f2
Merge pull request #978 from phsilva/master
Fix python bindings build
2025-01-29 01:42:46 +01:00
Paulo Henrique Silva
55d7df3782 Fix python bindings build 2025-01-28 15:23:52 -08:00
Bartosz Taudul
16405715a6
Bump PPQSort to 1.0.4. 2025-01-27 18:59:22 +01:00
Bartosz Taudul
5479a42ef9
Merge pull request #975 from dezhiAmd/csvExportGpuZone
Export gpu zones to csv file
2025-01-23 20:05:58 +01:00
Liao
4662be3aac make it easier to see the diff
Signed-off-by: Liao <dezhliao@amd.com>
2025-01-23 10:18:12 -08:00
Liao
e19a823c37 remove spaces due to autoformatting
Signed-off-by: Liao <dezhliao@amd.com>
2025-01-20 12:14:36 -08:00
Liao
2020ef6c6e Add a flag -g to export gpu zones to csv file
Signed-off-by: Liao <dezhliao@amd.com>
2025-01-20 11:48:56 -08:00
Bartosz Taudul
f583d1c855
Merge pull request #973 from 0-wiz-0/master
Use correct header on NetBSD.
2025-01-20 14:13:17 +01:00
Thomas Klausner
7272f9cac1 Use correct header on NetBSD. 2025-01-20 14:10:34 +01:00
Bartosz Taudul
da60684b9f
Merge pull request #967 from foxtran/feature/lto
Add cross-project LTO
2025-01-14 11:24:13 +01:00
Igor S. Gerasimov
be3aa5ac21 Add info about TRACY_LTO 2025-01-11 19:56:02 +01:00
Igor S. Gerasimov
b87a935c58 Allow global setting of CMAKE_INTERPROCEDURAL_OPTIMIZATION 2025-01-11 19:35:39 +01:00
Igor S. Gerasimov
9d03627a17 Add info about LTO usage for Fortran; C++ projects can be linked as before 2025-01-11 19:07:31 +01:00
Igor S. Gerasimov
7c48baf132 Add Link-Time optimization option 2025-01-11 16:33:01 +01:00
Igor S. Gerasimov
2608c6bbc9 Use whitespaces only 2025-01-11 16:15:33 +01:00
Bartosz Taudul
e49c25f2f5
Update NEWS. 2025-01-09 13:48:46 +01:00
Bartosz Taudul
b68f63c6d5
Add Fortran to list of provided integrations. 2025-01-09 13:21:05 +01:00
Bartosz Taudul
27689bcf43
Merge pull request #962 from foxtran/feature/fortran-support
Add initial native Fortran support
2025-01-09 13:18:57 +01:00
Bartosz Taudul
277555af2a
Merge pull request #961 from foxtran/fix/c-int
Use `int32_t` type instead of `int`
2025-01-09 13:16:19 +01:00
Igor S. Gerasimov
802bdbbecc Fix type(c_ptr) in bind(C) 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
a42ea071a0 Add support of Cray compilers 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
fd33d1c839 Add support of Oracle Sun 12.6 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
21c8d7615d Add colors 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
092e91d058 Add documentation 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
f01973a78c Reset srcloc variables 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
4273d34ca4 tracy_source_location_data must be public 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
fb9686fb28 Prettify code 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
9b14656c8a Add null char 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
38e7024277 Add plot formats 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
7730ac595f Add fibers support 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
82460b0316 Use simpler typename of context 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
caabfc6379 Implement plots 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
49cc094869 Implement tracy_appinfo 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
fbc40e8b9e Implement frame related things 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
4d5cd252a4 Add messages 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
59116feb55 Implement memory operations 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
4fd6d5317b Implement tracy_connected 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
07cd1d8ee1 Implement zone_set_properties 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
ead67c06d9 Add zone begin/end 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
1d627c86be Implement tracy_alloc_srcloc 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
66a50a8c76 Add TRACY_MANUAL_LIFETIME routines 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
3488e08aa7 Add Tracy structures except lockable 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
d16986dfa7 Add tracy_set_thread_name 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
a30fff8b4c CMake support of Fortran bindings 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
e981a5ba6f Add initial module file 2025-01-05 23:21:12 +01:00
Igor S. Gerasimov
3e88544d1f Update int type in Python API 2025-01-02 21:44:06 +01:00
Igor S. Gerasimov
7093eb0b08 Update int for ___tracy_after_try_lock_lockable_ctx 2025-01-02 14:33:09 +01:00
Igor S. Gerasimov
7e128f3bce Update int for ___tracy_emit_plot_config 2025-01-02 14:32:04 +01:00
Igor S. Gerasimov
6e220fee91 Update int for ___tracy_emit_frame_image 2025-01-02 14:25:06 +01:00
Igor S. Gerasimov
94403bde4b Update int for ___tracy_before_lock_lockable_ctx 2025-01-02 14:23:06 +01:00
Igor S. Gerasimov
cd8e2a5d8a Update int for ___tracy_connected 2025-01-02 14:20:37 +01:00
Igor S. Gerasimov
a8f844b970 Use int32_t type for depth in client 2025-01-02 14:19:12 +01:00
Igor S. Gerasimov
78bca3f0e1 Use int32_t for callstack (depth) 2025-01-02 14:04:06 +01:00
Igor S. Gerasimov
4929ac6487 Use int32_t for secure flag 2025-01-02 13:45:47 +01:00
Igor S. Gerasimov
39d382b033 Use int32_t for active flag 2025-01-02 13:42:22 +01:00
Igor S. Gerasimov
8baa50b2f5 Update int for ___tracy_profiler_started 2025-01-02 13:28:39 +01:00
Igor S. Gerasimov
7f516e2fed Update int type in structures 2025-01-02 13:21:44 +01:00
Bartosz Taudul
8b0b2343e1
Merge pull request #957 from foxtran/feature/merge-calls-callstack
Simplify API by decreasing a number of entry points
2025-01-02 12:08:39 +01:00
Igor S. Gerasimov
b9c7cd1738 Fix code formatting 2025-01-02 11:49:51 +01:00
Igor S. Gerasimov
31eeb843c7 Small reformat 2025-01-02 11:26:56 +01:00
Igor S. Gerasimov
d30a2d6854 Simplify ZoneBegin functions 2025-01-02 11:26:56 +01:00
Bartosz Taudul
38636648d3
Merge pull request #960 from JasonnnW3000/master
Update LICENSE, fix copyright license year
2025-01-01 12:55:33 +01:00
JasonnnW3000
23bfabc6c2
Update LICENSE, fix license year
Signed-off-by: JasonnnW3000 <sufssl04@gmail.com>
2025-01-01 05:50:07 -05:00
Bartosz Taudul
57f1a63b3f
Merge pull request #956 from foxtran/fix/incompatible-MANUAL_LIFETIME
Generate human-readable errors when TRACY_MANUAL_LIFETIME is set and TRACT_DELAYED_INIT is not
2024-12-27 12:32:51 +01:00
Igor S. Gerasimov
3f700c93a6 Do not unset TRACY_CALLSTACK 2024-12-27 11:47:02 +01:00
Igor S. Gerasimov
a2fce55aee Rename has_stacktrace -> has_callstack 2024-12-27 11:43:00 +01:00
Igor S. Gerasimov
9aba23bbb0 Remove TRACY_HAS_STACKCALL from TracyC.h 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov
96ba28e761 Use constexpr instead of macro in memory manager in C API 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov
39137d809e Accept zero-depth callstack 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov
117ab107c1 Simplify macroses for stack collections 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov
4591dfa208 Simplify tracy::Profiler defines 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov
e9eecbb2c6 Replace #ifdef TRACT_HAS_CALLSTACK with constexpr call 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov
cf912bbb19 Merge ScopedZone initializers 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov
1c63239a78 Always collect callstack 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov
e9664a1c87 Introduce has_stacktrace function 2024-12-27 11:29:41 +01:00
Igor S. Gerasimov
caf0047367 Catch disabled TRACY_DELAYED_INIT when TRACY_MANUAL_LIFETIME is enabled 2024-12-27 08:58:00 +01:00
Igor S. Gerasimov
5051db201e Show error message if TRACY_MANUAL_LIFETIME is enabled without enabled TRACY_DELAYED_INIT 2024-12-27 08:51:50 +01:00
Bartosz Taudul
6452690e57
Merge pull request #948 from avilleret/avilleret/csvexport_plot
add very simple plot export
2024-12-23 13:41:02 +01:00
Antoine Villeret
aa28504c60 add very simple plot export 2024-12-23 13:12:51 +01:00
Bartosz Taudul
96e1cb17c6
Merge pull request #944 from foxtran/patch-2
Enable -fexperimental-library only for C++ frontend of AppleClang
2024-12-20 12:36:39 +01:00
foxtran
07d38d608e
Enable -fexperimental-library only for C++ 2024-12-20 11:55:18 +01:00
foxtran
01a7f62650
Enable -fexperimental-library only for AppleClang 2024-12-20 11:39:49 +01:00
Bartosz Taudul
7fc3366086
Add support for keeping external tails in flame graph. 2024-12-16 16:48:51 +01:00
Bartosz Taudul
99d39e6eee
Separate call stack traversal from flame graph building. 2024-12-16 16:41:00 +01:00
Bartosz Taudul
9d839c52d1
Allow filtering out external frames in flame graph. 2024-12-16 16:21:31 +01:00
Bartosz Taudul
70fc28506f
Expose IsFrameExternal as View's method. 2024-12-16 16:21:31 +01:00
Bartosz Taudul
1e796064bc
Add external frames UI to flame graph. 2024-12-16 16:21:31 +01:00
Bartosz Taudul
bb02d0b0af
Add icon to external frames checkbox. 2024-12-16 14:21:05 +01:00
Bartosz Taudul
87c54f92cf
Merge pull request #941 from UnixY2K/patch-1
[Meson][Windows] detect MSVC usage
2024-12-12 21:00:04 +01:00
Jonathan Guzmán
b48ab72cf0
detect MSVC usage
previous check tested for compiler ID, fixed the detection to an specific MSVC macro and the current C++ version so it does not override an user specified version
2024-12-12 12:37:53 -06:00
Bartosz Taudul
45c4dc5124
Bump imgui to 1.91.6-docking. 2024-12-11 17:08:21 +01:00
Bartosz Taudul
f703cc33cf
Merge pull request #939 from eibach/feature_hexvalue
Display zone values also in hex
2024-12-10 11:41:22 +01:00
Dirk Eibach
8f25eaf54e Display zone values also in hex 2024-12-10 11:07:48 +01:00
Bartosz Taudul
c214804aa1
Merge pull request #935 from JCash/missing-namespace
Added missing tracy:: to some macros
2024-12-01 17:02:15 +01:00
JCash
c5797e4e36 Added missing tracy:: 2024-12-01 16:19:27 +01:00
Bartosz Taudul
a9e8f9a5f8
Merge pull request #931 from eibach/feature_abstime
Add absolute time info to Zone info view
2024-11-27 22:59:27 +01:00
Dirk Eibach
f0ee324399 Add absolute time info to Zone info view 2024-11-27 22:31:48 +01:00
Bartosz Taudul
759b4c3bfe
Merge pull request #927 from sacereda/systrace-leak
Leak, returned value from GetThreadDescription not freed
2024-11-19 14:50:56 +01:00
Sergio Acereda
b9ee0d3b4c Leak, returned value from GetThreadDescription not freed 2024-11-19 14:24:50 +01:00
Bartosz Taudul
e756fa75cf
Fix UI. 2024-11-17 12:20:55 +01:00
Bartosz Taudul
e6ee311392
Merge pull request #926 from WernherVonData/percentiles-for-find-zone
Percentiles p75, p90 for FindZone view
2024-11-17 12:18:27 +01:00
wernhervondata
b9b808ca12 fixup! percentiles p75, p90 for FindZone view 2024-11-17 10:26:24 +01:00
wernhervondata
cc0f158c16 percentiles p75, p90 for FindZone view 2024-11-16 15:11:46 +01:00
Bartosz Taudul
5120ad8311
Merge pull request #925 from TroutZhang/patch-1
Fix crash on Android due to wrong TLS model
2024-11-16 11:58:05 +01:00
Trout Zhang
339a92a7b2
Fix crash on Android due to wrong TLS model 2024-11-15 18:22:35 +02:00
imkunet
0cac843ad7
Add scroll modifier options 2024-11-14 18:10:14 +01:00
Bartosz Taudul
3c0db7e3c3
Merge pull request #924 from fknorr/sys-power-fscanf-warning
Silence GCC fscanf warning in TracySysPower.cpp
2024-11-13 11:30:25 +01:00
Fabian Knorr
7ef690bd5a Silence GCC fscanf warning in TracySysPower.cpp
fscanf is [[warn_unused_result]], which triggers -Wunused-result. In
this instance it is correct for maxRange to remain unchanged if reading
from sysfs should fail for some reason.
2024-11-13 10:15:05 +01:00
Bartosz Taudul
16ef91c238
Bump imgui to 1.91.5-docking. 2024-11-07 22:33:39 +01:00
Bartosz Taudul
ee06542f1f
Restrict mold linker to Linux. 2024-10-30 17:11:51 +01:00
Bartosz Taudul
caa61de540
Do not build fat macos capstone library. 2024-10-30 17:10:40 +01:00
Bartosz Taudul
55ea2a20e7
Set minimum size for folded flame graph items. 2024-10-27 19:59:48 +01:00
Bartosz Taudul
2097e3c836
Normalize flame graph sample frame names, to mach callstack list behavior. 2024-10-27 19:53:32 +01:00
Bartosz Taudul
84718101fe
Use proper name for inline frames in flame graph. 2024-10-27 19:44:40 +01:00
Bartosz Taudul
ecf3b30baf
Add minimum width for flame graph items to be drawn. 2024-10-27 12:53:52 +01:00
Bartosz Taudul
ceeea7712d
Use precalculated start times. 2024-10-27 12:00:34 +01:00
Bartosz Taudul
9d2f874b02
Calculate flame graph begin times. 2024-10-27 11:58:23 +01:00
Bartosz Taudul
92241fc0a4
Fix typo. 2024-10-27 11:30:50 +01:00
Bartosz Taudul
869d75f53e
Extract flame graph level drawing to a separate function. 2024-10-27 11:27:44 +01:00
Bartosz Taudul
a916050724
Add memory discard to C API. 2024-10-21 18:31:49 +02:00
Bartosz Taudul
872367f068
Process memory pool discard events. 2024-10-21 18:22:22 +02:00
Bartosz Taudul
cacd71c401
Add arena allocator test. 2024-10-21 18:22:22 +02:00
Bartosz Taudul
f4df9013bb
Add memory discard message.
This can be used to erase all allocations made within the named memory
pool. The usual use case would be for arena allocators, which allocate
by advancing a pointer and never have to free the memory. There is no
tracking of individual allocations and everything is freed frequently,
by reseting the pointer, for example once per frame.

Since this is used in special-purpose allocators, there is no support
for discarding the memory of the default memory pool.
2024-10-21 18:22:22 +02:00
Bartosz Taudul
3dc68bcb76
Update ImGui to 1.91.4-docking. 2024-10-18 22:58:04 +02:00
Bartosz Taudul
d0a7ee1692
Center elevated privileges warning message. 2024-10-16 00:32:11 +02:00
Bartosz Taudul
60f461d94d
Add debug build note to about window. 2024-10-16 00:28:24 +02:00
Bartosz Taudul
f7e26acfb9
Additional kernel frame check. 2024-10-16 00:22:06 +02:00
Bartosz Taudul
9baf5f403c
Make the check explicit. 2024-10-16 00:21:01 +02:00
Bartosz Taudul
44bb5d474b
Simplify condition. 2024-10-16 00:21:01 +02:00
Bartosz Taudul
c2b4e81493
Display omitted external frame counts. 2024-10-15 02:22:52 +02:00
Bartosz Taudul
27d7939cc1
Improve "no annotations" view. 2024-10-15 02:04:45 +02:00
Bartosz Taudul
1ab0b5abd2
Improve "no wait stacks" view. 2024-10-15 01:51:58 +02:00
Bartosz Taudul
8a7f540d7c
Fill emptiness in find zone window awaiting for query. 2024-10-15 01:29:08 +02:00
Bartosz Taudul
697ea8b3b3
Mark debug builds. 2024-10-14 23:39:54 +02:00
Bartosz Taudul
1bd56a93f0
Don't mix thread order and thread data vectors. 2024-10-13 00:04:10 +02:00
Bartosz Taudul
1bd84419c0
Extend plots to the end of the trace. 2024-10-09 23:55:50 +02:00
Bartosz Taudul
90c072b66c
Update manual. 2024-10-06 15:38:28 +02:00
Bartosz Taudul
096eec1b84
Improve build process documentation. 2024-10-06 15:24:25 +02:00
Bartosz Taudul
9839e4aea7
More unwanted architectures. 2024-10-05 13:04:21 +02:00
Bartosz Taudul
1499da51b8
Add label for local call stack context menu. 2024-10-04 23:49:06 +02:00
Bartosz Taudul
3e41052853
Add context menu to left-click on item in symbol statistics list.
The context menu contains two items:

1. "View symbol", which shows the symbol code / disassembly. This was
   previously available by right-clicking on the source file name.
2. "Sample entry call stacks", which brings up the list window that
   was previously available with left-click on the entry line.

This change intends to make the symbol view easier to discover.
2024-10-04 23:38:02 +02:00
Bartosz Taudul
384646b03b
Disable wrapping of message lines in zone info window.
This unifies the behavior with message list in messages window.
2024-10-04 22:47:25 +02:00
Bartosz Taudul
471ed0ef65
Calculate proper message list size when children messages are excluded. 2024-10-04 22:41:17 +02:00
Bartosz Taudul
8d418760c0
Statistics view also can have no entries to display. 2024-10-04 22:34:40 +02:00
Bartosz Taudul
9ab2f35c08
Fix going to a phantom line when there's no source file available. 2024-10-04 18:01:51 +02:00
Bartosz Taudul
a8c6c5f50e
Disable not needed arch support in capstone. 2024-10-04 17:31:28 +02:00
Bartosz Taudul
5454b3202d
Bump capstone to 6.0.0-Alpha1. 2024-10-04 17:19:18 +02:00
Bartosz Taudul
fd5ee53251
Update ImGui to 1.91.3-docking. 2024-10-04 17:04:47 +02:00
Bartosz Taudul
b46d8db565
Workaround CPM issues with patching non-cached checkouts. 2024-10-04 00:36:29 +02:00
Bartosz Taudul
4497201928
Merge pull request #899 from Jan200101/PR/header-merge
Install header files into one folder
2024-10-02 22:55:31 +02:00
Bartosz Taudul
e0c3efee6c
Merge pull request #898 from Jan200101/PR/arch-cmake-target
Export cmake config into library directory
2024-10-02 22:55:03 +02:00
Jan200101
f45dc88bf8
Install header files into one folder
all headers from one project are best kept in one place
2024-10-02 22:51:01 +02:00
Jan200101
4490f9cb41
Export cmake config into library directory
because the target contains architecture dependent information (for example library path) its best to store it in an architecture dependent path
2024-10-02 22:50:06 +02:00
Bartosz Taudul
13d9ed7e87
Merge pull request #889 from jkriegshauser/fix-long-string-crash
Safe copy to fix issue #888
2024-10-02 22:28:24 +02:00
Joshua Kriegshauser
66edfaec42 More PR feedback 2024-10-02 12:50:12 -07:00
Joshua Kriegshauser
e1554a13e0 PR feedback 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser
9dfb1e98b9 Line and braces tweaks 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser
97a6a3dde7 always override unhandled exception filter 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser
cc860fe56a Reduce template code 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser
201dcb6a8a Tweaks 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser
5213c53bb0 Use SetUnhandledExceptionFilter instead of vectored exceptions 2024-10-02 11:21:34 -07:00
Joshua Kriegshauser
9378718231 Safe copy 2024-10-02 11:21:34 -07:00
Bartosz Taudul
fe6b79082f
Merge pull request #897 from Devaniti/master
Added Custom GPU Context Type
2024-10-02 19:50:20 +02:00
Dmytro Bulatov
34879d6dd3 Bumped protocol version 2024-10-03 02:48:50 +09:00
Dmytro Bulatov
defb91abc1 Added Custom GPU Context Type 2024-10-03 01:55:29 +09:00
Bartosz Taudul
e6eb9899bb
Merge pull request #896 from mcourteaux/master
Correct misleading comment.
2024-09-30 17:07:46 +02:00
Martijn Courteaux
28a229c594 Correct misleading comment. 2024-09-30 16:26:31 +02:00
Bartosz Taudul
9f4d7fa5ad
Draw kernel functions red in flame graph. 2024-09-29 00:31:01 +02:00
Bartosz Taudul
346d8a45c6
Cache flame graph. 2024-09-29 00:26:00 +02:00
Bartosz Taudul
02d60a3dde
Frames already have the correct symbol address. 2024-09-28 23:58:40 +02:00
Bartosz Taudul
d0b6869e9e
Sym must be valid. 2024-09-28 23:35:39 +02:00
Bartosz Taudul
20c4822c98
Parallelize building flame graph. 2024-09-28 17:34:16 +02:00
Bartosz Taudul
da1e92956f
Enable running time calculation for instrumented zones in flame graph. 2024-09-28 16:29:21 +02:00
Bartosz Taudul
21721dd814
Add zone running time UI to flame graph window. 2024-09-28 16:17:42 +02:00
Bartosz Taudul
98a064efa9
Allow inspection of symbol from flame graph. 2024-09-28 15:30:50 +02:00
Bartosz Taudul
5caeffa19a
Proper way to detect mouse click. 2024-09-28 15:30:41 +02:00
Bartosz Taudul
e8a9d228c5
Darken inline items in flame graph. 2024-09-28 15:10:04 +02:00
Bartosz Taudul
2ac51fb597
Yet another color darkening function. 2024-09-28 15:10:04 +02:00
Bartosz Taudul
7465b4ffaf
Add tooltip for sampled items in flame graph. 2024-09-28 15:10:04 +02:00
Bartosz Taudul
8819ea745d
Another stray DPI setting in emscripten. 2024-09-28 14:04:17 +02:00
Bartosz Taudul
2435a76caa
Don't set dpiScale if not doing anything with it. 2024-09-28 14:01:18 +02:00
Bartosz Taudul
9f682c6015
Do not perform DPI setup when DPI might be not yet known.
Reloading fonts is a fairly lenghty operation (~30-50 ms), so avoid doing
it twice in a row.
2024-09-28 13:55:24 +02:00
Bartosz Taudul
44ae59f363
Enforce DPI scale setup on first render frame.
Not all backends know their DPI before window is available.
2024-09-28 13:54:39 +02:00
Bartosz Taudul
04b921e200
Cosmetics. 2024-09-28 13:54:10 +02:00
Bartosz Taudul
290e546f47
Build everything with profiling flags. 2024-09-28 13:38:21 +02:00
Bartosz Taudul
0e6ba23800
Fix columns size in source view files list. 2024-09-28 02:27:45 +02:00
Bartosz Taudul
429de331d6
Show message in find zone window when no zones were collected. 2024-09-28 02:05:30 +02:00
Bartosz Taudul
796f09ef23
Better "no memory data" view in memory window. 2024-09-28 02:00:56 +02:00
Bartosz Taudul
219da446f4
Improve "no messages" view. 2024-09-28 01:56:40 +02:00
Bartosz Taudul
7cb82b9894
Better "load second trace" view in compare window. 2024-09-28 01:53:37 +02:00
Bartosz Taudul
293c76625c
Add centered button function. 2024-09-28 01:53:26 +02:00
Bartosz Taudul
05d00388ed
Better "please wait" view in compare window. 2024-09-28 01:45:08 +02:00
Bartosz Taudul
39ee307409
Improve "please wait" view in find zone window. 2024-09-28 01:42:33 +02:00
Bartosz Taudul
d734aaa357
Improve "no data" screens in statistics window. 2024-09-28 01:39:49 +02:00
Bartosz Taudul
a34b058701
Improve alignment of background tasks circle animation. 2024-09-28 01:30:18 +02:00
Bartosz Taudul
52e0cf38b7
Display message when there's no data for flame graph. 2024-09-28 01:24:59 +02:00
Bartosz Taudul
dfcc5ae37e
Draw time measure in flame graph. 2024-09-28 01:14:46 +02:00
Bartosz Taudul
8740ea710a
Symbol might be unavailable. 2024-09-28 01:09:49 +02:00
Bartosz Taudul
6721db8600
Proper way of enabling libdebuginfod. 2024-09-27 19:59:40 +02:00
Bartosz Taudul
157bf05c50
Setup mailmap. 2024-09-27 16:56:55 +02:00
Bartosz Taudul
2de14f4e38
Patching CPM checkouts is broken without a cache.
https://github.com/cpm-cmake/CPM.cmake/issues/577
2024-09-27 16:12:42 +02:00
Bartosz Taudul
616e7c2eec
Retrieve ImGui with CPM.
ImGui OpenGL loader is patched, and not regenerated, because the gl3w
script requires network connectivity to download the header files from
Khronos at build time.
2024-09-27 15:55:22 +02:00
Bartosz Taudul
1769c2f457
Add imgui opengl loader diff, for reference.
The repo url is https://github.com/dearimgui/gl3w_stripped.
2024-09-27 15:54:14 +02:00
Bartosz Taudul
0e47224578
Universally use add_compile_options(). 2024-09-27 14:10:30 +02:00
Bartosz Taudul
be53a82e78
Another try at fixing macos build. 2024-09-26 16:22:47 +02:00
Bartosz Taudul
bc60621d61
Use svg favicon. 2024-09-26 16:21:16 +02:00
Bartosz Taudul
8f8871454c
Fix macos build, hopefully. 2024-09-26 16:02:47 +02:00
Bartosz Taudul
1c1faeff2d
Replace parallel STL with PPQSort.
PPQSort is supposedly quite fast: https://github.com/GabTux/PPQSort

More importantly, it does not depend on TBB fuckery, so there's no longer
a need to link with an external library that people may or may not have.

The NO_PARALLEL_STL option is out, as it was provided solely to deal with
TBB being not available. Sequential sorting is still used on emscripten.
2024-09-26 14:41:59 +02:00
Bartosz Taudul
d400183483
Replace stray std::sort() with pdqsort_branchless(). 2024-09-26 14:36:56 +02:00
Bartosz Taudul
717605065a
Mark comparators const. 2024-09-26 14:04:20 +02:00
Bartosz Taudul
5b1f3f67c3
Do not include library dependencies in the default target.
We are only interested in outputting the executable program.
2024-09-26 13:04:47 +02:00
Bartosz Taudul
721cf57b28
Remove obsolete library build files. 2024-09-26 12:15:56 +02:00
Bartosz Taudul
9c5c082d83
Provide zstd compressed files. 2024-09-26 00:25:13 +02:00
Bartosz Taudul
684c34dc21
Handle focus in/out on emscripten to fix mouse button stickiness. 2024-09-25 00:36:55 +02:00
Bartosz Taudul
bbbe6ce894
Update NEWS. 2024-09-24 20:12:19 +02:00
Bartosz Taudul
fbd359099b
Document top inline option. 2024-09-24 19:57:21 +02:00
Bartosz Taudul
315864e434
Mark self function in inlines list if top inline is enabled. 2024-09-24 19:47:41 +02:00
Bartosz Taudul
b676406878
Assert on parent name being null. 2024-09-24 19:44:36 +02:00
Bartosz Taudul
aca0f3cad7
Workaround failing assert.
The aggregate inlines code branch can fail when the top inlines option
is enabled, on an assert. This was present in the code before, it's just
that enabling top inlines is equivalent to expanding all the collapsed
symbols, which is not something practical to do.

Workaround by adding a condition instead of the assert. Finding a repro
case would be better to figure out what's exactly happening there, but
we are where we are.
2024-09-24 19:42:35 +02:00
Bartosz Taudul
2d6bcff3a6
Add option to display top cost inlines in symbol statistics list. 2024-09-24 19:42:35 +02:00
Bartosz Taudul
ae2a7c60b8
Calculate inline symbols list earlier. 2024-09-24 19:42:34 +02:00
Bartosz Taudul
9b9a883d07
Fix crash introduced in 605cdcb5. 2024-09-24 17:15:43 +02:00
Bartosz Taudul
f6882e2a5d
Use a proper way to enable compiler diagnostics with color. 2024-09-23 23:11:08 +02:00
Bartosz Taudul
7792b95443
Workaround MSVC mutex fubar. 2024-09-23 23:10:11 +02:00
Bartosz Taudul
19960c0287
Fix invalid memory read when pointers are not 64-bit.
Fixes invalid read on emscripten.
2024-09-22 13:36:15 +02:00
Bartosz Taudul
07a561176c
Remove AnalyzeTemporaryDtors clang-tidy setting.
https://github.com/llvm/llvm-project/issues/62020
2024-09-22 13:11:39 +02:00
Bartosz Taudul
82a0476ad5
Revert "Copying compile_commands.json is no longer needed, apparently."
This reverts commit de2a9fd18ff48d5dad6603a0862d8c6960a6c915.
2024-09-22 13:08:10 +02:00
Bartosz Taudul
86270dac6d
Set unique ID for frame list invisible buttons. 2024-09-22 13:00:30 +02:00
Bartosz Taudul
8b9da2efba
Add support for setting mouse cursor on emscripten. 2024-09-20 23:30:21 +02:00
Bartosz Taudul
207605f93b
Ignore git unsafe directory. 2024-09-20 22:39:05 +02:00
Bartosz Taudul
650e1b9739
Pass github.sha as git rev. 2024-09-20 22:09:30 +02:00
Bartosz Taudul
c3cf13fc64
Allow passing custom git revision to CMake. 2024-09-20 22:08:03 +02:00
Bartosz Taudul
87285cfcaa
Add support for using other rev than HEAD in git-ref.py. 2024-09-20 22:04:25 +02:00
Bartosz Taudul
821f2f907b
Tracy compiles its own freetype. 2024-09-20 21:46:32 +02:00
Bartosz Taudul
a68ef3c27b
Emscripten deployment steps. 2024-09-20 21:40:10 +02:00
Bartosz Taudul
aa451b48bb
Add emscripten build job. 2024-09-20 21:28:32 +02:00
Bartosz Taudul
39497ab77b
Disable scroll-by-page. 2024-09-20 19:50:30 +02:00
Bartosz Taudul
a47a51453c
Update ImGui to 10fe2b67. 2024-09-20 19:48:55 +02:00
Bartosz Taudul
fc303d9594
Don't sort flame graph by default. 2024-09-20 01:29:47 +02:00
Bartosz Taudul
0b5b674e1f
Fix indentation. 2024-09-20 01:02:48 +02:00
Bartosz Taudul
e793f927fc
Add feels-good scaling factor to wheel scroll values. 2024-09-19 21:02:58 +02:00
Bartosz Taudul
4795011b12
Remove debug printf. 2024-09-19 20:58:05 +02:00
Bartosz Taudul
f971faab58
Fix horizontal wheel scroll direction. 2024-09-19 20:53:44 +02:00
Bartosz Taudul
07995f0222
Run two render worker threads on emscripten. 2024-09-19 20:44:42 +02:00
Bartosz Taudul
25899fef73
Disable ImGui debug tools in non-debug builds. 2024-09-19 20:13:37 +02:00
Bartosz Taudul
de2a9fd18f
Copying compile_commands.json is no longer needed, apparently. 2024-09-19 20:13:20 +02:00
Bartosz Taudul
1109e3ce2d
Add html5.h emscripten backend. 2024-09-19 19:56:52 +02:00
Bartosz Taudul
0b72fd8a97
Update ImGui to 1.91.2 + docking. 2024-09-19 18:04:44 +02:00
Bartosz Taudul
00f7beee43
No connections allowed on emscripten. 2024-09-18 19:30:54 +02:00
Bartosz Taudul
20905406da
Don't use obsolete ImGui functionality. 2024-09-18 19:13:26 +02:00
Bartosz Taudul
6ff9869120
Bump ImGui to 1.90.8 + docking. 2024-09-18 19:13:26 +02:00
Bartosz Taudul
0f0f2c6b9b
Compile everything on emscripten with the same set of flags. 2024-09-18 19:13:26 +02:00
Bartosz Taudul
3bb6f1bb68
Adjust link flags for emscripten.
Increase the thread pool to account for background jobs. Increase stack
size, as it was overflowing. Move the pthread flag out of config.cmake.
2024-09-18 19:13:26 +02:00
Bartosz Taudul
3bea3b7725
Disable resolv service on emscripten. 2024-09-18 19:13:25 +02:00
Bartosz Taudul
758080e579
Merge pull request #886 from mcourteaux/master
Fix inheriting color bug.
2024-09-14 18:35:56 +02:00
Martijn Courteaux
0f6002822c Fix inheriting color bug. 2024-09-14 14:10:55 +02:00
Bartosz Taudul
44d1502474
Always keep cursor shape initialized. 2024-09-14 01:15:02 +02:00
Bartosz Taudul
5a67246426
Silence warnings. 2024-09-14 01:10:14 +02:00
Bartosz Taudul
0d17d5eaaa
Remove dead code. 2024-09-14 01:04:03 +02:00
Bartosz Taudul
f387929653
No capture is needed. 2024-09-14 01:03:22 +02:00
Bartosz Taudul
d8f4c8bc7e
Don't perform arithmetic on enum values. 2024-09-14 01:00:19 +02:00
Bartosz Taudul
8a6e525ea9
Get up-to-date wayland-protocols directly from freedesktop. 2024-09-13 22:30:19 +02:00
Bartosz Taudul
b359936c04
Zones can inherit custom colors from parents.
Co-authored-by: Martijn Courteaux <courteauxmartijn@gmail.com>
2024-09-13 22:14:22 +02:00
Bartosz Taudul
8724400884
Merge pull request #882 from slomp/slomp/metal-patch
Patching Apple/Metal back-end Debug issues
2024-09-13 12:15:47 +02:00
Marcos Slomp
7bb59b6784 fixing debugging & scoping issues 2024-09-12 17:24:00 -07:00
Bartosz Taudul
26bf9b60cd
Don't redirect output to debug console in VS Code. 2024-09-12 23:16:15 +02:00
Bartosz Taudul
55da9d1084
Merge pull request #879 from mcourteaux/master
Fix ThreadData-sorting bug.
2024-09-12 18:17:10 +02:00
Bartosz Taudul
d71754298c
Merge pull request #880 from Simple-Robotics/topic/profiler-install-target
[profiler] Add install target
2024-09-11 19:35:09 +02:00
Justin Carpentier
8fc0dcfd48 [profiler] Add install target 2024-09-11 19:11:35 +02:00
Martijn Courteaux
46ec677702 Fix thread-sorting bug. 2024-09-11 10:44:34 +02:00
Bartosz Taudul
b687831394
Add protocol version for 0.11.1. 2024-09-10 20:47:32 +02:00
Bartosz Taudul
5632021003
Add missing GPU context name for Metal. 2024-09-10 19:13:35 +02:00
Bartosz Taudul
1478e74963
Update GPU APIs list in README. 2024-09-10 19:09:25 +02:00
Bartosz Taudul
9a3a6ba3ef
Bump protocol due to Metal adding an enum entry. 2024-09-10 19:08:43 +02:00
Bartosz Taudul
e8ff26e173
Merge pull request #793 from slomp/slomp/metal
Metal (Apple) GPU back-end for Tracy
2024-09-10 19:08:04 +02:00
Marcos Slomp
c168ff6c3c updating documentation 2024-09-09 17:26:33 -07:00
Marcos Slomp
bd061d1d1b removing unsupported macro interfaces 2024-09-09 17:20:19 -07:00
Marcos Slomp
19f376a6c9 fixixng interface macros 2024-09-09 17:08:15 -07:00
Bartosz Taudul
49f0ca5339
Add missing function ptr prototypes. 2024-09-09 21:49:05 +02:00
Bartosz Taudul
d46eebf794
Trim address entry field.
Sometimes a stray whitespace may be inserted in the address field, for
example when copying and pasting from somewhere else.
2024-09-09 20:41:28 +02:00
Bartosz Taudul
5795bc5766
Include git reference in user agent. 2024-09-09 20:27:12 +02:00
Bartosz Taudul
323778e96f
Probe for Wine in HttpRequest. 2024-09-09 20:25:09 +02:00
Bartosz Taudul
48763ef836
Thread selection in flame graph. 2024-09-09 01:31:49 +02:00
Bartosz Taudul
504b9d215e
Sampling mode flame graph. 2024-09-08 23:07:15 +02:00
Bartosz Taudul
ce39032bc5
Update NEWS. 2024-09-08 21:19:47 +02:00
Bartosz Taudul
88f0f6680b
Implement Wayland clipboard paste. 2024-09-08 21:16:21 +02:00
Bartosz Taudul
25ff997548
Implement clipboard copy on Wayland. 2024-09-08 21:16:20 +02:00
Bartosz Taudul
59092bef72
Create data device for a seat. 2024-09-08 19:20:16 +02:00
Bartosz Taudul
bec8973265
Bind data device manager. 2024-09-08 18:29:02 +02:00
Bartosz Taudul
d4f6537b95
Cosmetics. 2024-09-08 18:28:56 +02:00
Bartosz Taudul
f1bfbb9821
Allow easy retrieval of git ref from the about dialog. 2024-09-08 17:47:46 +02:00
Bartosz Taudul
45b9aff761
Display counts of selectable items, if some are unselected. 2024-09-08 17:44:42 +02:00
Bartosz Taudul
8b8ff9363d
Cache last source location entry.
227 ms -> 138 ms
2024-09-08 17:01:50 +02:00
Bartosz Taudul
0c0e4f554f
Do a linear search instead of using a map.
513 ms -> 227 ms for a trace with 66 unique source locations and 179 million
zones.
2024-09-08 16:10:39 +02:00
Bartosz Taudul
d67598f0fe
Hide advanced options in trace save dialog.
The default settings are good enough.
2024-09-08 15:54:42 +02:00
Bartosz Taudul
0d8b2b6252
Adapt frame graph tooltip to look more like zone tooltip. 2024-09-08 15:41:44 +02:00
Bartosz Taudul
97cf0bd11f
Bump freetype to 2.13.3. 2024-09-08 15:33:36 +02:00
Bartosz Taudul
c783a48bae
Always include CMake binary dir in include path. 2024-09-08 14:52:57 +02:00
Bartosz Taudul
1950040461
Print git ref in the about dialog. 2024-09-08 14:23:05 +02:00
Bartosz Taudul
5934f5da9a
Generate git revision to a header file. 2024-09-08 14:18:52 +02:00
Bartosz Taudul
959f0de7e5
Open find zone from flame graph. 2024-09-08 13:48:22 +02:00
Bartosz Taudul
6080b8742a
Fix memory leak. 2024-09-08 13:39:40 +02:00
Bartosz Taudul
4afc0960fb
Add flame graph tooltip. 2024-09-08 13:20:37 +02:00
Bartosz Taudul
d8849af800
Drawing the flame graph. 2024-09-08 13:11:24 +02:00
Bartosz Taudul
e4ec798762
Basic flame graph window layout. 2024-09-08 12:33:11 +02:00
Bartosz Taudul
5b75954c5b
Flame graph builder. 2024-09-08 12:33:11 +02:00
Bartosz Taudul
692fcc225f
Add flame graph window. 2024-09-08 12:33:09 +02:00
Bartosz Taudul
11777e8136
Check if core_id and die_id exist. 2024-09-07 23:53:57 +02:00
Bartosz Taudul
ea4de3be36
Detect and report if running under Wine. 2024-09-07 22:09:00 +02:00
Bartosz Taudul
64f2008cc1
Disable transparency on collapsed windows title bars. 2024-09-07 18:03:38 +02:00
Bartosz Taudul
e393ade59d
Shorten menu bar button names. 2024-09-07 18:00:59 +02:00
Marcos Slomp
0ffa0be4fd addressing code review comments 2024-09-03 11:15:39 -07:00
Bartosz Taudul
8e3d250654
Check for errors from GetLogicalProcessorInformationEx(). 2024-08-31 11:36:59 +02:00
Marcos Slomp
fe51f02a25 cleanup and comments 2024-08-26 08:15:47 -07:00
Marcos Slomp
aa85824455 comments about the decisions and behavior of the Metal back-end 2024-08-26 08:15:47 -07:00
Marcos Slomp
799360dfb8 Collect pending timestamps during shutdown 2024-08-26 08:15:47 -07:00
Marcos Slomp
ea65b145c6 adding wiretap for debugging purposes 2024-08-26 08:15:47 -07:00
Marcos Slomp
06b23cc293 more cleanup 2024-08-26 08:15:47 -07:00
Marcos Slomp
5ec7565852 cleanup 2024-08-26 08:15:47 -07:00
Marcos Slomp
638fa1f06c blarg3 2024-08-26 08:15:47 -07:00
Marcos Slomp
cef49c2269 blarg again... 2024-08-26 08:15:47 -07:00
Marcos Slomp
5f09d454be blargh 2024-08-26 08:15:47 -07:00
Marcos Slomp
91ca0f2f89 improved panic macro (supports print args) 2024-08-26 08:15:47 -07:00
Marcos Slomp
04cf494d9c bugfixes 2024-08-26 08:15:47 -07:00
Marcos Slomp
b11e66594d debugging 2024-08-26 08:15:47 -07:00
Marcos Slomp
ad2c2efacd fixing collect wrap-around 2024-08-26 08:15:47 -07:00
Marcos Slomp
a9538799da more debugging 2024-08-26 08:15:47 -07:00
Marcos Slomp
c374440379 adding blit pass and render pass interfaces 2024-08-26 08:15:47 -07:00
Marcos Slomp
c6cc424991 collecting/resolving timestamps in pairs 2024-08-26 08:15:47 -07:00
Marcos Slomp
6d04913b4a stale comments 2024-08-26 08:15:47 -07:00
Marcos Slomp
3d69c485be fixing timestamp mapping range 2024-08-26 08:15:47 -07:00
Marcos Slomp
94407dbd1f giving up on calibration, for now 2024-08-26 08:15:47 -07:00
Marcos Slomp
fd1e60e2fd fixing cpu timestamp baseline 2024-08-26 08:15:47 -07:00
Marcos Slomp
4b695cc3dd debugging timestamps... 2024-08-26 08:15:47 -07:00
Marcos Slomp
47180dbf7f basing metal zone scopes on MTLComputePassDescriptor 2024-08-26 08:15:47 -07:00
Marcos Slomp
1dfc926eb8 Metal back-end WIP 2024-08-26 08:15:47 -07:00
Bartosz Taudul
e26c34346b
libbacktrace: support FDPIC (1dd5c40) 2024-08-24 18:15:52 +02:00
Bartosz Taudul
0d0e56dca3
libbacktrace: avoid infinite recursion (febbb9b) 2024-08-24 18:02:05 +02:00
Bartosz Taudul
12c8592325
libbacktrace: fix UBSAN issues (5aa9254) 2024-08-24 18:01:10 +02:00
Bartosz Taudul
ef21f5867e
libbacktrace: correctly gather Mach-O symbol table (3fda5a8) 2024-08-24 17:57:43 +02:00
Bartosz Taudul
ba79deddf6
libbacktrace: it's OK if zstd decompressor sees no backward bits (4ead348) 2024-08-24 17:55:41 +02:00
Bartosz Taudul
8f3b312b7c
Get CPU die information on windows. 2024-08-24 17:47:00 +02:00
Bartosz Taudul
f7b810a3d1
Mark hyperthread jumps. 2024-08-24 16:52:04 +02:00
Bartosz Taudul
be92ae787c
Add tooltips for thread jumps. 2024-08-24 16:50:02 +02:00
Bartosz Taudul
50bb383667
Display CPU topology data in zone wait regions list. 2024-08-24 16:47:55 +02:00
Bartosz Taudul
844bc1e416
Display die jumps in wait regions list. 2024-08-24 16:37:04 +02:00
Bartosz Taudul
46e979e185
Display die information on CPU data graph. 2024-08-24 16:36:29 +02:00
Bartosz Taudul
2716311f51
Store die number in CpuThreadTopology. 2024-08-24 16:36:04 +02:00
Bartosz Taudul
357b557684
Add die to CPU topology data structures.
Drawing dies on the topology chart is a minimal effort for the time being.
An improved version will be added later on.
2024-08-22 20:26:11 +02:00
Bartosz Taudul
e947aeb72d
Read CPU die information on Linux. 2024-08-22 20:26:09 +02:00
Bartosz Taudul
5d542dc09f
Release 0.11.1. 2024-08-22 20:07:25 +02:00
Bartosz Taudul
8893c2bc0f
Update NEWS. 2024-08-22 19:54:53 +02:00
Bartosz Taudul
353545a1e9
Add die to topology data. 2024-08-22 00:58:01 +02:00
Bartosz Taudul
fb617fe998
Zero-initialize CPU topology data structure. 2024-08-22 00:54:12 +02:00
Bartosz Taudul
dc4aa7a126
Merge pull request #866 from Minres/master
adds target export to allow use in projects using exports
2024-08-21 23:09:07 +02:00
Eyck Jentzsch
c8dbace72e adds transient zone with name and color 2024-08-21 22:55:02 +02:00
Eyck Jentzsch
f5bc9a9ae8 adds target export to allow use in projects using exports 2024-08-21 22:46:15 +02:00
Bartosz Taudul
b6eb08befe
Use algorithmic and vectorizable BC1 index fixup. 2024-08-21 22:23:16 +02:00
Bartosz Taudul
5c1cc80897
Bump capstone to 5.0.3. 2024-08-21 19:22:58 +02:00
Bartosz Taudul
0c6803e5c6
Merge pull request #859 from brakhane/lua-fix
Lua: ensure source location is not longer than 255 characters
2024-08-10 14:49:12 +02:00
Dennis Brakhane
81d7e9d765 only use first 255 characters of source location
When a Lua script was loaded through loadstring, dbg.source is the whole
source code; this not only causes a lot of unnecessary data to be sent,
it can even crash Tracy if the source string is larger than 64 KB.

Therefore, use the short version which is never more than 255 characters.
2024-08-10 14:47:04 +02:00
Bartosz Taudul
a51f0d0657
Merge pull request #858 from PatrickMoffett/master
Remove constexpr from GetSamplingInterval
2024-08-09 11:51:52 +02:00
Patrick Moffett
b2ee226fd7 remove constexpr from GetSamplingInterval 2024-08-08 22:22:52 -07:00
Bartosz Taudul
ee65a45bef
Vararg functions can't be inlined. 2024-08-08 19:55:32 +02:00
Bartosz Taudul
b18796c1c0
Add text formatting function to test. 2024-08-08 19:52:47 +02:00
Bartosz Taudul
30cbc77e23
Update CPM to 0.40.2. 2024-08-08 19:42:15 +02:00
Bartosz Taudul
60042d1944
Print context switch event data. 2024-08-06 20:37:51 +02:00
Bartosz Taudul
f7730659f8
Update manual. 2024-08-04 00:15:46 +02:00
Bartosz Taudul
835ba9fddf
Pass fiber group hint to NewThread(). 2024-08-04 00:10:45 +02:00
Bartosz Taudul
37bfde5106
Add fiber enter API with group hint. 2024-08-04 00:08:18 +02:00
Bartosz Taudul
46852a7066
Update NEWS. 2024-08-03 20:40:59 +02:00
Bartosz Taudul
ecb05f787e
Document thread group hints. 2024-08-03 20:33:43 +02:00
Bartosz Taudul
0b74b14f88
Save thread group hint. 2024-08-03 20:23:26 +02:00
Bartosz Taudul
a1064a3d26
Observe thread grouping hint when a new thread appears. 2024-08-03 20:18:40 +02:00
Bartosz Taudul
1390c8c9e3
Take group hint into account when sorting threads. 2024-08-03 20:11:55 +02:00
Bartosz Taudul
dbf6274bff
Remove threads that had group hint changed from thread order list. 2024-08-03 20:11:35 +02:00
Bartosz Taudul
bdacfe7c37
Add a list of pending thread hints. 2024-08-03 20:10:36 +02:00
Bartosz Taudul
28a9750f8a
Process thread group hints. 2024-08-03 20:10:36 +02:00
Bartosz Taudul
9a9f1c2ab9
Set plot thread group hint to -1 in the test application. 2024-08-03 19:41:44 +02:00
Bartosz Taudul
8cea63cbca
Send thread group hint message. 2024-08-03 19:40:49 +02:00
Bartosz Taudul
beb42a3d29
Change group hint from unsigned to signed. 2024-08-03 19:40:11 +02:00
Bartosz Taudul
70a468e160
Protocol version 66 was used by 0.11.0. 2024-08-03 19:36:56 +02:00
Bartosz Taudul
5e224101c4
Allow direct access to ThreadNameData. 2024-08-03 19:33:19 +02:00
Bartosz Taudul
3658c0c90f
Add thread group hint to ThreadNameData. 2024-08-03 19:15:01 +02:00
Bartosz Taudul
fb18a81d79
Add support for reading TRACY_SAMPLING_HZ from an env variable. 2024-07-30 18:42:05 +02:00
Bartosz Taudul
ffb98a9724
Merge pull request #848 from tksuoran/msys2_clang64_link_fix
Fix for #847
2024-07-26 12:36:10 +02:00
Timo Suoranta
0aa025c0d9 Fix for #847 2024-07-26 11:24:20 +03:00
Bartosz Taudul
684cee59ab
Merge pull request #841 from aluaces/pr-find-libunwind
Find libunwind if requested so we can link to it.
2024-07-23 13:13:18 +02:00
Alberto Luaces
d9a182b450 Find libunwind if requested so we can link to it. 2024-07-23 12:15:36 +02:00
Bartosz Taudul
751545ebbd
Merge pull request #839 from Arpafaucon/cmake-add-verbose
Expose `TRACY_VERBOSE` in cmake for debug
2024-07-21 17:39:02 +02:00
Grégoire Roussel
c9063fbdbe Expose TRACY_VERBOSE in cmake for debug 2024-07-21 17:37:57 +02:00
Grégoire Roussel
20d67a1bc8
tentative clang-format 2024-07-19 18:17:22 +02:00
Bartosz Taudul
f81e089260
Merge pull request #836 from Techatrix/fix-windows-clang
fix CpuId when compiling with clang on windows
2024-07-19 11:03:05 +02:00
Techatrix
90adf00dc1 fix CpuId when compiling with clang on windows 2024-07-19 01:47:46 +02:00
Bartosz Taudul
93b4ea2ace
Merge pull request #826 from Arpafaucon/merge-import-utilities
Suggestion: Merge import-xxx folders
2024-07-18 21:59:46 +02:00
Bartosz Taudul
5098fc2a70
No mold on emscripten. 2024-07-17 22:54:18 +02:00
Bartosz Taudul
68357bd9fb
Merge pull request #834 from Aldarrion/fix-achievement-init-order-crash
Fix achievement mgr crashing on uninitialized data
2024-07-17 22:14:47 +02:00
Pavel Šmejkal
893754638c Fix achievement mgr crashing on uninitialized data
Both the achievement manager and the achievement data were globals in
separate compilation units. Order of initialization is not defined in
that case which sometimes caused the mgr to load uninitialized data and
crash when an achievement should have been achieved but was not found.
2024-07-17 21:57:16 +02:00
Bartosz Taudul
5634c1520e
Merge pull request #833 from Arpafaucon/trigger-failures-in-test
[test] Trigger failures via USR1/USR2
2024-07-17 19:57:31 +02:00
Grégoire Roussel
7a74d38198 (review) use signal.h 2024-07-17 18:19:33 +02:00
Bartosz Taudul
a636950eb5
Fix wrong printf. 2024-07-17 17:55:19 +02:00
Grégoire Roussel
82fd4075f9 [test] Trigger failures via USR1/USR2
USR1: abort the program
USR2: send buggy free event, to trigger an instrumentation failure
2024-07-17 17:30:52 +02:00
Bartosz Taudul
c9e57901ed
Merge pull request #832 from Chekov2k/manual
Add missing make line to python instructions
2024-07-17 12:59:29 +02:00
Arnim Balzer
34d40a5ecf
Add missing make line to python instructions 2024-07-17 11:55:14 +01:00
Bartosz Taudul
22a0898a54
Merge pull request #831 from Chekov2k/llvm
Set CXX standard for older compilers
2024-07-17 12:27:17 +02:00
Arnim Balzer
a8704b4a07
Set CXX standard for older compilers 2024-07-17 11:06:20 +01:00
Bartosz Taudul
c0f93b1c9c
Merge pull request #830 from Chekov2k/python_libs
Link against Python libraries for compatibility with pybind11 >= v2.13
2024-07-17 10:55:49 +02:00
Arnim Balzer
3274fd4c5e
Link against Python libraries for compatibility with pybind11 >= v2.13 2024-07-17 07:18:07 +01:00
Bartosz Taudul
075395620a
Release 0.11.0. 2024-07-16 18:38:15 +02:00
Grégoire Roussel
9a88b8ff4b Merge import-* folders 2024-07-12 22:56:09 +02:00
Bartosz Taudul
521e371c60
Ignore CMake build directories. 2024-07-12 17:13:16 +02:00
Bartosz Taudul
1458a6ab23
Don't assert on a workarounded bad case. 2024-07-11 20:45:14 +02:00
Bartosz Taudul
ec455c8ee6
Add frame images achievement. 2024-07-08 19:46:01 +02:00
Bartosz Taudul
69c50cb6cb
Add frame instrumentation achievement. 2024-07-08 19:30:27 +02:00
Bartosz Taudul
e4cda51bf6
Unlock new top-level achievements in already unlocked categories. 2024-07-08 19:26:27 +02:00
Bartosz Taudul
1a7eefc6af
Add find zones achievement. 2024-07-08 19:11:58 +02:00
Bartosz Taudul
6f17cf1869
Use double quotes in achievements texts. 2024-07-08 18:52:20 +02:00
Bartosz Taudul
5b7b4a6889
Update NEWS. 2024-07-08 18:47:08 +02:00
Bartosz Taudul
c383e7ae25
Add EnsureReadable() implementation for Windows. 2024-07-08 18:42:17 +02:00
Bartosz Taudul
6d1deb5640
Merge pull request #824 from Arpafaucon/cmake-config-test
[IDE] migrate `test` folder to CMake configuration
2024-07-03 20:35:26 +02:00
Grégoire Roussel
bad4a4eda0 debuginfod enabled by default 2024-07-03 14:10:40 +02:00
Grégoire Roussel
9cf61d6597 [build-system] Migrate test/ directory to CMakeLists
- remove MakeFile, replaced with equivalent CMakeLists.txt
- add advanced option TRACY_DEMANGLE in client for CI testing
2024-07-03 14:05:49 +02:00
Bartosz Taudul
9688152505
Add dynamic colors, force colors, shorten name to global options. 2024-06-30 20:13:11 +02:00
Bartosz Taudul
f8023ba698
Setup config before loading user data state that may want to overwrite it. 2024-06-30 20:12:08 +02:00
Bartosz Taudul
3c34d9d096
Remove redundancy. 2024-06-30 20:11:50 +02:00
Bartosz Taudul
938ab3b8ea
Move config setup to a separate function. 2024-06-30 20:11:25 +02:00
Bartosz Taudul
4a933d0174
Merge pull request #821 from eltociear/patch-1
libbacktrace: update elf.cpp
2024-06-30 19:23:31 +02:00
Ikko Eltociear Ashimine
dfbf0652f2
libbacktrace: update elf.cpp
previouly -> previously
2024-07-01 02:20:56 +09:00
Bartosz Taudul
d4a4b62396
Merge pull request #817 from M4T1A5/fix/worker_add_source_loc
Fix worker AddSourceLocationPayload source file string length calculation
2024-06-19 19:02:43 +02:00
Matias Kangasjärvelä
4bbe973e3a Fix source location payload source file string length calculation 2024-06-19 19:47:56 +03:00
Bartosz Taudul
be40c1e38e
Use strlen instead of pointer walking in the rest of places. 2024-06-16 18:20:16 +02:00
Bartosz Taudul
9f0f3a7218
Save achievements data after each completion. 2024-06-16 12:53:40 +02:00
Bartosz Taudul
50f5345ea5
Add a help marker for the target FPS setting. 2024-06-16 12:52:17 +02:00
Bartosz Taudul
959ab53529
Add global settings achievement. 2024-06-16 12:45:11 +02:00
Bartosz Taudul
915a138150
Add 100 million zones achievement. 2024-06-16 12:39:26 +02:00
Bartosz Taudul
c5c0fceda4
Add instrumentation statistics achievement. 2024-06-14 18:25:50 +02:00
Bartosz Taudul
f04d844515
Use strlen to calculate end of string in ShortenZoneName(). 2024-06-12 23:54:25 +02:00
Bartosz Taudul
3589b46fab
Don't try to shorten zone names starting with '['. 2024-06-12 23:33:45 +02:00
Bartosz Taudul
2edd23f5a0
More verbose achievement names. 2024-06-10 22:53:37 +02:00
Bartosz Taudul
72cf230228
Add sampling achievement check. 2024-06-10 22:52:03 +02:00
Bartosz Taudul
3cb7fd8a5e
More efficient way to check if there are zones. 2024-06-10 22:51:53 +02:00
Bartosz Taudul
65576a294e
Add sampling achievements category. 2024-06-10 22:44:20 +02:00
Bartosz Taudul
739b6260d6
Update NEWS. 2024-06-08 13:46:16 +02:00
Bartosz Taudul
fc08f09b94
Switch the achievement category to show the selected achievement. 2024-06-08 13:44:23 +02:00
Bartosz Taudul
51ee66323b
Add category getter for an achievement item. 2024-06-08 13:44:11 +02:00
Bartosz Taudul
b38ac8bfef
Hook up instrumentation intro achievement. 2024-06-08 13:31:23 +02:00
Bartosz Taudul
7dbb3c592f
Fine-tune achievements window size. 2024-06-08 13:20:09 +02:00
Bartosz Taudul
03e9c89dd8
Finish instrumentation intro achievement description. 2024-06-08 13:20:09 +02:00
Bartosz Taudul
e09379bd16
Add source code printer helper. 2024-06-08 13:10:31 +02:00
Bartosz Taudul
ef1c8e8512
Allow parsing arbitrary source code fragments. 2024-06-08 13:10:30 +02:00
Bartosz Taudul
16bc01551e
Mark categories that need attention. 2024-06-08 12:45:19 +02:00
Bartosz Taudul
a6b9369430
Allow checking if achievement category needs attention. 2024-06-08 12:45:01 +02:00
Bartosz Taudul
7401a72ccf
Process unlock list, unlock achievement categories. 2024-06-08 12:35:46 +02:00
Bartosz Taudul
fde874eedf
Introduce unlocks list, hook things up.
Unlocks should only be used for achievements that are not already in the
items lists.
2024-06-08 12:34:02 +02:00
Bartosz Taudul
9d7222eb4a
Add unfinished instrumentation achievement and category. 2024-06-08 12:33:37 +02:00
Bartosz Taudul
6cc772e71e
Unlock any eligible new achievements that may have been added. 2024-06-08 11:55:55 +02:00
Bartosz Taudul
1247f365d0
Improve some achievement descriptions. 2024-06-08 11:55:46 +02:00
Bartosz Taudul
a8e427fc7f
Locked achievements can't be done. 2024-06-08 11:44:30 +02:00
Bartosz Taudul
d9fe3ed9a6
Add CMake option to not use parallel STL. 2024-06-08 00:20:12 +02:00
Bartosz Taudul
a3b63bb468
Save / load state of achievements. 2024-06-07 23:53:27 +02:00
Bartosz Taudul
3f2d28407b
Animate achievements star button when attention is needed. 2024-06-07 23:53:27 +02:00
Bartosz Taudul
ba154e02db
Allow checking if achievements need attention. 2024-06-07 23:53:27 +02:00
Bartosz Taudul
139dc44a00
Hook up save / load trace achievements. 2024-06-07 23:53:26 +02:00
Bartosz Taudul
d474f21576
Add a check for being connected to "connect to client" achievement. 2024-06-07 23:53:26 +02:00
Bartosz Taudul
efdd28f7bb
Add achievement for connecting to a client. 2024-06-07 23:53:26 +02:00
Bartosz Taudul
6aa9401b95
Add achievement wrapper function to TracyView. 2024-06-07 23:53:26 +02:00
Bartosz Taudul
aff60a6a36
Mark the initial achievement as achieved on startup. 2024-06-07 23:53:26 +02:00
Bartosz Taudul
cddab58b0d
Add achievements processing logic. 2024-06-07 23:53:26 +02:00
Bartosz Taudul
d2e995478e
Add initial achievements data. 2024-06-07 23:53:26 +02:00
Bartosz Taudul
b5fda4f456
Add achievement data structure definitions. 2024-06-07 23:53:25 +02:00
Bartosz Taudul
02ad97ff3f
Disable achievements UI on emscripten. 2024-06-07 23:53:25 +02:00
Bartosz Taudul
2e2e6257d7
Show/hide achievements list window. 2024-06-07 23:53:25 +02:00
Bartosz Taudul
bf0226fb64
Update screen only when achievements notification is animating.
The NeedsUpdate() method will be useful in future.
2024-06-07 23:53:25 +02:00
Bartosz Taudul
3886111e70
Add achievements notification. 2024-06-07 23:53:25 +02:00
Bartosz Taudul
8051ceaa43
Add a basic achievements manager. 2024-06-07 23:53:25 +02:00
Bartosz Taudul
f6f8fb3d27
Set dark background. 2024-06-07 23:53:25 +02:00
Bartosz Taudul
2cea5706d5
Add initial achievements popup. 2024-06-07 23:53:25 +02:00
Bartosz Taudul
5e211fb581
Merge pull request #812 from mcourteaux/master
Two minor fixes.
2024-06-07 13:32:49 +02:00
Martijn Courteaux
5d52427f4a Two minor fixes. 2024-06-07 11:36:47 +02:00
Bartosz Taudul
a17c218351
Merge pull request #809 from Ravbug/master
TracyClient Windows for ARM support
2024-06-05 11:16:20 +02:00
Ravbug
5454f7564c Windows for ARM support 2024-06-04 17:21:24 -07:00
Bartosz Taudul
8d67c79431
Add self-profiling option. 2024-06-04 02:22:35 +02:00
Bartosz Taudul
abf12f79c5
Set the default save config also in tracy-update. 2024-06-02 17:29:21 +02:00
Bartosz Taudul
0a187a65f6
Update manual. 2024-06-02 17:05:00 +02:00
Bartosz Taudul
870959e93f
Update NEWS. 2024-06-02 16:09:42 +02:00
Bartosz Taudul
3a186887ed
Added compression streams to save trace UI. 2024-06-02 15:52:37 +02:00
Bartosz Taudul
455738a266
Default to zstd level 3 with 4 streams in tracy-capture. 2024-06-02 15:35:07 +02:00
Bartosz Taudul
277ec25a8d
Spin when waiting for decompressed data instead of using lock + cv. 2024-06-02 15:06:16 +02:00
Bartosz Taudul
ce240ddfc1
Loading multi-stream data. 2024-06-02 14:32:33 +02:00
Bartosz Taudul
bb1e717026
Update magic string to look for in tracy files. 2024-06-02 14:32:33 +02:00
Bartosz Taudul
048ff8213a
Support loading single-stream new format traces. 2024-06-02 14:32:32 +02:00
Bartosz Taudul
eb1cbb454a
Move common file buffer sizes to a separate header. 2024-06-02 14:32:32 +02:00
Bartosz Taudul
095df5f416
Expose streams in tracy-update. 2024-06-02 14:32:32 +02:00
Bartosz Taudul
3bf4a674bc
Use multiple compression streams when writing trace files. 2024-06-02 14:32:32 +02:00
Bartosz Taudul
9c3a4e5762
Separate compression from writing data to file. 2024-05-31 20:29:57 +02:00
Bartosz Taudul
9dea830f98
Move file compression enum out of FileWrite. 2024-05-31 19:24:32 +02:00
Bartosz Taudul
07c6e12dbf
Measure load and save time separately in tracy-update. 2024-05-31 17:43:13 +02:00
Bartosz Taudul
0d5bd53be3
Update imgui to 1.90.7-docking. 2024-05-31 17:31:26 +02:00
Bartosz Taudul
982d6ddcdc
Update zstd to 1.5.6. 2024-05-31 17:31:21 +02:00
Bartosz Taudul
4db02dd041
Merge pull request #806 from slomp/slomp/d3d11-on-demand-fix
fix TracyD3D11 "on demand"
2024-05-31 16:18:36 +02:00
Marcos Slomp
eba17d0fd8
fix TracyD3D11 "on demand" 2024-05-31 07:11:10 -07:00
Bartosz Taudul
026a34a0fc
Merge pull request #804 from AWoloszyn/fix-gpu-src-assert
Fix for assert in GetGpuSourceLocationZonesCntReal
2024-05-30 20:56:27 +02:00
Andrew Woloszyn
0c7cbd1d03 Fix for assert in GetGpuSourceLocationZonesCntReal
When TRACY_NO_STATISTICS is defined, the assert in
GetGpuSourceLocationZonesCntReal will always get hit
as nothing is ever inserted in gpuSourceLocationZonesCnt
unless reading from a file.

Match the behavior with GetGpuSourceLocationZonesReal
to add the source location if it is missing.
2024-05-30 14:26:20 -04:00
Bartosz Taudul
15145aa74c
Fix Gitea actions. 2024-05-30 14:41:22 +02:00
Bartosz Taudul
207e065ffe
Protect against empty program name. 2024-05-30 13:59:30 +02:00
Bartosz Taudul
608ff35c8c
Merge pull request #801 from kubouch/patch-1
Fix wrong parameter in TracyCLContextName
2024-05-29 17:43:58 +02:00
Jakub Žádník
da9b9f8e79
Fix wrong parameter in TracyCLContextName
The macro accepted a `context` parameter, but its expansion used `ctx`.

`context` is renamed to `ctx` in `TracyCLContext` for consistency.
2024-05-29 16:22:21 +03:00
Bartosz Taudul
cbea6d7852
Fix 32-bit builds. 2024-05-28 20:51:16 +02:00
Bartosz Taudul
aae58fbc3a
Update NEWS. 2024-05-26 20:49:43 +02:00
Bartosz Taudul
1ff73edd20
Add linux kernel symbol code retrieval. 2024-05-26 20:49:43 +02:00
Bartosz Taudul
f8524f8bcd
Merge pull request #799 from heyallnorahere/fix-vulkan-timestamps
Fix vkCmdWriteTimestamp overwrite issues
2024-05-25 22:57:43 +02:00
heyallnorahere
7fa2c6cfd2 add availability flag to vkGetQueryPoolResults (vulkan profiler) 2024-05-25 20:02:57 +00:00
Bartosz Taudul
82aecbdb31
Calculate size of kernel code sections. 2024-05-25 17:18:41 +02:00
Bartosz Taudul
64aad9e751
Load all kernel symbols, mark non-code sections with null name. 2024-05-25 17:18:41 +02:00
Bartosz Taudul
d5064aa8ea
Try to prevent reallocs when building kernel symbols table.
% wc -l /proc/kallsyms
419362 /proc/kallsyms
2024-05-25 17:18:41 +02:00
Bartosz Taudul
56b4424399
Be consistent with how statistics shows inline counts. 2024-05-25 13:03:32 +02:00
Bartosz Taudul
0333b9f591
Hide "propagate inlines" checkbox if there are no inlined functions. 2024-05-25 12:54:12 +02:00
Bartosz Taudul
071d440955
Show number of inlined functions in a symbol. 2024-05-25 12:51:17 +02:00
Bartosz Taudul
f0d3eb1dfe
Right-align image name + base address in symbol view. 2024-05-25 12:38:28 +02:00
Bartosz Taudul
17b4e83ed0
Update NEWS. 2024-05-25 12:17:04 +02:00
Bartosz Taudul
55b29ff20b
Cleanup. 2024-05-25 00:16:29 +02:00
Bartosz Taudul
6e14d1ff45
Add summary printer for robin hood. 2024-05-25 00:03:23 +02:00
Bartosz Taudul
535a2c8504
Add pretty-printer for ZoneEvent. 2024-05-24 23:45:16 +02:00
Bartosz Taudul
d3da7dcecd
Fix out-of-bounds access on non-continuous frames. 2024-05-24 22:52:46 +02:00
Bartosz Taudul
005d092903
Don't set debug flags in non-debug builds (to shut up the compiler). 2024-05-24 01:16:06 +02:00
Bartosz Taudul
c5e64a182c
Do not "eliminate unused debug types". It's broken. 2024-05-24 01:07:02 +02:00
Bartosz Taudul
b405370af9
Add lldb pretty printers for ShortPtr, Vector, Int24, Int48. 2024-05-23 23:32:10 +02:00
Bartosz Taudul
afe5c8dfbe
Don't try to create FrameData in ProcessFrameMarkEnd(). 2024-05-23 19:48:33 +02:00
Bartosz Taudul
216a4b7663
Support Create() not creating an item. 2024-05-23 19:47:40 +02:00
Bartosz Taudul
cf23441116
Cosmetics. 2024-05-21 20:18:54 +02:00
Bartosz Taudul
60ae46a373
Merge pull request #796 from mcourteaux/master
Fix savings calculation.
2024-05-21 20:14:42 +02:00
Martijn Courteaux
bd00c6a4ee Improve time comparing display with better colors. 2024-05-21 19:47:19 +02:00
Martijn Courteaux
abdbaed737 Simplify time comparing display. 2024-05-21 19:32:43 +02:00
Martijn Courteaux
86717de6e1 Improve time comparing display. 2024-05-21 19:24:04 +02:00
Martijn Courteaux
ec7fc9ffb6 Cleanup 2024-05-21 19:08:54 +02:00
Martijn Courteaux
717e545158 Improve time comparing display. 2024-05-21 19:08:16 +02:00
Martijn Courteaux
f704c57f98 Clearer and more detailed comparison in terms of slow down or speed up of times when comparing traces. 2024-05-21 17:10:48 +02:00
Martijn Courteaux
73f09de29d Fix savings calculation. 2024-05-21 15:25:23 +02:00
Bartosz Taudul
8983e14e18
Merge pull request #794 from M4T1A5/cmake-multiprocess-compilation
Server CMake: Enable multi-processor compilation in Visual Studio projects
2024-05-18 14:24:37 +02:00
Matias Kangasjärvelä
63da2886d1 Enable multi-processor compilation in Visual Studio projects 2024-05-18 15:01:43 +03:00
Bartosz Taudul
813f4243db
Restrict using mold linker to clang. 2024-05-12 19:44:58 +02:00
Bartosz Taudul
1a971d867d
Fix dtl. 2024-05-12 19:23:18 +02:00
Bartosz Taudul
4b14d961f0
Add LLDB summary for Vector. 2024-05-12 19:23:18 +02:00
Bartosz Taudul
11eee619fb
Merge pull request #786 from mcourteaux/plot-height
Support adjusting plot height.
2024-05-08 11:57:54 +02:00
Martijn Courteaux
b879f5b519 Save plot height view data. 2024-05-08 10:43:14 +02:00
Martijn Courteaux
da8c2340b3 Support adjusting plot height. 2024-05-07 13:33:57 +02:00
Bartosz Taudul
dcb383701a
Update manual. 2024-05-06 20:19:46 +02:00
Bartosz Taudul
f4d27a4ea4
Update NEWS. 2024-05-06 20:18:41 +02:00
Bartosz Taudul
839cf6ef91
Add thread sorting. 2024-05-06 20:18:13 +02:00
Bartosz Taudul
d6b059f0cc
Download up-to-date glfw and freetype. 2024-05-06 00:07:56 +02:00
Bartosz Taudul
e8c3cb1909
Update manual. 2024-05-05 21:39:18 +02:00
Bartosz Taudul
4f1c4c98ac
Update NEWS. 2024-05-05 21:23:41 +02:00
Bartosz Taudul
5730884678
Print memory limit in capture utility, if appropriate. 2024-05-05 21:21:19 +02:00
Bartosz Taudul
c31bf6f7f8
Add blue ANSI color macro. 2024-05-05 21:21:19 +02:00
Bartosz Taudul
ee56e1fcd5
Allow setting memory limit in capture utility. 2024-05-05 21:21:19 +02:00
Bartosz Taudul
6748d11a2f
Fix capture utility. 2024-05-05 21:12:50 +02:00
Bartosz Taudul
68473381b9
Indicate that memory limit was hit with notification triangle color. 2024-05-05 21:07:50 +02:00
Bartosz Taudul
89f1fb4825
Terminate connection when memory limit is exceeded. 2024-05-05 21:04:26 +02:00
Bartosz Taudul
b64389ba15
Display memory limit in notification area. 2024-05-05 20:59:25 +02:00
Bartosz Taudul
5f0cac546b
Pass memory limit to worker. 2024-05-05 20:50:03 +02:00
Bartosz Taudul
2663ce1a4a
Add warning about memory limit. 2024-05-05 20:33:35 +02:00
Bartosz Taudul
56c52b8d8f
Add memory limit global settings. 2024-05-04 16:53:40 +02:00
Bartosz Taudul
66a32de0f7
Move physical memory size getter to a separate source file. 2024-05-04 16:53:40 +02:00
Bartosz Taudul
fee5982abd
Make InlineStackData non-static. 2024-05-04 14:42:40 +02:00
Bartosz Taudul
377e41fe61
Make memUsage an atomic. 2024-05-04 14:28:55 +02:00
Bartosz Taudul
6199b2f883
Try to make the top bar labels fit in their space. 2024-05-04 14:07:14 +02:00
Bartosz Taudul
4420f5863f
Workaround CMake + ninja lack of compiler output color. 2024-05-04 13:30:53 +02:00
Bartosz Taudul
6a6caae2ea
Save shorten name setting for each trace. 2024-05-04 13:22:30 +02:00
Bartosz Taudul
4a7f6e0cc1
Use enum names in radio button list. 2024-05-04 12:55:55 +02:00
Bartosz Taudul
061b5c77ce
Make trace options save file user-readable.
More importantly, it allows for backwards-compatibility when something
is added or removed, instead of just ignoring what was set before when
a binary version bump occurs.
2024-05-04 12:46:16 +02:00
Bartosz Taudul
328ecc339c
Update NEWS. 2024-05-04 11:45:20 +02:00
Bartosz Taudul
c45683506c
Merge pull request #783 from tiago-rodrigues/trodrigues/image_cache_deadlock_fix
Instead of calling dladdr inside the dl_iterate_phdr callback, do it outside to avoid deadlocks with other loader code
2024-05-04 11:33:54 +02:00
trodrigues
4bf9a8cecc Instead of calling dladdr inside the dl_iterate_phdr callback, do it outside to avoid deadlocks with other loader code 2024-05-03 16:05:59 -05:00
Bartosz Taudul
a1a7e63d93
Disable assembly in zstd. 2024-04-30 13:44:07 +02:00
Bartosz Taudul
b357d08da3
Add VS Code documentation. 2024-04-30 13:21:14 +02:00
Bartosz Taudul
0a94a7e3ba
CMake build type should be set in the documentation. 2024-04-30 13:21:13 +02:00
Bartosz Taudul
d1300c491c
Fix CMake + MSVC. 2024-04-18 00:08:36 +02:00
Bartosz Taudul
596c498e1f
Fix CMake build type selection. 2024-04-17 18:17:58 +02:00
Bartosz Taudul
44be569f4a
Merge pull request #774 from Chekov2k/source_validation
Allow source file modification time to be newer then trace capture time
2024-04-16 11:44:27 +02:00
Arnim Balzer
805cc6385a
Allow source file modification time to be newer then trace capture time via checkbox
Useful on a Mac if sources are controlled via git
2024-04-16 09:52:45 +01:00
Bartosz Taudul
411b218896
Merge pull request #772 from Lectem/server-cmake-fix
Server cmake fix : No need for ASM detection
2024-04-14 22:00:03 +02:00
Lectem
2530dceac4 CMake: Selecte executable project as startup project for VS 2024-04-14 18:13:51 +02:00
Lectem
a577a86b5c CMake: ASM should be listed last in project() so that it can use the C/C++ compiler executable as assembler
From the project() CMake documentation:
> If enabling ASM, list it last so that CMake can check whether compilers for other languages like C work for assembly too.
2024-04-14 18:13:17 +02:00
Bartosz Taudul
b5b985d1d0
Emit warning, not a message. 2024-04-01 12:57:24 +02:00
Bartosz Taudul
651c6c5350
Fix assert when propagate inlines was enabled. 2024-03-31 18:44:01 +02:00
Bartosz Taudul
30f1b901a9
Conditional framerate limiting on GLFW. 2024-03-29 21:59:16 +01:00
Bartosz Taudul
e85457815e
Conditional framerate limiting on Wayland. 2024-03-29 21:56:54 +01:00
Bartosz Taudul
c21170cc01
Add config option for reduced render rate. 2024-03-29 21:54:31 +01:00
Bartosz Taudul
547325f270
Reduce framerate on Wayland when profiler window has no focus. 2024-03-29 21:46:24 +01:00
Bartosz Taudul
767f7e4fd4
Track keyboard focus on Wayland. 2024-03-29 21:38:20 +01:00
Bartosz Taudul
2f8fe4180d
Fix variable name. 2024-03-29 20:00:21 +01:00
Bartosz Taudul
565656b021
Merge pull request #762 from mcourteaux/master
Fix Ctrl-Shift-Alt-R bug
2024-03-28 18:26:28 +01:00
Martijn Courteaux
aa66d0c286 Fix Ctrl-Shift-Alt-R bug 2024-03-28 18:07:27 +01:00
Bartosz Taudul
30d656070d
Merge pull request #760 from Chekov2k/fix_python_clean
Do not use directories as by products when file are still present
2024-03-26 21:58:29 +01:00
Arnim Balzer
7a779ba03c
Do not use directories as by products when file are still present
Unfortunately cmake does not support generator expressions in add_custom_command byproducts so can't remove all files
2024-03-26 20:55:04 +00:00
Bartosz Taudul
e77224975d
Update last time when callstack or hw samples arrive. 2024-03-26 20:48:52 +01:00
Bartosz Taudul
e071b9043f
Set busy cursor when the application is busy. 2024-03-24 17:40:30 +01:00
Bartosz Taudul
5b2cce0a02
Push IsBusy() callback to Backend. 2024-03-24 17:39:55 +01:00
Bartosz Taudul
9f9cd04761
Add function to determine if the program is busy. 2024-03-24 17:38:45 +01:00
Bartosz Taudul
630effe8fa
Add support for different mouse cursors on Wayland. 2024-03-24 01:54:21 +01:00
Bartosz Taudul
87dcfbd84b
Set mouse cursor with the cursor shape protocol. 2024-03-24 01:36:03 +01:00
Bartosz Taudul
3805727ee5
Generate cursor shape protocol. 2024-03-24 01:22:57 +01:00
Bartosz Taudul
6349d1ef0b
Support fractional scaling.
Mouse cursor is broken, but the whole Wayland design of providing mouse
cursors as surfaces by the application is broken.
2024-03-24 01:17:40 +01:00
Bartosz Taudul
cdfad41d68
Refresh screen after scale change. 2024-03-24 00:04:46 +01:00
Bartosz Taudul
bf86eba59c
Rescale scale to have 120 as a unit. 2024-03-24 00:02:13 +01:00
Bartosz Taudul
16554ed2ed
Handle wayland window resizes the right way. 2024-03-23 23:57:08 +01:00
Bartosz Taudul
aa4878bb8e
Bind viewporter. 2024-03-23 22:27:49 +01:00
Bartosz Taudul
475b022ed8
Generate viewporter protocol. 2024-03-23 22:27:49 +01:00
Bartosz Taudul
0e458447ff
Don't keep opening terminal on launch. 2024-03-23 22:27:49 +01:00
Bartosz Taudul
2bfa540656
Bind fractional scale manager. 2024-03-23 22:27:48 +01:00
Bartosz Taudul
3342254a0e
Generate fractional-scale protocol. 2024-03-23 22:27:46 +01:00
Bartosz Taudul
e10fc58bf5
Merge pull request #759 from Chekov2k/segfault
Fix segfault in Python bindings for TRACE_ENABLE=OFF case
2024-03-23 19:17:21 +01:00
Arnim Balzer
93be1d9343
Fix segfault in Python bindings for TRACE_ENABLE=OFF case 2024-03-23 17:51:16 +00:00
Bartosz Taudul
55be66cdf8
Update NEWS. 2024-03-23 13:56:25 +01:00
Bartosz Taudul
4c1b06034b
Display program run time percentage in lines selection summary. 2024-03-23 13:54:39 +01:00
Bartosz Taudul
ef9f2d247d
Add display of per-line sample time as a program run time percentage. 2024-03-23 13:50:00 +01:00
Bartosz Taudul
adbee2f820
Update NEWS. 2024-03-23 12:15:47 +01:00
Bartosz Taudul
828e52f5c4
Merge pull request #754 from Chekov2k/python
Added basic Python Support
2024-03-23 11:57:02 +01:00
Arnim Balzer
505afc8f77
Document other CMake options and fix tex errors 2024-03-23 06:45:12 +00:00
Arnim Balzer
059f1487af
Option to disable use of external pybind11 2024-03-23 06:45:12 +00:00
Arnim Balzer
d65d96191a
Added basic Python Support
Supported:
 - FrameMarks
 - ScopedZones
 - Memory allocations
 - Plots
 - ThreadNames
 - Messages
 - AppConfig

Not supported:
 - GPU
2024-03-23 06:45:12 +00:00
Bartosz Taudul
e38d9fa7ce
Use mold linker if available. 2024-03-23 02:08:36 +01:00
Bartosz Taudul
8a411a72b8
Merge pull request #757 from JBurnWork/noCallstackUpdates
Updates to address compilation with TRACY_NO_CALLSTACK
2024-03-23 01:26:42 +01:00
Bartosz Taudul
3d70a61436
Update manual. 2024-03-23 00:48:43 +01:00
Bartosz Taudul
9e6be031c1
Don't install capstone on CI. 2024-03-23 00:36:52 +01:00
Bartosz Taudul
afceec59aa
Enable AVX2 code generation on MSVC. 2024-03-22 22:07:43 +01:00
Jeff Burnett
18352366f7 Still use named mem pool if no callstacks
Forward MemAllocCallstackNamed() and MemFreeCallstackNamed() to
MemAllocNamed() and MemFreeNamed if callstack capture is off.
2024-03-22 09:50:05 -05:00
Jeff Burnett
278330af5b Fix build warnings for TRACY_NO_CALLSTACK
Fix build warnings about undefined TRACY_HAS_CALLSTACK and an unused
argument for Callstack() when TRACY_NO_CALLSTACK is defined.
2024-03-22 09:50:05 -05:00
Bartosz Taudul
aac38a7deb
Update CI.
Co-authored-by: Tom Atkinson <tja.atkinson@gmail.com>
2024-03-22 13:49:08 +01:00
Bartosz Taudul
8b8cd7d28b
Add -pthread to emscripten compile and link commands. 2024-03-21 23:04:41 +01:00
Bartosz Taudul
434d73c7bd
Emscripten support.
Doesn't work due to i64 vs i32 type mismatch in glGetIntegerv, which
seems like some general compatibility bullshit, not something related
to CMake.
2024-03-21 23:04:41 +01:00
Bartosz Taudul
8ee866e840
Update git ignores. 2024-03-21 23:04:40 +01:00
Bartosz Taudul
fec5e6bb9c
UNIX variable is true on Apple. 2024-03-21 23:04:40 +01:00
Bartosz Taudul
a2fdd3638c
Change CMake build dir to "build". 2024-03-21 23:04:40 +01:00
Bartosz Taudul
7f8a2e2c9a
Remove old build files. 2024-03-21 23:04:40 +01:00
Bartosz Taudul
1df45c00c0
Generate private-code with wayland-scanner. 2024-03-21 23:04:40 +01:00
Bartosz Taudul
bde0c63006
Generate Wayland protocol sources. 2024-03-21 23:04:40 +01:00
Bartosz Taudul
71bde8d11a
Add wayland-scanner CMake module.
https://github.com/qt/qtbase/blob/dev/cmake/3rdparty/extra-cmake-modules/find-modules/FindWaylandScanner.cmake
https://github.com/qt/qtbase/blob/dev/cmake/3rdparty/extra-cmake-modules/modules/ECMFindModuleHelpers.cmake

3dba889fef06c8760edab41159b98aaa4150b9b5
2024-03-21 23:04:40 +01:00
Bartosz Taudul
4c6f6332b0
Copy compile_commands.json to workspace root. 2024-03-21 23:04:40 +01:00
Bartosz Taudul
1a3131178d
Link update with dbghelp. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
148eac2c24
Link with getopt. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
06244c0def
Provide sane default config for VS Code CMake extension. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
f523521831
Fix copypasta. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
25898a9c7a
Enable LTO. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
4bfd6f42bc
Add CMake build files for the rest of the utilites. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
46718851da
Extract some common definitions. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
375f4526df
Set TRACY_VERSION_STRING directly in version.cmake. 2024-03-21 23:04:39 +01:00
Bartosz Taudul
776b08f2e0
Split core server files from the UI. 2024-03-21 23:04:38 +01:00
Bartosz Taudul
cc4ed68271
Extract common set of server files to a separate cmake build file.
Co-authored-by: Tom Atkinson <tja.atkinson@gmail.com>
2024-03-21 23:04:38 +01:00
Bartosz Taudul
35246b4191
Remove vcpkg. 2024-03-21 23:04:38 +01:00
Bartosz Taudul
269c75103e
Windows build fixes.
- Include manifest.
- Add icon.
- Set subsystem to Windows.
2024-03-21 23:04:38 +01:00
Bartosz Taudul
2c4abf5f9f
Link with winsock on Windows. 2024-03-21 23:04:38 +01:00
Bartosz Taudul
58115b35c5
Fix non-wayland build. 2024-03-21 23:04:38 +01:00
Bartosz Taudul
970250fc85
Another stupid macro needed for MSVC to not crap the pants. 2024-03-21 23:04:38 +01:00
Bartosz Taudul
1bada6a6fd
Set NOMINMAX on win32. 2024-03-21 23:04:38 +01:00
Bartosz Taudul
699d93c7ae
Provide a list of recommended VS Code extensions. 2024-03-21 23:04:37 +01:00
Bartosz Taudul
ee81795f26
Move discovery of external dependencies to cmake/vendor.cmake.
Co-authored-by: Tom Atkinson <tja.atkinson@gmail.com>
2024-03-21 23:04:37 +01:00
Bartosz Taudul
a5f256ca2d
Add CMake Package Manager.
Co-authored-by: Tom Atkinson <tja.atkinson@gmail.com>
2024-03-21 23:04:37 +01:00
Bartosz Taudul
061b990875
Move version.cmake to cmake/ subdirectory.
Co-authored-by: Tom Atkinson <tja.atkinson@gmail.com>
2024-03-21 23:04:37 +01:00
Bartosz Taudul
1c43f6efa7
Move profiler to top of CMake projects list.
Will it make it the default in the extension?
2024-03-21 23:04:37 +01:00
Bartosz Taudul
96d44cc847
Add VS Code CMake configuration. 2024-03-21 23:04:37 +01:00
Bartosz Taudul
b73a0ff54e
Replace build and launch config by CMake integration. 2024-03-21 23:04:37 +01:00
Bartosz Taudul
c9b4248d35
Add basic CMakeLists.txt for the profiler GUI. 2024-03-21 23:04:36 +01:00
Bartosz Taudul
0081f1bda0
Remove Microsoft's C++ extension configuration.
Use clangd instead.
2024-03-21 23:04:36 +01:00
Bartosz Taudul
9ca27bf7cc
Enable including version.cmake from any directory. 2024-03-21 23:04:36 +01:00
Bartosz Taudul
ac031e64d6
Merge pull request #755 from Chekov2k/color
Add support to set color when creating a ScopedZone
2024-03-20 22:19:38 +01:00
Arnim Balzer
c5a68c2d8e
Remove default values that are not supported in C 2024-03-20 20:01:18 +00:00
Arnim Balzer
8df02e0bff
Add support to set color when creating a ScopedZone 2024-03-18 08:56:06 +00:00
Bartosz Taudul
83305115c2
Fix variable name. 2024-03-17 11:34:25 +01:00
Bartosz Taudul
578759384d
Make sure first DPI setup is run. 2024-03-16 01:16:25 +01:00
Bartosz Taudul
c673056dd4
Prevent window resizes on DPI change. 2024-03-16 01:13:09 +01:00
Bartosz Taudul
4fbef01729
Trigger redraw when DPI changes.
Previously the wayland surface was not updated, because there were no
surface commits performed due to power saving routines.
2024-03-16 00:57:55 +01:00
Bartosz Taudul
8ebe62ed85
Fix welcome window resizes. 2024-03-15 20:25:00 +01:00
Bartosz Taudul
55f9341aec
Scale ImGui windows when DPI changes.
Code is directly lifted from ImGui, with certain known caveats.
2024-03-15 20:19:32 +01:00
Bartosz Taudul
f5f82a2bd5
Don't show inline options for instrumentation statistics. 2024-03-13 23:39:16 +01:00
Bartosz Taudul
dec5b851af
Update NEWS. 2024-03-13 20:49:25 +01:00
Bartosz Taudul
37e3c60433
Update manual. 2024-03-13 20:40:54 +01:00
Bartosz Taudul
390b3d9c50
Redo inline options UI. 2024-03-13 20:04:38 +01:00
Bartosz Taudul
6c34e02dc2
Ability to display inline function cost percentages relative to base symbol. 2024-03-13 19:50:21 +01:00
Bartosz Taudul
6235343286
Disable sample parents when inline aggregation is enabled. 2024-03-13 19:15:00 +01:00
Bartosz Taudul
e155702e0a
Display count of aggregate inline functions. 2024-03-13 19:15:00 +01:00
Bartosz Taudul
3af5c7b331
Implement inline function aggregation. 2024-03-13 19:14:59 +01:00
Bartosz Taudul
f04cdb7782
Add aggregate inlines UI. 2024-03-13 19:14:59 +01:00
Bartosz Taudul
f264d0736a
Add grouping icon. 2024-03-13 19:14:59 +01:00
Bartosz Taudul
18f2631e6e
Remove AUTHORS file. 2024-03-13 19:14:59 +01:00
Bartosz Taudul
14206b5b4f
Merge pull request #750 from benvanik/benvanik-source-copy
Adding a copy button to the source view.
2024-03-13 18:13:11 +01:00
Ben Vanik
605cdcb5d5 Adding a copy button to the source view. 2024-03-13 09:35:16 -07:00
Bartosz Taudul
f1998292a4
Update git ignore list. 2024-03-13 00:52:10 +01:00
Bartosz Taudul
f5459c4d2c
Bump json.hpp to 3.11.3. 2024-03-13 00:45:43 +01:00
Bartosz Taudul
00e24e2b8c
pdqsort: Fixed overflow and simplified block partition logic. (2dc2bbd) 2024-03-13 00:42:59 +01:00
Bartosz Taudul
3b9e7a1838
Update stb_image to 2.29. 2024-03-13 00:34:19 +01:00
Bartosz Taudul
2df972d586
libbacktrace: don't assume compressed section is aligned (7ead8c1) 2024-03-13 00:29:01 +01:00
Bartosz Taudul
49478ec3b3
libbacktrace: skip all LZMA block header padding bytes (28824f2) 2024-03-13 00:24:13 +01:00
Bartosz Taudul
1f90cd473b
libbacktrace: use real .opd for debuginfo on ppc64 v1 ABI (592e9c8) 2024-03-13 00:23:08 +01:00
Bartosz Taudul
a9feb75bdf
libbacktrace: read symbol table of debuginfo file (36cfdc1) 2024-03-13 00:20:14 +01:00
Bartosz Taudul
a4eecd508d
libbacktrace: call GetModuleFileNameA on Windows (25889d2) 2024-03-13 00:18:14 +01:00
Bartosz Taudul
11bf33c32c
libbacktrace: look for _pgmptr on Windows (c1c86fa2) 2024-03-13 00:15:10 +01:00
Bartosz Taudul
4e349dd283
Merge pull request #746 from Mulej/master
Expose lock API to TracyC.h
2024-03-12 21:55:16 +01:00
Bartosz Taudul
f39a2fd3ee
Merge pull request #748 from benvanik/benvanik-reconnect-hotkey
Adding ctrl-r as a hotkey for reconnecting from the main profiler view.
2024-03-12 21:52:40 +01:00
Matej Mulej
db6128afe2
Grammar. 2024-03-12 20:59:52 +01:00
Matej Mulej
218d90fb3f
Add documentation for the C lock API. 2024-03-12 20:56:56 +01:00
Matej Mulej
14438be242
Cleanup and define nice C macros for lock API. 2024-03-12 20:56:00 +01:00
Ben Vanik
4fa5d23fa4 Adding ctrl-shift-alt-r hotkey for reconnecting.
This is effectively the same as clicking on the connection status
button, clicking discard, and then clicking reconnect.
2024-03-12 12:48:23 -07:00
Bartosz Taudul
d29421727c
Merge pull request #747 from benvanik/benvanik-copy-statistics
Adding a copy to CSV button to the statistics view.
2024-03-12 15:29:00 +01:00
Ben Vanik
51c99ba3c2 Adding a copy to CSV button to the statistics view.
This copies the visible rows of either the instrumentation or GPU
statistics view to a CSV string matching a subset of the csvexport
format.
2024-03-11 20:39:21 -07:00
Matej Mulej
2e7081e52a
Expose lock API to TracyC.h 2024-03-11 21:06:11 +01:00
Matej Mulej
92511c9742
Add non-C++ lock API 2024-03-11 21:01:25 +01:00
Bartosz Taudul
1ddecd4b99
Merge pull request #745 from apache-hb/master
Fix build and configure warnings when compiling with clang-cl
2024-03-11 20:18:47 +01:00
Elliot
a26f076a0e fix build warnings when compiling with clang-cl 2024-03-11 14:44:44 -04:00
Bartosz Taudul
082c13ac8e
Put m_qpcToNs in a _WIN32 ifdef. 2024-03-09 23:25:49 +01:00
Bartosz Taudul
c0789c20cb
Add CppCon 2023 video. 2024-03-07 17:49:39 +01:00
Bartosz Taudul
7d813ec2c1
Merge pull request #733 from Razakhel/fix-clang-pedantic-windows
Added preprocessor checks for Clang on Windows
2024-03-05 18:07:03 +01:00
Bartosz Taudul
9ccc754143
Fix macos, 2024-03-02 00:30:50 +01:00
Bartosz Taudul
746b6c6246
Don't ignore user scale when DPI scale changes. 2024-03-02 00:21:08 +01:00
Bartosz Taudul
b329eb1fcc
Change way of updating fonts in View.
This makes the whole process more easy to follow. It also fixes a crash
bug that was occuring when Wayland output scale changed.
2024-03-01 23:43:53 +01:00
Bartosz Taudul
bdfcc5b814
Add missing ImGui renderer shutdown to the Wayland backend. 2024-03-01 22:11:30 +01:00
Bartosz Taudul
ec549c4831
Update ImGui to 1.90.4 + docking. 2024-03-01 22:09:08 +01:00
Bartosz Taudul
ea0471f9d0
Fix wl_surface v6 listener. 2024-02-28 13:30:59 +01:00
Grégoire Roussel
0295ef2b3c
[doc] Minor documentation updates (#737)
Co-authored-by: Grégoire Roussel <gregoire.roussel@wandercraft.eu>
2024-02-28 02:14:35 +01:00
Bartosz Taudul
0ca5e25c13
Update NEWS. 2024-02-27 22:14:04 +01:00
Bartosz Taudul
03c98a8d4c
Show external frames by default. 2024-02-27 22:12:27 +01:00
Bartosz Taudul
77f8ec0b2f
Implement hiding external stack frames. 2024-02-27 02:04:30 +01:00
Bartosz Taudul
a1aa87df87
Add ellipsis to standard font. 2024-02-27 02:04:29 +01:00
Bartosz Taudul
4226f7888e
Manually allocate and free s_di_known.
Otherwise destructor will be called when main() returns while symbol
retrieval may still want to actively use the vector.
2024-02-26 23:03:37 +01:00
Bartosz Taudul
133d52a6dd
Make external name retrieval high priority. 2024-02-25 15:13:29 +01:00
Bartosz Taudul
408ef4c06e
Update NEWS. 2024-02-25 13:57:51 +01:00
Bartosz Taudul
c514a5caca
Implement sorting instrumentation statistics by location. 2024-02-25 13:52:37 +01:00
Bartosz Taudul
b6562f1784
Merge pull request #715 from YaLTeR/fix-wayland-scale
Fix and update Wayland scale handling
2024-02-24 11:45:35 +01:00
Razakhel
cef21ef035 Added preprocessor checks for Clang on Windows
- MSVC-specific code is used in some places and compiled only if _MSC_VER is set; however, Clang under Windows also defines this, which reports errors on this non-standard code if the -pedantic-errors compiler flag is set
2024-02-21 22:54:44 +01:00
Bartosz Taudul
a2dd51ae4c
Merge pull request #727 from idbrii/fix-warn-conversion
Fix warning: Cast thread id to uint32_t
2024-02-17 02:22:04 +01:00
David Briscoe
7d8432bbec Cast thread id to uint32_t
Fix MSVC Warning C4244: 'argument': conversion from 'uint64_t' to
'uint32_t', possible loss of data

We only store 32 bit thread ids in ThreadNameData.

Trying to follow existing style instead of static_cast.
2024-02-16 16:29:36 -08:00
Bartosz Taudul
5ce238e9b4
Merge pull request #724 from idbrii/fix-mem-callstacktree-active
Memory: correctly filter active allocations in call stack tree
2024-02-15 20:12:22 +01:00
David Briscoe
255e3d2829 Correctly filter allocations in memory call tree
Fix #723: Memory: active allocations are incorrectly displayed in call stack tree

The range we were looking for was wrong (should be Active instead of
Inactive), but I also reworked to make the comparison clearer.

Test

Using the repro app from the bug:
1. Click "Free + Allocate" once
1. Call stack tree shows 2 entries under "Active allocations", 1 active
   allocation, 0 inactive allocations in the call stack tree.
1. Click "Free + Allocate" several times
1. Call stack tree shows 1 KB of active allocations and many KB of
   inactive.
2024-02-15 10:38:48 -08:00
Bartosz Taudul
3c4b06dff5
Merge pull request #722 from waywardmonkeys/ci-update-actions
ci: Update to current versions of actions.
2024-02-12 12:31:05 +01:00
Bruce Mitchener
793d1d08c8 ci: Update to current versions of actions.
This should remove the warnings within the GitHub Actions UI about
using the deprecated Node 12 and 16 versions.
2024-02-12 16:50:36 +07:00
Bartosz Taudul
3c313e9e73
Update manual. 2024-02-11 18:07:18 +01:00
Bartosz Taudul
7f04c66ef1
Bump meson version requirement to 1.1. 2024-02-11 17:32:42 +01:00
Bartosz Taudul
8731f3bc73
Drop shared_libs meson option. 2024-02-11 17:26:48 +01:00
Bartosz Taudul
783bc7c939
Drop tracy_ prefix from meson options. 2024-02-11 17:20:43 +01:00
Bartosz Taudul
0762d4bbd1
Rename meson_options.txt -> meson.options. 2024-02-11 17:16:58 +01:00
Bartosz Taudul
5f661bf767
Update NEWS. 2024-02-11 16:33:58 +01:00
Bartosz Taudul
bf76f57716
Add formatted variants for ZoneText and ZoneName. 2024-02-11 16:24:37 +01:00
Bartosz Taudul
c03884d20c
Add TracyNoop macro. 2024-02-09 14:51:25 +01:00
Bartosz Taudul
5e4eae5c2e
Avoid creation of a temporary object. 2024-02-09 01:27:33 +01:00
Bartosz Taudul
5037742ab0
Fix file access race condition. 2024-02-07 17:14:31 +01:00
Bartosz Taudul
312713b83c
Free allocated memory in case of read failure. 2024-02-07 17:14:04 +01:00
Bartosz Taudul
d46ffb4e9f
Add verbose and debuginfod to meson options. 2024-02-05 02:12:31 +01:00
Bartosz Taudul
5461427493
Print error message when opening a trace from command line fails. 2024-02-03 16:25:01 +01:00
Bartosz Taudul
1354205db8
Merge pull request #716 from gedalia/gpasternak/crash_handler_fix
This change makes the crash handler only install when tracy is connected.
2024-01-24 21:12:17 +01:00
Gedalia Pasternak
4ebbd15894 add win32 fix. 2024-01-24 11:27:08 -05:00
Gedalia Pasternak
9515a824fd This change makes the crash handler only install when tracy is connected.
This avoids the issue that an end user has their own crash handler which
gets ignored when tracy is on even if there is nothing to capture the crash.
2024-01-24 09:25:57 -05:00
Ivan Molodetskikh
fcdc96748e wayland: Use preferred_buffer_scale when available
On wl_compositor >= 6 we bind v6 and use preferred_buffer_scale.
Otherwise we bind 4 and do as before.

No other changes are needed for the version bump as Tracy doesn't use
wl_surface_attach() with nonzero coordinates.
2024-01-24 12:43:42 +04:00
Ivan Molodetskikh
16434f116c Add a way for Backend to signal scale changes
On Wayland the scale now changes to the correct value as the Tracy
window is moved across monitors.

If the scale is overridden from environment, it does not change, just
like before.
2024-01-24 12:34:23 +04:00
Ivan Molodetskikh
bf3bd28bfa wayland: Keep track of entered outputs for scale
Wayland kindly informs us which outputs the surface is on, to be used
for scale computation (at least on wl_compositor < 6). On mixed DPI
setups this fixes Tracy potentially using a higher scale than the output
it's displayed on.

However, as is, this commit results in Tracy always using scale 1,
because at the point of backend creation (which is when the scale is
queried) the surface is not yet displayed on any outputs, so a scale of
1 is assumed.
2024-01-24 12:19:52 +04:00
Bartosz Taudul
c4863d4324
Bump ImGui to 1.90.1. 2024-01-11 13:21:19 +01:00
Bartosz Taudul
a9288cd759
Merge pull request #710 from c-cube/bound-checks-import-fuchsia
import fuchsia: check bounds to handle truncated traces
2024-01-08 22:16:25 +01:00
Simon Cruanes
dff6ea5821
import fuchsia: check bounds to handle truncated traces
the last record might be partially written so it's important to
check bounds and dump the last record if that happens.
2024-01-08 16:02:17 -05:00
Bartosz Taudul
747a3cdea2
Merge pull request #708 from phsilva/fix-typo
Fix typo on Chapter 1 opening sentence.
2024-01-02 23:09:32 +01:00
Paulo Henrique Silva
ef55ad6c8d Fix typo
Typo introduced on revision a13b04669.
2024-01-02 18:19:21 -03:00
Bartosz Taudul
0fd1840523
Update NEWS. 2024-01-02 20:09:25 +01:00
Bartosz Taudul
fc8fc80900
Drop support for pre-0.9.0 traces. 2024-01-02 20:08:41 +01:00
Bartosz Taudul
90c7a43e8a
Less verbose CPU data table header labels. 2024-01-02 20:08:18 +01:00
Bartosz Taudul
2ac0173c91
Update manual. 2024-01-02 17:18:31 +01:00
Bartosz Taudul
f74ade31f4
Update NEWS. 2024-01-02 17:04:02 +01:00
Bartosz Taudul
680174685b
Pass function names to ViewSource() calls. 2024-01-02 17:04:01 +01:00
Bartosz Taudul
4757d101fc
Optional ctrl key mod check when running view source with function name. 2024-01-02 17:04:01 +01:00
Bartosz Taudul
9a5fb0bb51
Implement search for symbol matching function name when opening source view. 2024-01-02 16:15:12 +01:00
Bartosz Taudul
cf412bfb2e
Change microarchitecture fallback to ZEN4. 2024-01-02 14:56:00 +01:00
Bartosz Taudul
38dc0d83d7
Bump copyright year. 2024-01-01 13:54:12 +01:00
Bartosz Taudul
426c8cef39
Merge pull request #706 from c-cube/fix-import-fuchsia-string-ref
fix import-fuchsia: handle string references properly
2024-01-01 13:53:40 +01:00
Simon Cruanes
bafc86326a
check for the presence of the initialization record 2023-12-31 22:52:13 -05:00
Simon Cruanes
d2bdcc2e2c
fix import-fuchsia: handle string references properly 2023-12-31 22:43:10 -05:00
Bartosz Taudul
dfe126a7f3
TracyPrint.cpp is a dependency of TracyWorker.cpp now. 2023-12-31 14:29:32 +01:00
Bartosz Taudul
762582357b
Check if source location counts are in order when loading traces. 2023-12-31 14:16:50 +01:00
Bartosz Taudul
b262cb2428
Handle load failure exceptions. 2023-12-31 14:16:06 +01:00
Bartosz Taudul
5062bef69a
Add trace load failure exception. 2023-12-31 13:55:06 +01:00
Bartosz Taudul
d64307be91
Move bad version popup out of file selector ifdef check. 2023-12-31 13:54:04 +01:00
Bartosz Taudul
586c6bf166
Hook up source location overflow failures.
Note: not tested. Expect some off-by-one bugs. Control flow may fail. Oh no.
2023-12-31 13:06:51 +01:00
Bartosz Taudul
54ee77026f
Add source location overflow failures. 2023-12-31 12:58:56 +01:00
Bartosz Taudul
cb7ce1c3aa
Merge pull request #704 from c-cube/wip-import-fuchsia
wip: import-fuchsia tool to import fuchsia traces
2023-12-29 16:07:50 +01:00
Simon Cruanes
737759bc43
manual: remove use of \href 2023-12-29 09:33:07 -05:00
Simon Cruanes
b558f65004
handle loc in import-fuchsia 2023-12-28 18:08:08 -05:00
Simon Cruanes
c6efbf6cb7
add some documentation for import-fuchsia (and import-chrome) to manual 2023-12-28 18:03:16 -05:00
Simon Cruanes
7769f23c76
add CI for import-fuchsia 2023-12-28 17:47:21 -05:00
Simon Cruanes
c4b644ecf8
fix 2023-12-27 23:31:17 -05:00
Simon Cruanes
a275f1a2e0
remove dead code 2023-12-27 17:14:17 -05:00
Simon Cruanes
90b2c986ee
decode thread names 2023-12-27 17:13:46 -05:00
Simon Cruanes
7f40e6cda9
handle counter, begin/end duration events, and fix decoding of double arguments 2023-12-27 16:57:25 -05:00
Simon Cruanes
5ecd3a5e83
fix printing of arguments 2023-12-27 12:30:24 -05:00
Simon Cruanes
bf75b9fab0
bugfix 2023-12-27 01:39:06 -05:00
Simon Cruanes
77d091bdc8
wip: import-fuchsia tool to import fuchsia traces
See:
https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format
2023-12-27 01:18:41 -05:00
Robert Osfield
d62428c482
Moved methods into public scope and add GetQueryPool() method to enable use of the VkCtx directly rather than just from VkCtxScope (#695) 2023-12-23 00:54:18 +01:00
Bartosz Taudul
1557a9ac52
Restore emscripten 32-bit vertex buffer indices. 2023-12-21 22:12:55 +01:00
Bartosz Taudul
90c5ad04e7
Update NEWS. 2023-12-21 15:12:24 +01:00
Bartosz Taudul
28636b076b
Add missing colon. 2023-12-21 14:38:06 +01:00
Bartosz Taudul
e7b9bffbbd
Rename TRACE_CLIENT_LIBUNWIND_BACKTRACE to TRACY_LIBUNWIND_BACKTRACE. 2023-12-21 14:07:44 +01:00
Bartosz Taudul
04aa19a3f3
Update manual. 2023-12-21 13:47:10 +01:00
Bartosz Taudul
58c630473a
Use thread icon for thread label in statistics. 2023-12-21 13:26:43 +01:00
Bartosz Taudul
e44db26492
Display number of groups in find zones window. 2023-12-20 17:31:00 +01:00
Bartosz Taudul
ef9b079ecc
Mark invalidGid constexpr. 2023-12-20 17:26:29 +01:00
Bartosz Taudul
56fa051bea
Display number of threads each source location is present in. 2023-12-20 17:19:26 +01:00
Bartosz Taudul
8187519775
Add threads count to SrcLocZonesSlim. 2023-12-20 17:19:26 +01:00
Bartosz Taudul
d01113150d
Calculate per-thread source location counts. 2023-12-20 16:42:37 +01:00
Bartosz Taudul
e9911ab127
Fix includes. 2023-12-20 13:16:51 +01:00
Bartosz Taudul
0f794ed3b4
Cosmetics. 2023-12-20 13:15:42 +01:00
Bartosz Taudul
c39b7af4b3
Proper spelling of dbghelp. 2023-12-20 13:14:06 +01:00
Bartosz Taudul
cc3cbfe6f2
No need for indirection of ImageEntry vector. 2023-12-12 19:27:53 +01:00
Bartosz Taudul
5decb91cd0
Don't clear image cache on refresh. 2023-12-12 19:23:27 +01:00
Bartosz Taudul
7fc7935359
Cosmetics. 2023-12-12 19:09:41 +01:00
Bartosz Taudul
073e04e967
Remove redundant include. 2023-12-12 19:04:43 +01:00
Bartosz Taudul
71628f4b1c
Merge pull request #682 from amschnorr/add-tracy-client-address-flag
Add tracy client address complile flag
2023-12-12 13:47:30 +01:00
Bartosz Taudul
ea53a9220b
Merge pull request #683 from YaLTeR/add-missing-to-meson
Add new options to meson
2023-12-12 12:52:33 +01:00
Ivan Molodetskikh
4e23b1125a meson: Add tracy_libbacktrace_elf_dynload_support option 2023-12-12 08:06:31 +04:00
Ivan Molodetskikh
b110b10b35 meson: Add tracy_symbol_offline_resolve option 2023-12-12 08:06:08 +04:00
Ivan Molodetskikh
2b0be68b4a meson: Add libunwind option
The CMake name was a bit weird, so I changed it to the standard format
for meson.
2023-12-12 08:05:38 +04:00
Ivan Molodetskikh
c0e4652edf meson: Add tracy_public_deps list
Currently functionally identical to before. Will be used in a subsequent
commit for libunwind, which appears in a public header.
2023-12-12 08:04:41 +04:00
Alex
6cb0fa0901 -doc revise 2023-12-11 19:24:04 -08:00
Alex
9921b74e6d -documentation
-erro message
2023-12-11 16:21:19 -08:00
Alex
1e6f877777 -add tracy client address flag 2023-12-11 15:16:41 -08:00
Bartosz Taudul
9bc014b183
Merge pull request #674 from tiago-rodrigues/trodrigues/offline_symbol_resolve_and_imagecache2
Add image cache to avoid calling dladdr() and add libbacktrace elf image list refresh
2023-12-11 20:31:14 +01:00
trodrigues
ab1ec3f01c make sure we always copy the image name in ImageCache 2023-12-09 19:12:53 -06:00
trodrigues
15f1b6b0b4 make a copy of dli_fname after calling dladdr. Call ImageCache destructor. 2023-12-09 09:40:07 -06:00
trodrigues
8503f32b36 fix typos and compilation warnings 2023-12-09 09:37:14 -06:00
trodrigues
e80e1d2484 fix line endings 2023-12-06 12:29:26 -06:00
Tiago Rodrigues
8dfc5fe41f re-apply diff 2023-12-06 12:39:52 -05:00
Tiago Rodrigues
38559172bb checkout elf.cpp as it looks like line ending were screwed up 2023-12-06 12:37:53 -05:00
Tiago Rodrigues
24b6c649d3 fix typo 2023-12-06 12:32:37 -05:00
trodrigues
b835d73590 Add support for libbacktrace to detect new elfs have been dynamically loaded after backtrace_initialize() has been called, and consider them for symbol resolution 2023-12-05 20:09:11 -06:00
trodrigues
55f53b9979 remove option to enable image cache, use it for TRACY_HAS_CALLSTACK == 3 to obtain image path and addreses instead of dladdr() 2023-12-05 20:01:12 -06:00
trodrigues
a618b6e6f8 simplify return from tracy::FastVector iterator 2023-12-03 08:36:54 -06:00
Tiago Rodrigues
a9d039e081 move under the tracy namespace, remove commented out code 2023-12-03 09:23:03 -05:00
Tiago Rodrigues
132419dba3 Add image cache to avoid calling dladdr() when doing offline symbol resolution. This cache can also be used in the runtime symbol resolution case to detect we should recreate "backtrace_state" when new images have been loaded 2023-11-29 13:23:58 -05:00
Bartosz Taudul
af73dba73e
Merge pull request #665 from tiago-rodrigues/trodrigues/offline_symbol_resolve
Add support for offline callstack symbol resolving
2023-11-27 16:53:22 +01:00
Tiago Rodrigues
2509a4b962 update documentation to reflect that symbol statistics are broken when using offline symbol resolving 2023-11-27 10:22:12 -05:00
Bartosz Taudul
87f3d20a9e
Merge pull request #673 from AMS21/patch-1
Fix typo `enfore` -> `enforce`
2023-11-26 12:52:33 +01:00
AMS21
d2325e49e7
Fix typo enfore -> enforce 2023-11-26 11:51:05 +00:00
Bartosz Taudul
bed5f9b16e
Make the manual two-sided. 2023-11-25 15:58:25 +01:00
Tiago Rodrigues
69b9707bc5 update github workflows to remore tracy-edit 2023-11-25 09:19:13 -05:00
Tiago Rodrigues
de6e7d2fc3 move the symbol resolving functionality to the update application instead of creating a new one 2023-11-24 20:48:39 -05:00
Tiago Rodrigues
a1ca8dd06a fixes according to review comments 2023-11-24 16:32:45 -05:00
Tiago Rodrigues
e5e84424f6 update cmake option description 2023-11-24 16:24:45 -05:00
Grégoire Roussel
116e82de9e
[doc] Add small section for docker on Ubuntu (#668) 2023-11-20 18:58:01 +01:00
Ivan Molodetskikh
ad39a01de1
Don't error on frame end without start (#666)
With on-demand profiling we're very likely to connect in the middle of a
discontinuous frame and thus receive a frame end without any preceding
frame start. So don't error out in this case.
2023-11-19 19:09:58 +01:00
trodrigues
6c0bb0a56a add mising cstdint include that was saucing compilation failure in the linux github workflow (but not locally, likely due to diff compiler) 2023-11-19 06:50:56 -08:00
trodrigues
e04e595eec update linux github workflow after rebase 2023-11-19 06:36:42 -08:00
trodrigues
301c9fb720 revert #ifdef of a lot of code by TRACY_SYMBOL_OFFLINE_RESOLVE, it now only force enables the offline symbol resolving codepath. 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
79618c5a1a Add support for using defining TRACY_SYMBOL_OFFLINE_RESOLVE to enable only the offline symbol resolving codepath 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
b3f68801bb fix linux compilation 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
5c0513931a - Fix formatting
- delete CreateResolver/DestroySymbolResolver
2023-11-19 06:32:17 -08:00
Tiago Rodrigues
687d681764 Instead of adding new method, make StoreString public 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
c302b509fe fix formatting 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
3fdd1e1863 fix typo 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
0491cad49a Add support for symbol path replacement using regex in tracy-edit 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
fe0e5f3358 Add some basic documentation for offline symbols 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
94e7da11ec use pkg-config to get libcapstone config 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
a887d558f1 enable addr2line symbol resolver in all platforms except windows 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
5c3e303f6f add tracy-edit debug compilation workflow 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
a24fec91bd try to add tracy-edit to github workflows 2023-11-19 06:32:17 -08:00
Tiago Rodrigues
f4f75eac64 Add support for offline symbol resolving by setting the "TRACY_SYMBOL_OFFLINE_RESOLVE=1" env var
- Add a tool "tracy-edit" that allows loading a tracy capture, patching symbols and recompress the result
- Add offline symbol resolvers for linux (using addr2line) and windows (using dbghelper)
2023-11-19 06:32:16 -08:00
Bartosz Taudul
906f73cab3
Switch CI to build on archlinux image. 2023-11-19 14:24:44 +01:00
Bartosz Taudul
7c6e093213
Merge pull request #656 from apache-hb/master
respect mesons default_library option
2023-11-18 15:29:08 +01:00
Elliot
9ccf02a4c8 use bool deprecation flag rather than string 2023-11-17 15:42:57 -05:00
Elliot
67b454286f fix deprecation tag in option and reverse warning check 2023-11-15 13:02:05 -05:00
Bartosz Taudul
cf1e91b853
Bump ImGui to 1.90 + docking. 2023-11-15 18:47:54 +01:00
Bartosz Taudul
aa5cc655a9
Merge pull request #661 from moritz-h/imgui-include
Prefer internal imgui
2023-11-15 15:43:24 +01:00
Moritz Heinemann
69b82903cd Prefer internal imgui 2023-11-15 14:41:45 +01:00
Bartosz Taudul
c79f6128bc
Merge pull request #660 from sistr22/patch-android-compilation
Fix compilation on 32 bit android
2023-11-15 12:35:44 +01:00
Damien Mabin
37f886dba4
Fix compilation on 32 bit android 2023-11-15 13:28:37 +02:00
Elliot
a3774039f6 warn when tracy_shared_libs and default_library mismatch 2023-11-13 15:56:17 -05:00
Elliot
9342df020d mark the tracy_shared_libs as deprecated 2023-11-13 15:56:06 -05:00
Bartosz Taudul
2f2f9939db
Merge pull request #657 from tiago-rodrigues/trodrigues/tracy_libunwind
Add support for using using libunwind
2023-11-13 20:19:06 +01:00
Tiago Rodrigues
c373647dae fix coding style 2023-11-13 13:43:03 -05:00
Tiago Rodrigues
5f60ac7ad2 update docs 2023-11-13 13:42:30 -05:00
Tiago Rodrigues
0339ed3c9c Merge branch 'trodrigues/tracy_libunwind' of https://github.com/tiago-rodrigues/tracy into trodrigues/tracy_libunwind 2023-11-13 12:58:21 -05:00
Tiago Rodrigues
e4b5395ae8 Update documentation with new compile time and env variables added. 2023-11-13 12:57:34 -05:00
Elliot
b95fb270cb
Update meson.build
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
2023-11-11 23:17:20 -05:00
trodrigues
2988d0a136 rename libunwind option and add it to cmake 2023-11-10 16:17:39 -06:00
Tiago Rodrigues
95cb3e1f5a Add "TRACY_NO_SYS_TRACE" env var to allow force disabling system trace even if the underlying system supports it 2023-11-10 17:02:47 -05:00
Tiago Rodrigues
790d28911d Add env var "TRACY_NO_DBHELP_INIT_LOAD" to allow disabling dbghelp loading of DeviceDriver and ProcessModules at startup 2023-11-10 17:02:03 -05:00
Tiago Rodrigues
4c94b3eff7 Add support to use libunwind for backtrace capturing on linux platforms (which is ~ 4x faster than execinfo) 2023-11-10 17:00:39 -05:00
Elliot
96411e5d10 specify more accurate min version 2023-11-09 13:56:21 -05:00
Elliot
46ba3bf1c9 use mesons default_library flag 2023-11-09 13:50:34 -05:00
Bartosz Taudul
348be05605
Add zmmword as known asm size directive. 2023-11-08 02:01:37 +01:00
Bartosz Taudul
95be71e974
Merge pull request #654 from tmayoff/patch-1
Update meson_options.txt to allow overriding of tracy_enable
2023-11-02 15:38:20 +01:00
Tyler
d0a4abeef5
Update meson_options.txt
This allows superprojects to override the tracy_enable option
2023-11-02 10:17:28 -04:00
Bartosz Taudul
0b21b2f3b4
Merge pull request #649 from michaeldleslie/support_qnx
Add basic QNX support
2023-10-30 23:44:58 +01:00
Michael Leslie
d7d062b20b revert change to BSDs GPU zones fields 2023-10-30 14:15:35 -07:00
Michael Leslie
dcf088562b update main doc to mention QNX support and include in feature support matrix 2023-10-30 09:50:49 -07:00
Bartosz Taudul
8202502a2f
Merge pull request #652 from YaLTeR/is-started
Add TracyIsStarted
2023-10-25 13:02:56 +02:00
Ivan Molodetskikh
852a1a5f14 Add TracyIsStarted
When using TRACY_MANUAL_LIFETIME, calling most Tracy functions
before starting the profiler results in an assertion. Notably, even
TracyIsConnected is affected. There is, however, no function to check if
the profiler had already started. This commit adds such a function.
2023-10-25 14:56:29 +04:00
Michael Leslie
8263bfb829 clean up indentation 2023-10-24 17:44:46 -07:00
Michael Leslie
daba5ae1d8 add qnx support for instrumentation profiling only 2023-10-24 17:40:13 -07:00
Bartosz Taudul
18054b4f34
Merge pull request #647 from YaLTeR/meson-missing-incl
meson: Add missing TracySysPower include
2023-10-24 11:16:58 +02:00
Ivan Molodetskikh
c2fb6f62fb meson: Add missing TracySysPower include 2023-10-24 08:27:12 +04:00
Bartosz Taudul
4c8944b174
Merge pull request #644 from YaLTeR/gpu-time-sync
Add GpuTimeSync event
2023-10-23 19:18:38 +02:00
Bartosz Taudul
721a39a9ea
Describe drawbacks of GPU resynchronization 2023-10-23 15:56:21 +02:00
Ivan Molodetskikh
f99d1a2b61 Mention ___tracy_emit_gpu_time_sync in the manual 2023-10-23 08:02:52 +04:00
Ivan Molodetskikh
41fc293043 Add GpuTimeSync event
Allows to resynchronise GPU and CPU timestamps during profiling.
2023-10-22 10:16:41 +04:00
Bartosz Taudul
3601576b3f
Add some more ogryzek device identifiers. 2023-10-20 01:32:05 +02:00
Bartosz Taudul
5994629ccd
Document AMD GPUs power saving issues. 2023-10-19 23:27:19 +02:00
Bartosz Taudul
6819c28bcb
Merge pull request #642 from YaLTeR/c-api-gpu-fixes
Defer GPU context creation from the C API
2023-10-19 14:22:38 +02:00
Ivan Molodetskikh
52caae3a51 Defer GPU contexts from the C API
Same as how the C++ API does it. Otherwise with on demand mode the
profiler never receives the GPU context info.
2023-10-19 15:33:06 +04:00
Bartosz Taudul
7f5cfdfa10
Merge pull request #641 from YaLTeR/meson-improvements
Meson improvements
2023-10-19 12:47:42 +02:00
Ivan Molodetskikh
ed486bf3c7 CI: Add basic meson build test 2023-10-19 14:26:17 +04:00
Ivan Molodetskikh
7a2ce93998 meson: Generate pkgconfig file
Lets multiple projects use the same Tracy library.
2023-10-19 13:31:39 +04:00
Ivan Molodetskikh
170a07c46b meson: Fix header install dir 2023-10-19 13:28:29 +04:00
Ivan Molodetskikh
e93cf6d08a meson: Propagate defines to dependents
This way they don't have to set them manually.
2023-10-19 13:26:32 +04:00
Ivan Molodetskikh
6796c6fd91 meson: Remove tracy_dep_dynamic
Seems unused.
2023-10-19 13:26:32 +04:00
Ivan Molodetskikh
8ae29c0329 meson: Remove duplicate include 2023-10-19 13:26:32 +04:00
Bartosz Taudul
aae4d25f7b
Merge pull request #639 from martty/patch-1
Correct load method for Vk instance extension symbol
2023-10-18 13:08:41 +02:00
Marcell Kiss
69ba216245 correct load method Vk instance extension symbol 2023-10-17 23:23:13 +01:00
Bartosz Taudul
5c15866771
Merge pull request #638 from neheb/patch-1
fix compilation for Ubuntu MinGW
2023-10-17 11:31:43 +02:00
Rosen Penev
470b0934a6
fix compilation for Ubuntu MinGW
version had to be set to 7 minimum.
2023-10-16 19:41:20 -07:00
Bartosz Taudul
37aff70dfa
Release 0.10.0. 2023-10-16 20:59:38 +02:00
Bartosz Taudul
93537dff33
Merge pull request #636 from ids1024/xdg-decoration
wayland: Fix use of xdg-decoration protocol
2023-10-09 23:56:42 +02:00
Bartosz Taudul
757362f782
Merge pull request #603 from slomp/slomp/d3d11-refactor
refactoring of the D3D11 back-end
2023-10-09 23:56:20 +02:00
Ian Douglas Scott
8fe6c39bb5 wayland: Fix use of xdg-decoration protocol
`zxdg_toplevel_decoration_v1` isn't a global, so the code handling it as
one wasn't doing anything. Instead,
`zxdg_decoration_manager_v1_get_toplevel_decoration` returns it.

This fixes the behavior for compositors that support server-side
decoration, but do not default to it until explicitly requested by the
client.
2023-10-09 14:32:42 -07:00
Bartosz Taudul
009cc92320
Update ImGui to 1.89.9 + docking. 2023-10-09 23:30:57 +02:00
Bartosz Taudul
a762cc0013
Update nfd to 1.1.0. 2023-10-09 23:14:55 +02:00
Bartosz Taudul
03fdb3402d
Update xxhash to 0.8.2. 2023-10-09 23:11:30 +02:00
Bartosz Taudul
e2fec4f27f
Update getopt_port to 6ad8cc105. 2023-10-09 22:38:04 +02:00
Bartosz Taudul
52721a6bf0
Add Zen4 EPYC CpuId. 2023-10-09 22:34:44 +02:00
Bartosz Taudul
0080eaac42
Merge pull request #635 from slomp/slomp/apple-delayed-init-fix
eliminate "already defined" warning when passing TRACY_DELAYED_INIT to the compiler on Apple clients
2023-10-09 22:26:04 +02:00
Marcos Slomp
ded5b81fa4 eliminate "already defined" warning when passing TRACY_DELAYED_INIT to the compiler on Apple clients 2023-10-09 13:24:54 -07:00
Bartosz Taudul
434a27b85d
Fix linking on win32. 2023-10-08 20:36:16 +02:00
Bartosz Taudul
e77ce12093
Update NEWS. 2023-10-07 01:42:35 +02:00
Bartosz Taudul
2c18097bf9
Symbol history walking. 2023-10-07 01:28:10 +02:00
Bartosz Taudul
2a6a082c93
Maintain a history of viewed symbols. 2023-10-07 01:12:16 +02:00
Bartosz Taudul
5e31910510
Merge pull request #633 from YaLTeR/fix-meson-nopsleds
Fix meson nopsleds option
2023-10-06 11:07:14 +02:00
Ivan Molodetskikh
91671ab21a Fix meson nopsleds option
It was missing from meson_options.txt breaking the build, and had an
outdated name.
2023-10-06 10:56:35 +04:00
Bartosz Taudul
da1bc2b60e
Merge pull request #597 from Keno/kf/noplrdtsc
Use patchable rdtsc sequence to avoid slowdowns under rr
2023-09-24 21:55:11 +02:00
Bartosz Taudul
855fd299ea
Merge pull request #600 from slomp/slomp/d3d12-refactor
Refactoring of the D3D12 back-end
2023-09-24 21:51:58 +02:00
Bartosz Taudul
60a3a85069
Merge pull request #624 from slomp/slomp/udp-broadcast-fix
Fixes around UDP broadcast
2023-09-21 20:29:32 +02:00
Marcos Slomp
83b52d9a20
fix socket reuse logic in UdpListen::Listen() 2023-09-20 21:47:44 -07:00
Keno Fischer
5417227e83 Use patchable rdtsc sequence to avoid slowdowns under rr
We (Julia) ship both support for using tracy to trace julia applications,
as well as using `rr` (https://github.com/rr-debugger/rr) for record-replay debugging.
After our most recent rebuild of tracy, users have been reporting signfificant performance
slowdowns when `rr` recording a session that happens to also load the tracy library
(even if tracing is not enabled). Upon further examination, the recompile happened
to trigger a protective heuristic that disabled rr's patching of tracy's use of
`rdtsc` because an earlier part of the same function happened to look like a
conditional branch into the patch region. See https://github.com/rr-debugger/rr/pull/3580
for details. To avoid this issue occurring again in future rebuilds of tracy,
adjust tracy's `rdtsc` sequence to be `nopl; rdtsc`, which (as of of the
linked PR) is a sequence that is guaranteed to bypass this heuristic
and not incur the additional overhead when run under rr.

This functionality is kept behind a compile-time flag `TRACY_PATCHABLE_NOPSLEDS`
in order to avoid polluting the instruction cache unnecessarily.
2023-09-20 20:21:40 -04:00
Marcos Slomp
996987b966 scoping 2023-09-11 12:59:48 -07:00
Marcos Slomp
7b2acd2c6d improved error reporting 2023-09-11 12:53:42 -07:00
Marcos Slomp
42b088d085 Collect pending timestamps upon context destruction 2023-09-11 12:46:03 -07:00
Marcos Slomp
2e3ae95882 reworking TracyD3D12 macros 2023-09-11 12:28:07 -07:00
Marcos Slomp
f9d36060df reworking clock calibration 2023-09-11 12:08:15 -07:00
Marcos Slomp
6454b0bd65 removing windows/com header bloat 2023-09-11 12:07:42 -07:00
Marcos Slomp
cf38d6a102 reworking context id initialization 2023-09-11 11:56:52 -07:00
Bartosz Taudul
0341819fbd
Merge pull request #620 from gan74/master
Fixed Vulkan context running out of queries after 64k
2023-09-11 20:56:19 +02:00
Marcos Slomp
4f42a75df2 compressing redundant code 2023-09-11 11:53:33 -07:00
gan74
b979a3d26f Fixed Vulkan context running out of queries after 64k 2023-09-11 20:51:42 +02:00
Bartosz Taudul
1ed4b71afc
Merge pull request #619 from gan74/master
Fixed Vulkan query id generation not being thread safe
2023-09-11 15:41:41 +02:00
gan74
2153973abe Fixed Vulkan query id generation not being thread safe 2023-09-11 15:12:58 +02:00
Bartosz Taudul
73da891805
Remove std:: qualifier from size_t. 2023-09-11 11:33:40 +02:00
Bartosz Taudul
08a36e8dfd
Merge pull request #609 from xhebox/master
adapt libbacktrace to musl
2023-09-10 13:31:48 +02:00
xhe
4e771b2da0 adapt libbacktrace to musl
Signed-off-by: xhe <xw897002528@gmail.com>
2023-09-10 19:26:38 +08:00
Bartosz Taudul
e23aa01d51
Merge pull request #612 from slomp/slomp/d3d12-tabs-to-spaces
D3D12 back-end: converting tabs to spaces
2023-09-09 23:29:12 +02:00
xyz1001
30fb2b5f89
Fix two bugs (#615)
* Fix wrong check for wcstombs return value
* Fix memory leak when call GetThreadDescription
2023-09-08 14:02:55 +02:00
Bartosz Taudul
95e4e01b10
Merge pull request #617 from VirtualGeo/warning_fix
Remove warning (unused parameters)
2023-09-07 11:27:26 +02:00
Vincent Loppin
98de2ed1c4 Remove warning (unused parameters) 2023-09-07 10:06:42 +02:00
Marcos Slomp
393ea938c9 converting tabs to spaces 2023-09-06 08:47:57 -07:00
Bartosz Taudul
4e83aa3818
Merge pull request #611 from Geod24/tracy_demangle_fix
Fix and test TRACY_DEMANGLE for TracyClient
2023-09-06 10:51:44 +02:00
Mathias Lang
c6d9741136 Fix and test TRACY_DEMANGLE for TracyClient
The configuration wasn't tested and stopped compiling.
This fixes it and adds a test to ensure it doesn't break again.
2023-09-06 01:28:58 +02:00
Marcos Slomp
fc33fc010b typo 2023-08-31 13:09:34 -07:00
Marcos Slomp
2bdf0ee75d more power-efficient busy-wait 2023-08-30 09:09:46 -07:00
Marcos Slomp
bac06853fe reworking the TracyD3D11 macros 2023-08-30 09:02:01 -07:00
Marcos Slomp
dcd34397bd refactoring of the D3D11 back-end 2023-08-28 14:15:06 -07:00
Bartosz Taudul
f15de19fda
Merge pull request #601 from fabioarnold/master
Fix macOS DPI scaling
2023-08-23 13:24:47 +02:00
Fabio Arnold
ed54848536 Fix macOS DPI scaling 2023-08-23 12:24:22 +02:00
Bartosz Taudul
1491e5d708
Merge pull request #595 from bjornblissing/master
Wrap std::numeric_limits<T>::max() in parenthesis
2023-08-17 14:58:30 +02:00
Björn Blissing
e1b1fd72dc Wrap std::numeric_limits<T>::max() in parenthesis
The windows.h header file defines the macro max. If the max macro is include
it will lead to name collisions with the std::numeric_limits<T>::max() function.

One solution is to define NOMINMAX before the inclusion of windows.h.
However, that might be a demanding task for a large codebase. Defining the
NOMINMAX as global define may also break previous code.

Another to solution to the problem is to wrap the numeric_limits function in
parenthesis to instruct the compiler to treat it as a function and not a macro.

This commit wraps the std::numeric_limits<T>::max() calls in the public
interfacing header files, with parenthesis.
2023-08-17 10:03:52 +02:00
Bartosz Taudul
84eff4b05d
Merge pull request #594 from menduz/master-1
Fix mac compile for latest macos SDK
2023-08-16 11:14:46 +02:00
menduz
e05545b04a
Fix mac compile for latest macos SDK
Following 3feb2473a2, `mach_vm.h` seems to have been deleted
2023-08-15 21:00:46 -03:00
Bartosz Taudul
c689e9e0aa
Adjust language to no longer specify "all cores". 2023-08-05 12:08:29 +02:00
Bartosz Taudul
296f30a9c5
Reduce number of worker threads used for render tasks.
Number of cores -> number of worker threads:

1 -> 0
2 -> 0
3 -> 0
4 -> 1
5 -> 1
6 -> 2
7 -> 2
8 -> 3
9 -> 3
10 -> 4
11 -> 4
12 -> 5
13 -> 5
14 -> 6
15 -> 6
16 -> 7
17 -> 7
18 -> 8
19 -> 8
20 -> 9
21 -> 9
22 -> 10
23 -> 10
24 -> 11
25 -> 11
26 -> 12
27 -> 12
28 -> 13
29 -> 13
30 -> 14
31 -> 14
32 -> 15
2023-08-05 12:01:36 +02:00
Bartosz Taudul
47b724a903
Merge pull request #590 from clibequilibrium/patch-1
Added binding links to the README.md
2023-07-31 16:39:33 +02:00
Alexander
8110cb20cc
Added binding links to the README.md 2023-07-31 09:47:04 -04:00
Bartosz Taudul
1eafeea1a9
Merge pull request #588 from dmirys/fix-tracy-no-callstack
Fix compilation for the case of using TRACY_NO_CALLSTACK
2023-07-31 12:21:55 +02:00
Ястребков Дмитрий Ирикович
de45af63cc Fix compilation for the case of using TRACY_NO_CALLSTACK 2023-07-31 11:40:12 +07:00
Bartosz Taudul
0e26b9e53f
Merge pull request #583 from jjcasmar/master
Export thread id data in CSV
2023-07-19 14:21:35 +02:00
Juan Jose Casafranca
3d723299b0 Export thread id data 2023-07-19 14:01:27 +02:00
Bartosz Taudul
18f37ec52f
Merge pull request #581 from Christian-Prather/feature/cmake-versioning
Added cmake versioning and removed hardcoded share dir path
2023-07-17 19:02:24 +02:00
Christian Prather
a49af31188 Added cmake versioning and removed hardcoded share dir path 2023-07-17 10:55:46 -06:00
Bartosz Taudul
6c6ec00251
Handle failures when loading connection history. 2023-06-29 23:59:54 +02:00
Bartosz Taudul
57bd63dab6
Show trace description/filename on titlebar. 2023-06-29 23:53:37 +02:00
Bartosz Taudul
0cb6d8588b
Merge pull request #578 from theblackunknown/machizaud/fix-missing-headers
Couple of fixes
2023-06-23 15:02:22 +02:00
Andréa MACHIZAUD
cb30c4eb3e Fix missing TracyClient headers 2023-06-23 14:57:48 +02:00
Andréa MACHIZAUD
47843918f4 Fix missing entries in tracy/TracyVulkan.hpp 2023-06-23 14:56:53 +02:00
Bartosz Taudul
dcc7c24132
Merge pull request #576 from Light7734/patch-1
fix: add missing #endif in 'TracyVulkan.hpp'
2023-06-22 11:34:00 +02:00
Light7734
b9eb5f6bef
fix: add missing #endif in 'TracyVulkan.hpp' 2023-06-22 09:31:33 +00:00
Bartosz Taudul
cf0e6b610b
Update NEWS. 2023-06-10 13:37:01 +02:00
robertblaketaylor
1b65a87c32
Support use of dynamic vulkan symbols (#570) 2023-06-09 12:48:30 +02:00
Bartosz Taudul
2b191e157e
Fix early exit not initializing values used later on. 2023-06-06 17:46:49 +02:00
Bartosz Taudul
c57b8994f6
Reduce required version of wl_seat protocol to 5.
The latest wl_seat protocol version is 9, but the last addition was made
to it in version 5. Wayland is stupid.
2023-05-25 18:48:45 +02:00
Bartosz Taudul
2759f96c0e
Add headers required on FreeBSD. 2023-05-23 23:48:48 +02:00
Bartosz Taudul
c00d8c6211
FreeBSD has 64-bit stat with no need for stat64. 2023-05-23 23:41:39 +02:00
Bartosz Taudul
4e1b198380
FreeBSD has alloca in stdlib.h. 2023-05-23 23:38:34 +02:00
Bartosz Taudul
eca841dfe3
Properly call make from within makefiles. 2023-05-23 22:42:53 +02:00
Bartosz Taudul
6b587e61de
Ignore obj files. 2023-05-22 21:09:38 +02:00
Bartosz Taudul
7299b49dab
Merge pull request #563 from spnda/fix_missing_vulkan_macro
Fix: Missing TracyVkContextHostCalibrated overload with Tracy disabled
2023-05-21 21:50:13 +02:00
sean
ca61a1350a
Fix: Missing TracyVkContextHostCalibrated overload with Tracy disabled 2023-05-21 21:47:25 +02:00
Bartosz Taudul
f3d3108d5f
Merge pull request #562 from fran6co/missing_dep
fix missing dependendency on install
2023-05-18 12:11:01 +02:00
Francisco Facioni
baf0e69a13 fix missing dependendency on install 2023-05-18 09:39:10 +01:00
Bartosz Taudul
c31bda6e8c
Merge pull request #561 from KristofferC/kc/divide_zero_csvexport
prevent divding by zero `csvexport` when number of zones is 1
2023-05-17 14:44:54 +02:00
KristofferC
1fc33b9389 prevent divding by zero when number of zones is 1 in csvexport 2023-05-17 14:21:10 +02:00
Bartosz Taudul
c79154c87b
Extract processing client broadcast messages to a separate function. 2023-05-07 16:11:42 +02:00
Bartosz Taudul
b072dbcdc6
Fix TaskDispatch on wasm. 2023-05-07 16:11:18 +02:00
Bartosz Taudul
64daca9f79
Disable LTO on wasm.
wasm-ld: error: /home/wolf/.emscripten_cache/sysroot/lib/wasm32-emscripten/lto/libc-mt.a(ntohs.o): attempt to add bitcode file after LTO.
wasm-ld: error: /home/wolf/.emscripten_cache/sysroot/lib/wasm32-emscripten/lto/libc-mt.a(htonl.o): attempt to add bitcode file after LTO.
2023-05-07 16:10:59 +02:00
Bartosz Taudul
72cfa3e0d1
Fix copy pasta. 2023-05-04 15:16:46 +02:00
Bartosz Taudul
c75f01c90e
Merge pull request #557 from KristofferC/kc/filter_user
allow filtering zones in Zone finder based on the user text
2023-05-02 17:46:27 +02:00
Kristoffer
3285c8c960 formatting 2023-05-02 11:25:42 +02:00
Bartosz Taudul
bd2f903c08
Add persistent target FPS option. 2023-05-01 19:09:27 +02:00
Bartosz Taudul
3150a48561
Update NEWS. 2023-05-01 15:50:20 +02:00
Bartosz Taudul
ba41255ccc
Adjust wording. 2023-05-01 15:48:33 +02:00
Bartosz Taudul
d6c5d3f6db
Don't enforce creating at least one worker thread in TaskDispatch.
Everything can be confined to a single thread that does job dispatch,
and then waits for the jobs to finish. TaskDispatch has always executed
outstanding work during this wait, so no workers are needed.
2023-05-01 15:44:27 +02:00
Bartosz Taudul
58a6f703af
Update NEWS. 2023-05-01 15:32:16 +02:00
Bartosz Taudul
555b3628ee
Expose configuration options in the UI. 2023-05-01 15:32:16 +02:00
Bartosz Taudul
b68ada2abd
Load/save global config. 2023-05-01 15:13:58 +02:00
Bartosz Taudul
efce727ad4
Add extern "C" to ini.h. 2023-05-01 15:13:00 +02:00
Bartosz Taudul
331c2bd7c0
Configure number of threads in TimelineController. 2023-05-01 14:41:51 +02:00
Bartosz Taudul
a2d470690f
Pass global config to View. 2023-05-01 14:41:38 +02:00
Bartosz Taudul
1dd0341cff
Add global configuration struct. 2023-05-01 14:40:31 +02:00
Bartosz Taudul
cbabb5aa22
Add ini to list of used libraries. 2023-05-01 14:14:34 +02:00
Bartosz Taudul
f68be9bfc3
Add ini to project file. 2023-05-01 14:12:34 +02:00
Bartosz Taudul
2c227af4f3
Add rxi's ini sources.
https://github.com/rxi/ini
13a254c9e38def8924a83badfea5eda5a01b9295
2023-05-01 14:08:28 +02:00
Bartosz Taudul
9443544d80
Update speedup. 2023-05-01 14:06:07 +02:00
Bartosz Taudul
96d1a1b0e8
Merge pull request #558 from KristofferC/kc/doc_ext
give a hint towards `__attribute__((cleanup)` for RAII type behavior in C
2023-05-01 14:05:14 +02:00
Kristoffer
dc30ed2eaf give a hint towards __attribute__((cleanup) for RAII type behavior in C 2023-05-01 13:55:35 +02:00
Kristoffer
73c83906b6 make the histogram take into account filtered zones 2023-05-01 13:31:21 +02:00
Kristoffer
6c5029af78 fix id collision in clear button 2023-05-01 13:13:37 +02:00
Bartosz Taudul
993c78f045
Fix thread context switch offset. 2023-05-01 12:50:48 +02:00
Bartosz Taudul
5019f7d2b4
Force inline GetZoneEnd's fast exit path. 2023-05-01 01:28:32 +02:00
Bartosz Taudul
2e9d8f8215
Check if external threads are local.
For some unknown reason, local threads may be attributed to an external
process (at least when profiling on Windows). This causes some problems,
for example the CPU usage graph may show that CPU is pegged by some other
program, when it reality it is the profiled program that uses the CPU time.

Workaround by checking first, if the thread id is known to be local by the
profiler, i.e. if there were user-generated events originating from it.

This still leaves other things, such as the CPU data list, being wrong,
but the CPU data is meant to show raw TID -> PID mapping. If the source
data is wrong, there's not much to fix here.
2023-04-30 13:55:49 +02:00
Bartosz Taudul
0f0ac2d6c5
No longer need glGenerateMipmap. 2023-04-29 13:11:16 +02:00
Bartosz Taudul
e1e4699a52
Load custom mip chain for zigzags. 2023-04-29 13:10:58 +02:00
Bartosz Taudul
657bf7d44c
Add images for more proper zigzag mip chain.
1x1 and 2x2 paths are 16 px wide.
4x4 path is 8 px wide.
8x8 path is 4 px wide.
16x16 path is 2 px wide.
32x32 path is 1.5 px wide.
2023-04-29 12:47:29 +02:00
Kristoffer
ef68f3139f allow filtering zones in Zone finder based on the user text 2023-04-28 16:54:29 +02:00
Bartosz Taudul
b83cb3f2ce
Don't use hacks to determine end time. 2023-04-28 00:00:20 +02:00
Bartosz Taudul
474dc6945e
Draw zigzags using bitmaps. 2023-04-27 23:17:35 +02:00
Bartosz Taudul
62ec968f24
Load zigzag texture. 2023-04-27 23:17:34 +02:00
Bartosz Taudul
42aeece7fd
Allow generating texture mip maps. 2023-04-27 23:17:34 +02:00
Bartosz Taudul
d131f22354
Special-case creating zigzag texture. 2023-04-27 23:17:34 +02:00
Bartosz Taudul
383f1ea8f1
Update OpenGL loader. 2023-04-27 23:17:34 +02:00
Bartosz Taudul
f7b12e2dda
Add zigzag bitmap. 2023-04-27 23:17:34 +02:00
Bartosz Taudul
52e3ae719d
Remove missed plot vector sorting during draw. 2023-04-27 17:36:11 +02:00
Bartosz Taudul
082beb66c9
Update NEWS. 2023-04-26 01:14:31 +02:00
Bartosz Taudul
e42e566dae
Error indicators are no more. 2023-04-26 00:54:09 +02:00
Bartosz Taudul
5f66cd8718
Don't use delay and resolution when processing GPU zones. 2023-04-26 00:50:13 +02:00
Bartosz Taudul
745ca83de6
PreprocessLocks() doesn't use yPos. 2023-04-26 00:47:50 +02:00
Bartosz Taudul
798249c81c
Remove error indicators for CPU zones. 2023-04-26 00:46:45 +02:00
Bartosz Taudul
72b1ff6477
Early exit on empty plots. 2023-04-25 00:35:53 +02:00
Bartosz Taudul
6aa9169901
Reduce number of plot samples from 1024 to 256.
Having 1024 samples proved to be too slow.
2023-04-25 00:27:17 +02:00
Bartosz Taudul
3811c8ace4
Remove redundant check.
There is already check for zoneFree being non-nullptr, so it makes no sense
to check zoneAlloc for that again, if it has to match zoneFree.
2023-04-25 00:04:59 +02:00
Bartosz Taudul
c8c6646f52
Simplify condition. 2023-04-25 00:03:48 +02:00
Bartosz Taudul
88cb43ad84
Don't write what is never read. 2023-04-25 00:00:30 +02:00
Bartosz Taudul
fa815f3c3b
Remove redundant check. 2023-04-24 23:57:27 +02:00
Bartosz Taudul
def30228c9
Draw plots using preprocessed draw lists. 2023-04-24 23:28:29 +02:00
Bartosz Taudul
96800a2753
Do not merge small groups of plot points (up to three). 2023-04-24 23:28:29 +02:00
Bartosz Taudul
616992a6d5
Do not include DPI scaling when grouping plot points. 2023-04-24 23:28:29 +02:00
Bartosz Taudul
102bb9f8a8
Include before-start plot item, so that the plot doesn't begin abruptly. 2023-04-24 23:28:28 +02:00
Bartosz Taudul
8eb2cc83b3
Push plot draw list to DrawPlot(). 2023-04-24 23:28:28 +02:00
Bartosz Taudul
8f5022c3c8
Calculate draw lists for plots. 2023-04-24 23:28:28 +02:00
Bartosz Taudul
0217c06377
Cosmetics. 2023-04-24 23:28:28 +02:00
Bartosz Taudul
396d4f6f3c
Merge pull request #555 from nehasharan/nehasharan/csvexport_messages
Added an option to print out "messages" while exporting a .trace file to CSV using "csvexport" utility
2023-04-20 23:46:57 +02:00
Neha Sharan
534baa829d correcting indentation 2023-04-20 14:27:15 -07:00
Bartosz Taudul
33c3d8229b
Add clang-tidy config. 2023-04-20 22:48:29 +02:00
Bartosz Taudul
ac29cffd3a
Fix assert condition. 2023-04-20 21:41:15 +02:00
Neha Sharan
518fd6ec79 cosmetic change 2023-04-20 10:09:13 -07:00
Neha Sharan
5acf66a2d4 Added an option to print out messages while exporting a .trace file to CSV using csvexport utility 2023-04-19 12:44:43 -07:00
Bartosz Taudul
7797557e8c
Don't pass memname parameter to functions handling allocation changes. 2023-04-16 18:12:14 +02:00
Bartosz Taudul
38b7aab4ef
Remove unused parameters from various payload handling functions. 2023-04-16 18:08:48 +02:00
Bartosz Taudul
3b00e55235
Rename IsThreadStringRetrieved -> IsFailureThreadStringRetrieved.
IsThreadStringRetrieved() interface suggested that it can be used for
checking any thread state, as it had an uint64_t id parameter.

The implementation ignored this parameter and checked the status of
failure thread only. This was never an issue because the code using
this function was only checking for the failure thread state.

Fixed by renaming the function to explicitly state what it does and
removing the thread id parameter.
2023-04-16 17:49:21 +02:00
Bartosz Taudul
b64bab197a
No need for GetZoneName() with GpuEvent + srcloc parameters. 2023-04-16 17:46:15 +02:00
Bartosz Taudul
08e6248299
CalcZoneTimeDataImpl() doesn't need zone parameter. 2023-04-16 17:40:16 +02:00
Bartosz Taudul
8d565e46d6
HandleTimelineMouse() doesn't need pxns parameter. 2023-04-16 17:36:04 +02:00
Bartosz Taudul
dec4713854
ListMemData() doesn't use id parameter. 2023-04-16 17:30:53 +02:00
Bartosz Taudul
adb2f9a664
GetFrameTreeItemNoGroup() doesn't need worker paramater. 2023-04-16 17:23:19 +02:00
Bartosz Taudul
31b3fcd1fe
View::InitTextEditor() doesn't need font parameter. 2023-04-16 17:21:03 +02:00
Bartosz Taudul
1c13c1ee8f
ThreadCompress::Load() doesn't need fileVer. 2023-04-16 17:17:07 +02:00
Bartosz Taudul
f60e51c91b
Fix std::move() usage. 2023-04-16 16:47:47 +02:00
Bartosz Taudul
a0221c8660
Pass function objects through const references. 2023-04-16 16:44:18 +02:00
Bartosz Taudul
778d0cb3fb
Socket::ReadUpTo() doesn't support timeouts. 2023-04-16 12:19:48 +02:00
Bartosz Taudul
72dfab80f8
Update ImGui to 1.89.5 + docking. 2023-04-16 00:22:05 +02:00
Bartosz Taudul
5aaa4fcaf7
Use draw list data to draw locks. 2023-04-15 22:56:44 +02:00
Bartosz Taudul
788d9b77fc
Use proper start time to determine if break combining locks.
Without this correction the code would combine all lock regions according
to the minimum visibility range rules, and assign the combined area the
highest lock state within all items. This could produce quote long combined
lock regions, where apparently lock contention happened.

Combined lock regions should instead be split to show exactly where the
lock contention is present. Combining is still performed here, but only
within the minimum visibility range.

This new behavior was also present previously, but was mistakenly omitted
during code refactor.
2023-04-15 22:56:44 +02:00
Bartosz Taudul
e68214a88a
Change LockState to bitmask. 2023-04-15 22:56:44 +02:00
Bartosz Taudul
f7a8998663
Push locks draw lists to DrawThread(). 2023-04-15 22:56:44 +02:00
Bartosz Taudul
7f301dfec0
Precalculate draw lists for locks. 2023-04-15 22:56:44 +02:00
Bartosz Taudul
9b270c8e11
Another fix for determining if there's CPU usage data to draw. 2023-04-15 22:56:44 +02:00
Bartosz Taudul
f0acb73d09
Add accessor for active lock info window lock id. 2023-04-15 22:56:43 +02:00
Bartosz Taudul
d737b911e9
Make View::Vis() public. 2023-04-15 22:56:43 +02:00
Bartosz Taudul
6e815d13a0
Move common lock helper functions to a separate header. 2023-04-15 22:56:43 +02:00
Bartosz Taudul
4c0e6fe3ca
Merge pull request #544 from simplyWiri/timeline-scrolling-tweak
Clamp scrolling to the difference between the deepest zone near the m…
2023-04-13 11:35:08 +02:00
Bartosz Taudul
f17b44c212
Take DPI scaling into account when drawing thread migration lines. 2023-04-07 22:37:23 +02:00
Bartosz Taudul
492e6611b9
No need to perform domain conversion.
Pixel values will be needed anyways later on. It doesn't make sense to
perform comparison in time domain here.
2023-04-07 22:37:23 +02:00
Bartosz Taudul
d0ffca56bf
Fix logic determining if there's CPU core usage data to draw. 2023-04-07 22:37:22 +02:00
Bartosz Taudul
1b824797a9
Do not project running regions end time to last time.
Just display known running regions, keeping the unended ones infinitely
collapsed. This makes the CPU core usage graph possibly display wrong
data at the end of capture. Note that this behavior was also present in
previous releases.
2023-04-07 22:37:22 +02:00
Bartosz Taudul
1ff9e0012b
Add a note why context switches only have coarse visibility check. 2023-04-05 19:39:39 +02:00
Bartosz Taudul
51f832c031
Don't recalculate sty. 2023-04-05 19:24:58 +02:00
Bartosz Taudul
f48415315a
Build samples draw list only if visible. 2023-04-05 19:03:40 +02:00
Bartosz Taudul
a9ee4c499e
Build messages draw list only if visible. 2023-04-05 18:55:23 +02:00
Bartosz Taudul
4b8ac41345
Calculate CPU data draw lists only if visible. 2023-04-05 18:45:00 +02:00
Bartosz Taudul
bb9219384f
Do not recalculate sty. 2023-04-05 18:44:36 +02:00
Bartosz Taudul
f2a2669ca8
Decouple CPU graph availability from having the draw data. 2023-04-05 18:21:12 +02:00
Bartosz Taudul
9500add83b
Push yPos to TimelineItem::Preprocess(). 2023-04-05 18:07:09 +02:00
Bartosz Taudul
77402eb9c2
libbacktrace: minor fixes for zstd decompression (cdb64b68) 2023-04-05 17:24:19 +02:00
Bartosz Taudul
0f19727dc6
libbacktrace: change PC variables from uint64_t to uintptr_t (afe2967c) 2023-04-05 17:23:04 +02:00
Bartosz Taudul
eb8f485f99
Update nfd-extended to 1.0.2. 2023-04-05 17:19:48 +02:00
Bartosz Taudul
ab6c492117
Update zstd to 1.5.5. 2023-04-05 17:16:24 +02:00
Bartosz Taudul
856027a27d
Merge pull request #545 from topolarity/fix-no-sampling
linux: respect `TRACY_NO_SAMPLING` for sys-tracing
2023-04-04 23:29:08 +02:00
Cody Tapscott
6249999153 linux: respect TRACY_NO_SAMPLING for sys-tracing
This compile-time flag was being ignored on Linux. This change adds
gating for software-sampled stack trace sampling following the same
pattern as other `TRACY_NO_SAMPLE_*` options.

If `TRACY_NO_SAMPLING=1` is provided as an environment variable,
software stack sampling is also disabled.
2023-04-04 17:22:31 -04:00
Bartosz Taudul
2b7b79352b
Parallelize calculation of per-CPU context switches. 2023-04-02 22:10:22 +02:00
simplyWiri
a8b42488ad Clamp scrolling to the difference between the deepest zone near the mouse, and the height of the window.
This prevents from unncessary scrolling when the trace does not exceed the size of the screen
2023-04-02 19:01:58 +10:00
Bartosz Taudul
a4c200d242
Update manual. 2023-03-30 21:56:02 +02:00
Bartosz Taudul
df1b3e7feb
Update NEWS. 2023-03-30 21:52:29 +02:00
Bartosz Taudul
e2e55a77b5
Add TracySetProgramName() macro to set broadcast contents. 2023-03-30 21:51:00 +02:00
Bartosz Taudul
cade1d9705
Fix library/unix cleanup. 2023-03-30 21:30:25 +02:00
Bartosz Taudul
33a640f848
Name worker threads. 2023-03-25 22:14:34 +01:00
Bartosz Taudul
5eebc5d7cf
Preprocess CPU usage.
Things of note: Worker::GetCpuUsage() functionality was moved to
TimelineItemCpuData::PreprocessCpuUsage().
2023-03-25 17:55:15 +01:00
Bartosz Taudul
dcf27f4989
Provide small font height in TimelineContext. 2023-03-25 17:25:10 +01:00
Bartosz Taudul
c0136dbdcc
Don't do unnecessary work if items are not visible. 2023-03-25 16:54:38 +01:00
Bartosz Taudul
13b31db561
Cosmetics. 2023-03-25 16:54:38 +01:00
Bartosz Taudul
e3ec455aba
Decouple check for existence from building draw lists.
We need to know if samples, context switches and messages are present to be
able to correctly calculate thread height. However, if the thread is not
visible, it is not necessary to provide a list of items to draw.
2023-03-25 16:52:27 +01:00
Bartosz Taudul
96d60ce626
Change GetNextFrameHeight() to GetHeight().
The GetNextFrameHeight() name correctness was very situational. It was
often used in the meaning of "get current frame height".
2023-03-25 15:12:33 +01:00
Bartosz Taudul
7ec68f8b52
Push item visibility to Preprocess(). 2023-03-25 15:10:58 +01:00
Bartosz Taudul
8c1b519fa1
Fix wasm cleanup. 2023-03-25 12:26:28 +01:00
Bartosz Taudul
bea3c0f4d1
Don't pass -march=native to emcc. 2023-03-25 12:25:40 +01:00
Bartosz Taudul
241fa68708
Make embed.tracy downloadable. 2023-03-25 12:20:36 +01:00
Bartosz Taudul
ecdecb7012
Ignore wasm build results. 2023-03-25 12:07:53 +01:00
Bartosz Taudul
8908b68557
Fix lockup in context switch processing. 2023-03-25 00:45:13 +01:00
Bartosz Taudul
1e63406ac7
Replace previous iterator manipulation with a boolean. 2023-03-25 00:30:44 +01:00
Bartosz Taudul
efa095e25f
Simplify context switch precalculation. 2023-03-25 00:30:44 +01:00
Bartosz Taudul
734753a941
Fix MinVisNs type in messages preprocessing. 2023-03-24 23:15:11 +01:00
Bartosz Taudul
b3e9ede557
Move context switch minpx calculation to rendering code. 2023-03-24 23:10:58 +01:00
Bartosz Taudul
f2700b2786
Remove rather useless check.
The prev == it condition could only fire on the first run of the loop,
and on all subsequent runs prev (=next-1) will never be "it" anymore.

Lack of this condition changes nothing, as the following lines checking
for time distance between next and prev satisfy the same exit condition
(i.e. next-1 will be "it" only if lower_bound does not find anything,
hence next is farther away than MinVisNs).
2023-03-23 22:17:36 +01:00
Bartosz Taudul
e0cc6edbfb
Zone end times must be consistent. 2023-03-23 22:17:33 +01:00
Bartosz Taudul
40e08e9594
Draw messages using precalculated list. 2023-03-23 22:16:47 +01:00
Bartosz Taudul
6c21edd509
Drawing is not finished until function return. 2023-03-23 22:09:19 +01:00
Bartosz Taudul
e321e91c7d
TimelineItemThread can now determine visibility internally. 2023-03-23 21:56:04 +01:00
Bartosz Taudul
a141aafaab
Preprocess thread messages. 2023-03-23 21:47:40 +01:00
Bartosz Taudul
fbc87275e7
Add highlighted message accessor to View. 2023-03-23 21:47:22 +01:00
Bartosz Taudul
b0fb230287
Merge pull request #541 from kklobe/add-meson-version
Add version to meson.build 'project()'
2023-03-23 13:58:43 +01:00
Kirk Klobe
70afa6c62c
update make-build.sh to change meson.build version 2023-03-23 07:55:03 -05:00
Kirk Klobe
0e11b40bb2
add version to meson.build 'project()'
Meson projects which use tracy as a subproject and specify a version for the dependency will fail due to an undefined version number.
2023-03-22 21:06:03 -05:00
Bartosz Taudul
f55d0d0f55
Fix distance calculation in folding.
The folding process starts at the "next" item. The nextTime variable
represents a time point before which everything should be folded, because
all items in that range are smaller than MinVis range.

The lower_bound search finds a new "next" item, which will be beyond the
nextTime range. But nextTime has origin in the previous "next" item, which
may be not the last item in the folding range. If the distance between the
new "next" and the item before is smaller than MinVis, then the new "next"
item is also folded and the folding loop must continue to run.
2023-03-23 00:40:09 +01:00
Bartosz Taudul
aa8175ed47
Include DPI scaling in folding calculations. 2023-03-23 00:39:45 +01:00
Bartosz Taudul
fb032b4f9b
Rewrite CPU zones folding. 2023-03-23 00:17:55 +01:00
Bartosz Taudul
527b5f3311
Rewrite ghost zone folding. 2023-03-23 00:04:12 +01:00
Bartosz Taudul
c75b62e3d6
Rewrite samples folding. 2023-03-22 23:44:23 +01:00
Bartosz Taudul
83ae9868e2
Fix pixel and nanosecond domain mixing. 2023-03-22 22:41:19 +01:00
Bartosz Taudul
80c15c0f9b
Draw samples using precalculated data. 2023-03-22 22:26:20 +01:00
Bartosz Taudul
8bbd50361a
Remove unused variables. 2023-03-22 22:26:19 +01:00
Bartosz Taudul
da6ea47541
Preprocess samples. 2023-03-22 22:26:19 +01:00
Bartosz Taudul
2456ae36bf
Store wait stack in 4 bytes. 2023-03-22 21:55:02 +01:00
Bartosz Taudul
d085f2541a
Fix drawing folded ghost zones. 2023-03-22 20:52:44 +01:00
Bartosz Taudul
a3947fbc57
Use vStart retrieved from ctx. 2023-03-22 20:52:31 +01:00
Bartosz Taudul
1e67c8bce2
Move const out of the loop. 2023-03-22 20:38:43 +01:00
Bartosz Taudul
50ccdc1ef4
Draw thread context switches using precalculated data. 2023-03-22 19:38:58 +01:00
Bartosz Taudul
88f0b9c754
Preprocess thread context switch data. 2023-03-22 19:38:36 +01:00
Bartosz Taudul
060bab357d
Add DrawFinished() to early exit paths. 2023-03-21 02:11:50 +01:00
Bartosz Taudul
e62a383833
Update imgui to 1.89.4 + docking + emscripten glfw fix. 2023-03-20 23:54:46 +01:00
Bartosz Taudul
1e1833edc2
Parallelize timeline item preprocessing. 2023-03-19 18:54:32 +01:00
Bartosz Taudul
66d3c2a472
Draw CPU zones using a precalculated list. 2023-03-19 18:37:27 +01:00
Bartosz Taudul
85d541124e
Inline frames limit was raised to 64 in 7552341ff. 2023-03-19 18:23:04 +01:00
Bartosz Taudul
1d7afbd07e
Calculate which CPU zones to draw beforehand. 2023-03-19 18:23:04 +01:00
Bartosz Taudul
b4893fafb7
Notify TimelineItem when drawing has finished. 2023-03-19 16:07:47 +01:00
Bartosz Taudul
3a2cc0bed0
Allow setting short_ptr pointer. 2023-03-19 15:21:52 +01:00
Bartosz Taudul
6ab4180b5b
Use TimelineContext to draw CPU zones. 2023-03-19 01:14:36 +01:00
Bartosz Taudul
ee5d6f1adb
Use TimelineContext for drawing GPU zones. 2023-03-19 00:28:14 +01:00
Bartosz Taudul
5743bff0af
Use TimelineContext when drawing CPU data. 2023-03-19 00:23:33 +01:00
Bartosz Taudul
26791f55d1
Use TimelineContext data for drawing plots. 2023-03-18 17:11:24 +01:00
Bartosz Taudul
0ecdcbc13c
Move TimelineContext struct definition to a separate header. 2023-03-18 17:03:23 +01:00
Bartosz Taudul
5b3427395e
Add view start and end to TimelineContext. 2023-03-18 17:02:23 +01:00
Bartosz Taudul
0a32929b0b
Move hover flag to TimelineContext. 2023-03-18 16:07:56 +01:00
Bartosz Taudul
c75bec9122
Cosmetics. 2023-03-18 15:59:52 +01:00
Bartosz Taudul
9538fa99ca
Pass yMin, yMax through TimelineContext. 2023-03-15 23:56:57 +01:00
Bartosz Taudul
c81ef177ab
Push timline context to Draw and DrawContents functions. 2023-03-14 02:25:15 +01:00
Bartosz Taudul
b6b6e1edcf
Store common constants in context variable. 2023-03-14 02:25:14 +01:00
Bartosz Taudul
66d8dab925
Preprocess timeline items in controller. 2023-03-14 02:02:50 +01:00
Bartosz Taudul
7dd31ab609
Timeline items may have preprocessing. 2023-03-14 02:02:21 +01:00
Bartosz Taudul
988de5b594
Fix typo. 2023-03-14 01:54:21 +01:00
Bartosz Taudul
fd3d5114e8
Update NEWS. 2023-03-10 01:27:27 +01:00
Bartosz Taudul
7d69103444
Add plot type "power" and Watt format.
Note that this technically breaks backwards compatibility of trace files
for 0.9.2 builds. But, whatever, as it's not yet released.
2023-03-10 01:25:41 +01:00
Bartosz Taudul
23705fd84c
Add a reminder to keep interfaces in sync. 2023-03-10 01:07:06 +01:00
Bartosz Taudul
69855c671f
Process power usage messages. 2023-03-10 01:02:41 +01:00
Bartosz Taudul
2971db21e3
Read and report power usage. 2023-03-10 00:23:09 +01:00
Bartosz Taudul
c3e7157cd5
Detect power domains. 2023-03-10 00:05:18 +01:00
Bartosz Taudul
5e2e5eeefb
Add system power use tracking skeleton. 2023-03-09 22:31:31 +01:00
Bartosz Taudul
f428a5b52b
Fix popup of collapsed items near timeline start.
There are various changes involved into making this work:

1. Zone size (zsz) is no longer clamped to the timeline viewport area.
   This clamping has to be removed to prevent otherwise uncollapsed zones
   from apparently becoming small near the viewport borders. Such a small
   zone would then be collapsed, resulting in unwanted popping.
   Interesingly, only the CPU zones were clamped before. GPU zones were
   not.
2. Iteration over visible zones has to start before the visible timeline
   viewport area. Without this some zones that would be otherwise
   included in the collapsed area (started by a previous zone) may be
   fully visible. This causes child zones to be drawn and produces
   unwanted popping. (At this point threshold for continuing collapsed
   area is greater than threshold for starting it.)
3. Since the iteration now starts before timeline visible area, it may so
   happen that everything found will be in a small slice of timeline that
   is outside the screen. To fix this, the end time of last found item is
   checked against the viewport start time.
   It is always valid to access *(zitend-1), as it is in each case done
   after null set check (it == zitend).

Similar but simpler fix was also applied to per-thread call stack samples.
2023-03-09 00:38:23 +01:00
Bartosz Taudul
7151c6afd9
Add support for configuring plots to C API. 2023-03-08 23:18:36 +01:00
Bartosz Taudul
9d2f3860e7
Update NEWS. 2023-03-05 19:42:20 +01:00
Bartosz Taudul
22661f79de
Merge pull request #532 from spnda/vulkan_host_ops
Add: Alternative Vulkan context constructor
2023-03-05 18:38:07 +01:00
sean
1eb0651255
Note new Vulkan context constructor in documentation 2023-03-05 17:37:32 +01:00
sean
c7ee536209
Add: Alternative Vulkan context constructor 2023-03-05 17:37:22 +01:00
Bartosz Taudul
e77512abe6
Update NEWS. 2023-03-04 23:00:49 +01:00
Bartosz Taudul
107afd78a4
Make collpsed zones gray in source location dynamic color mode.
The reasoning is that you want to use the color to see where a zone of
a particular type is placed. When collapsed zones go back to displaying
thread color, you may mistake such region of collapsed zones for something
they aren't.
2023-03-04 22:54:58 +01:00
Bartosz Taudul
2434514a42
Make view mode heuristic work correctly in on demand mode. 2023-03-04 00:37:38 +01:00
Bartosz Taudul
a8cc3cb06b
Use on demand flag in GetFirstTime(). 2023-03-04 00:33:52 +01:00
Bartosz Taudul
f9449bc938
Only retrieve frame offset internally in GetFrameNumber(). 2023-03-04 00:32:15 +01:00
Bartosz Taudul
8164b776fd
Don't pass GetFrameOffset() results to GetFrameText().
Frame offset can be retrieved internally.
2023-03-04 00:29:00 +01:00
Bartosz Taudul
9155b01ddf
Use on demand flag to determine if need to show missed frames. 2023-03-04 00:25:30 +01:00
Bartosz Taudul
5ebc499f49
Add on demand mode flag accessor. 2023-03-04 00:19:58 +01:00
Bartosz Taudul
e92874c0bb
Save "on demand" flag in traces.
Previously on demand mode was determined by frame offset parameter being
greater than zero. However, if the application is not pumping frames with
FrameMark macro, the frame index will never increase and the frame offset
parameter stay at zero. It is not possible to distinguish on demand traces
from normal ones in this scenario.

Fix by explicitly saving the on demand flag in trace file and employ the
previous logic to set the flag when importing older traces.
2023-03-04 00:11:32 +01:00
Bartosz Taudul
ed79c4f241
Update NEWS. 2023-03-03 22:56:15 +01:00
Bartosz Taudul
dbcffb8c4f
Print active time in the capture utility. 2023-03-03 22:51:04 +01:00
Bartosz Taudul
256905b7e3
Include first time in CPU thread lifetime calculation. 2023-03-03 22:46:25 +01:00
Bartosz Taudul
28199512cd
Create first memory plot data point at first time. 2023-03-03 22:44:25 +01:00
Bartosz Taudul
3ff158c8be
Worker::GetMemoryDefault() is not needed. 2023-03-03 22:40:14 +01:00
Bartosz Taudul
5ff809cc0a
Calculate plot timeline taking active time span into account. 2023-03-03 22:36:04 +01:00
Bartosz Taudul
3ed543a1b7
Dim timeline before first time. 2023-03-03 22:25:07 +01:00
Bartosz Taudul
b7cefe816e
Restrict keyboard navigation to active time span. 2023-03-03 22:23:30 +01:00
Bartosz Taudul
e659c630fd
Calculate statistics percentages relative to active time span. 2023-03-03 22:19:43 +01:00
Bartosz Taudul
fc7bd61576
Calculate CPU data percentages relative to active time span. 2023-03-03 22:18:08 +01:00
Bartosz Taudul
2f49caaa6e
Show only active time span in on-demand mode. 2023-03-03 22:12:33 +01:00
Bartosz Taudul
1f94ab32df
Exclude missing on-demand frames from on-load zoom. 2023-03-03 21:48:34 +01:00
Bartosz Taudul
c91b052c80
Add first time getter. 2023-03-03 21:48:34 +01:00
Bartosz Taudul
b89bfd44f1
Line stats may not exist, even if the line has attributed cost.
One scenario for this to happen is when there's children calls data in the
symbol.
2023-03-01 19:28:58 +01:00
Bartosz Taudul
897aec5b06
Release 0.9.1. 2023-02-26 15:30:03 +01:00
Bartosz Taudul
c53a7f8457
Remove out-of-repository libraries from list in the manual. 2023-02-26 15:24:54 +01:00
Bartosz Taudul
b8c4ce7abb
Update manual. 2023-02-26 15:18:05 +01:00
Bartosz Taudul
8a0b7b59fd
Update NEWS. 2023-02-26 14:42:16 +01:00
Bartosz Taudul
40b648655b
Fix out-of-bounds reference. 2023-02-24 23:06:12 +01:00
Bartosz Taudul
b3186a9b7d
Fix uninitialized variable. 2023-02-24 22:57:14 +01:00
Bartosz Taudul
b0174f2f3a
No privilege elevation is possible on emscripten. 2023-02-20 21:36:18 +01:00
Bartosz Taudul
fad09a452a
Update ImGui to 1.89.3 + docking. 2023-02-14 17:57:14 +01:00
Bartosz Taudul
122f99c042
Merge pull request #524 from Lectem/fixSymbolResolutionWin32
Fix race condition for symbols resolution on windows
2023-02-14 16:04:04 +01:00
Lectem
ecdf6adc32 Fix race condition for symbols resolution on windows
There might have been new modules loaded by another thread between the `SymInitialize` and `EnumProcessModules` calls.
Since we register the enumerated modules into the cache, we need to make sure that symbols for this module are loaded.
The only way to do that is to call `SymLoadModuleEx`, just like we do when finding new modules after `InitCallstack`.
2023-02-14 15:32:37 +01:00
Bartosz Taudul
15ad9aef78
Update manual. 2023-02-10 20:44:38 +01:00
Bartosz Taudul
33bfd64829
Update NEWS. 2023-02-10 20:42:15 +01:00
Bartosz Taudul
55823df56a
Remove support for AT&T assembly syntax. 2023-02-10 20:41:03 +01:00
Bartosz Taudul
0d6fb703b4
Update zstd to 1.5.4. 2023-02-10 20:33:32 +01:00
Bartosz Taudul
69d0510255
Merge pull request #523 from shapr3d/fix_d3d_build
Add missing include in TracyD3D11.hpp
2023-02-10 12:22:05 +01:00
Levente Koncz
f4a5bce28c Add missing include 2023-02-10 12:15:58 +01:00
Bartosz Taudul
3e30d155ac
Merge pull request #522 from john-plate/fix
Fix MSVC compiler warning
2023-02-08 16:39:36 +01:00
John Plate
37bc03fd63 Fix MSVC compiler warning 2023-02-08 13:27:17 +00:00
Bartosz Taudul
9d357430b6
English is hard. 2023-02-01 00:56:31 +01:00
Bartosz Taudul
cc5e97c88d
Bump stb_image.h to 2.28. 2023-01-31 22:55:18 +01:00
Bartosz Taudul
dfc458a8b2
Update NEWS. 2023-01-31 22:45:50 +01:00
Bartosz Taudul
a26df1d810
Merge pull request #519 from tvoeroes/vertical-timeline-rescale-center
Vertical timeline centering
2023-01-31 21:02:51 +01:00
Tomaž Vöröš
645d53f254 More correct shouldUpdateCenterItem. 2023-01-31 20:35:17 +01:00
Tomaž Vöröš
ea1a0299f3 Add switch for vertical centering on/off at compile-time. 2023-01-31 19:48:19 +01:00
Tomaž Vöröš
bca8f28f43 Centering around the mouse pointer. 2023-01-29 19:20:26 +01:00
Tomaž Vöröš
dbefb70db3 Add key to TimelineItem. 2023-01-27 20:00:05 +01:00
Tomaž Vöröš
2df56e9941 Fix off-by-one-frame in timeline item height. 2023-01-27 20:00:05 +01:00
Tomaž Vöröš
7b9b810421 Refactor the use of offset in TimelineItem::Draw() and TimelineController::End(). 2023-01-27 20:00:05 +01:00
Bartosz Taudul
52b6af88ca
Merge pull request #517 from mwl4/linux_compilation_fixes
Linux compilation fixes
2023-01-25 16:08:37 +01:00
mwl4
1439e93a69 Fix compilation on linux: always initialize ScopedZone::m_connectionId to 0.
gcc error:
public/tracy/../client/TracyScoped.hpp:102:9: error: ‘___tracy_scoped_zone.tracy::ScopedZone::m_connectionId’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
         if( GetProfiler().ConnectionId() != m_connectionId ) return;
         ^~
2023-01-25 15:11:49 +01:00
mwl4
789f572332 Fix compilation on linux: use abort() instead of assert( false ).
assert() in release configuration resolves to empty code, while abort() is marked as [[noreturn]] and always is available.

gcc error:
error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]:
public/tracy/../client/../common/TracyAlign.hpp: In function ‘void tracy::SysTraceWorker(void*)’:
public/tracy/../client/../common/TracyAlign.hpp:22:11: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     memcpy( ptr, &val, sizeof( T ) );
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from public/TracyClient.cpp:26,
                 from X.cpp:
public/client/TracySysTrace.cpp:1258:35: note: ‘type’ was declared here
                         QueueType type;
                                   ^~~~
2023-01-25 15:08:51 +01:00
Bartosz Taudul
9788a76473
Merge pull request #516 from pzread/fix-conn-check
Fix connection check for capturing
2023-01-25 13:05:27 +01:00
Che-Yu Wu
ceb474e072 Wait on HasData condition to avoid infinite loop.
Tracy worker resets the IsConnected to false when finishing the
capture. If it finishes too quick, the waiting loop in capture.cpp
might never see IsConnected = true.
2023-01-25 11:23:04 +00:00
Bartosz Taudul
d47122586c
Fix color channel names in source location message. 2023-01-23 01:23:15 +01:00
Bartosz Taudul
6652999a60
Fix color channels names in zone color message. 2023-01-23 01:18:54 +01:00
Bartosz Taudul
eb7c13e7bb
Fix message color component names in the protocol.
Red and blue channels were mislabeled. Otherwise, coding and decoding was
performed correctly, as far as the color channel order described in the manual
is followed by the user.

No change to the binary protocol was made.
2023-01-23 01:07:07 +01:00
Bartosz Taudul
c59413ab56
Query jump and call target addresses.
This enables discovery of target function names (and recursively, their
bodies), even if such function has no samples and is not present in any
callstack.
2023-01-22 02:06:43 +01:00
Bartosz Taudul
baaed68bcf
Merge pull request #511 from nagisa/tracy-fiber-binding-ifdef
move ___tracy_fiber* declarations to under ifdef
2023-01-19 00:59:16 +01:00
Simonas Kazlauskas
5a7a83d307 move ___tracy_fiber* declarations to under ifdef
These functions are only defined when -DTRACY_FIBERS is set. However,
the function is declared regardless of this declaration, which seems
like it could lead to obscure linking errors. I haven’t encountered any
of these specifically, but in my case, this distinction makes it more
difficult to produce correctly auto-generated bindings.
2023-01-19 01:54:26 +02:00
Bartosz Taudul
e4bd88c51f
Update NEWS. 2023-01-17 01:51:30 +01:00
Bartosz Taudul
a2756781c7
Update copyright year. 2023-01-09 00:22:22 +01:00
Bartosz Taudul
2c1b0c6853
Merge pull request #509 from topolarity/count-before-after
Add left/right counts to histogram tooltip
2023-01-07 13:44:52 +01:00
Cody Tapscott
cabfe25333 Add left/right counts to histogram tooltip 2023-01-06 21:37:23 -07:00
Bartosz Taudul
f90336a12f
Update screenshots. 2023-01-05 23:36:01 +01:00
Bartosz Taudul
8a9deb69c8
Fix expand-process separators in CPU data window. 2023-01-05 22:48:07 +01:00
Bartosz Taudul
006bfeaf56
Use fixed-width font to draw addresses. 2023-01-05 22:20:56 +01:00
Bartosz Taudul
ecb4a0527a
Do not retrieve call stacks if sampling is not requested. 2023-01-05 21:45:44 +01:00
Bartosz Taudul
b53acde418
Fix type. 2023-01-05 20:34:50 +01:00
Bartosz Taudul
236bbfa8b1
libbacktrace: unpack literals into output buffer (da7eff2) 2023-01-05 20:31:05 +01:00
Bartosz Taudul
d8fc004bfa
libbacktrace: rewrite and simplify main zstd loop (fd9442f) 2023-01-05 20:29:51 +01:00
Bartosz Taudul
08d403e324
libbacktrace: support zstd decompression (c992dd8) 2023-01-05 20:27:36 +01:00
Bartosz Taudul
096293110b
Update ImGui to 1.89.2 + docking. 2023-01-05 19:15:58 +01:00
Bartosz Taudul
04a428ab29
Merge pull request #506 from spnda/master
Fix: Don't let make_unique initialise data unnecessarily
2023-01-03 14:17:19 +01:00
Bartosz Taudul
d76e3a364a
Cosmetics. 2023-01-03 13:56:56 +01:00
sean
b597ab5a0a
Fix: Don't let make_unique initialise data unnecessarily 2023-01-03 13:09:26 +01:00
Bartosz Taudul
5a3d7b6f56
Update NEWS. 2023-01-01 16:20:35 +01:00
Bartosz Taudul
6c699d293e
Annotate assembly dumps with source line information. 2023-01-01 16:19:37 +01:00
Bartosz Taudul
bb8393c918
Calculate max operand length. 2023-01-01 14:47:10 +01:00
Bartosz Taudul
1945b1bfa0
Change assembly comment character from ; to #.
This makes llvm-mca silent about unknown tokens.
2023-01-01 14:42:50 +01:00
Bartosz Taudul
28eb4a934e
Update manual. 2022-12-30 20:38:29 +01:00
Bartosz Taudul
b8029f7448
Show diff direction and allow reversal. 2022-12-30 20:33:17 +01:00
Bartosz Taudul
166c553af3
Make diff added/deleted files list collapsed by default. 2022-12-30 20:20:52 +01:00
Bartosz Taudul
314b1b48c8
Condense source diff. 2022-12-23 19:56:39 +01:00
Bartosz Taudul
b81d564f66
Add DTL to list of libraries. 2022-12-23 19:40:59 +01:00
Bartosz Taudul
0922dfc7b0
Update NEWS. 2022-12-23 19:40:58 +01:00
Bartosz Taudul
2aee91a142
Update manual. 2022-12-23 19:40:58 +01:00
Bartosz Taudul
1eaebb44cb
Display changes in source files in compare menu. 2022-12-23 19:40:58 +01:00
Bartosz Taudul
205930fd2c
Add file and diff printers. 2022-12-23 19:40:58 +01:00
Bartosz Taudul
5a442f123e
Calculate diff between source files. 2022-12-23 19:40:58 +01:00
Bartosz Taudul
4bb0a1f1ed
Add line splitter. 2022-12-23 19:40:58 +01:00
Bartosz Taudul
cbc85003f7
Add Diff Template Library 1.20. 2022-12-23 19:40:58 +01:00
Bartosz Taudul
bd06d4e104
Build lists of unique source files in comparison menu. 2022-12-23 19:40:58 +01:00
Bartosz Taudul
886456ea44
Load source cache in comparison worker. 2022-12-23 19:40:57 +01:00
Bartosz Taudul
359840bec0
Add source diff radio button to compare menu.
Majority of this commit are whitespace changes.
2022-12-23 19:40:57 +01:00
Bartosz Taudul
c12505c19d
Fix TRACY_NO_CALLSTACK on Windows. 2022-12-22 21:17:31 +01:00
Bartosz Taudul
6e70b7c20b
Push keyboard modifiers to ImGui. 2022-12-22 17:48:14 +01:00
Bartosz Taudul
797d5df850
Push key events to ImGui. 2022-12-22 17:39:30 +01:00
Bartosz Taudul
dff2a6d6c2
Implement XKB text compositing. 2022-12-20 22:19:45 +01:00
Bartosz Taudul
b7affdd92d
Create XKB compose table/state. 2022-12-20 21:55:31 +01:00
Bartosz Taudul
0831b3f301
Push focus events to ImGui. 2022-12-20 17:11:15 +01:00
Bartosz Taudul
170a961d8d
Tweak mouse wheel behavior on Wayland. 2022-12-20 16:54:28 +01:00
Bartosz Taudul
b48a9027dd
Add more packages on CI. 2022-12-20 00:54:08 +01:00
Bartosz Taudul
115f286acf
Update CI libraries list. 2022-12-20 00:49:22 +01:00
Bartosz Taudul
cd4156afe7
Update NEWS. 2022-12-20 00:46:22 +01:00
Bartosz Taudul
58f84379d0
Setup Wayland build. 2022-12-20 00:35:43 +01:00
Bartosz Taudul
aa0e899573
Initialize XKB state. 2022-12-20 00:22:27 +01:00
Bartosz Taudul
7106b0c5ef
Hook no-op keyboard handling. 2022-12-19 23:46:08 +01:00
Bartosz Taudul
3b58f5596d
Detect precise (touchpad) scroll events.
Currently the wheel axis Y change has little impact, as the zoom in/out logic
assumes wheel events are discrete.
2022-12-19 21:26:59 +01:00
Bartosz Taudul
ac87b05dcb
Fix scroll events direction on Wayland. 2022-12-19 21:11:53 +01:00
Bartosz Taudul
7f00ae8c83
Fix mouse buttons order on Wayland. 2022-12-19 21:10:55 +01:00
Bartosz Taudul
16d9491148
Merge pull request #503 from tvoeroes/timeline-animation-tweaks
Timeline animation tweaks
2022-12-19 21:03:18 +01:00
Tomaž Vöröš
1969ef0f43 Reintroduce the vertical scroll-bar reset logic in TimelineController. 2022-12-19 19:05:18 +01:00
Tomaž Vöröš
b4e8e042a8 Fix a code style issue. 2022-12-18 23:30:47 +01:00
Tomaž Vöröš
e4ab6cdaf1 Fix TimelineController height calculation. 2022-12-18 20:45:42 +01:00
Tomaž Vöröš
d6772900ad Get rid of a non-linearity in TimelineItem resizing animation. 2022-12-18 20:09:15 +01:00
Tomaž Vöröš
0cc6bb4ff9 More pleasant TimelineItem resizing parameters. 2022-12-18 20:06:57 +01:00
Tomaž Vöröš
db6acfe9b5 Change resize logic such that TimelineItem instances "don't chase" each other anymore. 2022-12-18 20:06:10 +01:00
Bartosz Taudul
b80ede3ec6
Limit time delta to 0.1s. 2022-12-11 18:01:32 +01:00
Bartosz Taudul
9e6214350c
Support Hi-DPI mouse cursor. 2022-12-11 17:50:05 +01:00
Bartosz Taudul
1f4562e51d
Support Hi-DPI. 2022-12-11 17:43:41 +01:00
Bartosz Taudul
63ba9cccf2
Track max output scale. 2022-12-11 17:29:28 +01:00
Bartosz Taudul
3d42732795
Track window maximized state. 2022-12-11 16:45:35 +01:00
Bartosz Taudul
d5191ccbd4
Enable alt-space menu on windows. 2022-12-09 19:04:45 +01:00
Bartosz Taudul
ee3d5a94a7
Fix apfel check. 2022-12-09 18:59:01 +01:00
Bartosz Taudul
462d8103aa
Mark activity on window XDG surface reconfiguration.
This happens for example when the window is resized, or maximized.
2022-12-04 21:12:50 +01:00
Bartosz Taudul
12a109d303
Use XDG decoration protocol. 2022-12-04 21:12:50 +01:00
Bartosz Taudul
9d7cdf2a29
Add xdg-decoration protocol. 2022-12-04 21:12:50 +01:00
Bartosz Taudul
4e0ad1cab8
Update NEWS. 2022-11-30 20:39:55 +01:00
Bartosz Taudul
ba6416f68c
Merge pull request #497 from pshurgal/detailed_function_names
More detailed function names under Clang and GCC
2022-11-30 12:14:46 +01:00
Petr Shurgalin
5ddf62b54e Customizable source location data 2022-11-30 12:39:50 +02:00
Bartosz Taudul
a27ecd7135
Merge pull request #499 from ReplayCoding/other_thread_name
Always fallback to using native thread name...
2022-11-29 22:24:56 +01:00
ReplayCoding
9da24b713c
Always fallback to using native thread name...
...even when TRACY_ENABLE is defined.
2022-11-29 12:02:42 -08:00
Bartosz Taudul
a2825c8601
Update ZEN4 CPU name. 2022-11-29 17:06:10 +01:00
Bartosz Taudul
dba85c61b7
Update NEWS. 2022-11-29 17:04:47 +01:00
Bartosz Taudul
d24f768b1f
Update to official uops.info ZEN4 data. 2022-11-29 17:03:29 +01:00
Bartosz Taudul
70e22ad045
Merge pull request #498 from ReplayCoding/crashhandler_fix
Fix compile error when TRACY_NO_CRASH_HANDLER is enabled
2022-11-27 22:48:49 +01:00
ReplayCoding
311ad7b061
Fix compile error when TRACY_NO_CRASH_HANDLER is enabled 2022-11-27 13:40:45 -08:00
Bartosz Taudul
7e5ee54f93
On POSIX check if UID is 0. 2022-11-27 22:35:19 +01:00
Bartosz Taudul
6933856157
Update NEWS. 2022-11-27 22:26:13 +01:00
Bartosz Taudul
97c38077cc
Explain it makes no sense to run server with admin rights. 2022-11-27 22:24:42 +01:00
Bartosz Taudul
59f7870345
Track elevation state. 2022-11-27 21:53:47 +01:00
Bartosz Taudul
7e23d873dc
Check elevation status on Windows. 2022-11-27 21:53:47 +01:00
Bartosz Taudul
e1395f5a53
Rename surfaceListener to include xdg part. 2022-11-10 00:02:20 +01:00
Bartosz Taudul
d26ae1fbb5
Manage list of outputs. 2022-11-10 00:00:50 +01:00
Bartosz Taudul
8b9246e312
Add global remove callback. 2022-11-09 23:11:45 +01:00
Bartosz Taudul
89a55a2220
Remove semicolons from lockable macros. 2022-11-09 22:07:36 +01:00
Bartosz Taudul
2c03306341
Always provide Callstack() implementation, even if dummy.
This fixes usage with TRACY_HAS_CALLSTACK undefined, allowing compilation of
otherwise unused functions, which are already protected from being called
through macro redirections.

See https://github.com/wolfpld/tracy/pull/492 for more information.
2022-11-09 21:55:41 +01:00
Bartosz Taudul
c0035a492f
Update ImGui to 4d5da74. 2022-11-08 23:47:59 +01:00
Bartosz Taudul
53d54092b0
Implement attention requests. 2022-11-08 01:36:45 +01:00
Bartosz Taudul
a7ba5dd9df
Change xdg-shell to private-code. 2022-11-08 01:04:23 +01:00
Bartosz Taudul
8dafadb267
Add xdg-activation protocol. 2022-11-08 01:04:23 +01:00
Bartosz Taudul
1173cbc639
Move wayland protocol to a subdirectory. 2022-11-08 01:04:23 +01:00
Bartosz Taudul
e6f74c04d6
Wayland cursor handling is fucking stupid. 2022-11-08 00:31:57 +01:00
Bartosz Taudul
e227cfe100
Process pointer events. 2022-11-07 21:46:17 +01:00
Bartosz Taudul
4f7fba1fed
Hook seat. 2022-11-07 01:20:48 +01:00
Bartosz Taudul
9645998a97
Set app id. 2022-11-06 01:33:15 +01:00
Bartosz Taudul
1ccc0c39ea
Delay toplevel creation until after OpenGL initialization. 2022-11-06 01:14:56 +01:00
Bartosz Taudul
4d74968515
Wait for xdg_surface to be configured.
Some compositors require configuration event to happen before getting
toplevel.
2022-11-06 01:01:07 +01:00
Bartosz Taudul
a2f774dc20
Downgrade wl_compositor protocol to version 4.
Some compositors do not implement protocol in version 5.
2022-11-06 00:43:09 +01:00
Bartosz Taudul
ce797d82d5
Add minimal wayland backend. 2022-11-05 22:41:54 +01:00
Bartosz Taudul
a9be9d65de
Add xdg-shell protocol. 2022-11-05 22:41:26 +01:00
Bartosz Taudul
6c74320b3e
Merge pull request #488 from xxxbxxx/master
Added typed plots variants to the C API
2022-11-03 19:28:04 +01:00
xxxbxxx
cadef728d3
Update tracy.tex
mention the TracyCPlot variants in the manual.
2022-11-03 19:26:53 +01:00
Bartosz Taudul
e7ac54fba6
Signals are only set if TRACY_NO_CRASH_HANDLER is not defined. 2022-11-03 17:21:09 +01:00
xxxbxxx
a0cb8eb1d5 Added typed plots variants to the C API 2022-11-03 13:47:04 +01:00
Bartosz Taudul
4abb3b5e90
Pressing cancel is not an error. 2022-10-30 00:44:30 +02:00
Bartosz Taudul
a6a265b548
Display notification if there's a problem with file selector. 2022-10-30 00:42:45 +02:00
Bartosz Taudul
11cafbff1d
Expose internal file selector failure state. 2022-10-30 00:36:07 +02:00
Bartosz Taudul
fbfd7e5186
Report if file selector can be displayed. 2022-10-30 00:31:15 +02:00
Bartosz Taudul
343e7b6866
Update NEWS. 2022-10-28 01:30:57 +02:00
Bartosz Taudul
970468f937
Override dlclose() to do nothing.
Provide a custom no-op implementation of dlclose(), in order to prevent shared
object data from disappearing from profiler view. The server makes queries for
program executable code, which has to be always available, otherwise wrong
data may be provided, or the program may crash, due to referencing no longer
mapped memory.

The dlclose() documentation states that the function internally decreases the
reference count, and only does unload the shared object when the count reaches
zero. There is no guarantee that the shared object data will be unloaded
immediately after any dlclose call originating from the program. This function
override exploits this fact.
2022-10-28 01:21:52 +02:00
Bartosz Taudul
898140fbda
Don't read payload.extra, if not needed. 2022-10-28 00:34:46 +02:00
Bartosz Taudul
2b4fbd7feb
Update NEWS. 2022-10-28 00:14:22 +02:00
Bartosz Taudul
bae7fb3e88
Drop support for 0.7.x traces. 2022-10-28 00:14:06 +02:00
Bartosz Taudul
96c6898da3
Add 0.9 protocol version to protocol history. 2022-10-27 23:56:54 +02:00
Bartosz Taudul
5a1f5371b7
Release 0.9.0. 2022-10-26 23:23:08 +02:00
Bartosz Taudul
d523c728ea
Do not display unknown PIDs. 2022-10-26 23:23:07 +02:00
Bartosz Taudul
86f88714ae
Add compatibility with previous broadcast versions. 2022-10-26 23:23:07 +02:00
Bartosz Taudul
544caef850
Update NEWS. 2022-10-26 21:48:08 +02:00
Bartosz Taudul
d34af7166e
Remove graphical representation of instruction latencies. 2022-10-26 21:47:17 +02:00
Bartosz Taudul
3afe9a98cf
Move code size to assembly pane. 2022-10-26 21:45:14 +02:00
Bartosz Taudul
19e36f5e80
Condense some more. 2022-10-26 21:33:07 +02:00
Bartosz Taudul
fbf0d47c1c
Condense some text labels. 2022-10-26 19:49:13 +02:00
Bartosz Taudul
762b3a810a
Smaller font for symbol image name. 2022-10-26 19:40:30 +02:00
Bartosz Taudul
0eef0a8313
Fix window focus issues when navigating with WSAD. 2022-10-26 19:33:04 +02:00
Bartosz Taudul
7eba104e12
Sleep in capture when waiting for connection. 2022-10-19 22:00:40 +02:00
Bartosz Taudul
e3eead78a8
Further as-needed compression of jump graph. 2022-10-19 21:33:20 +02:00
Bartosz Taudul
11258fab73
Condense jump arrows, depending on max depth of jump graph. 2022-10-19 01:06:41 +02:00
Bartosz Taudul
33e5e07629
Extract calculation of jump separation. 2022-10-19 01:01:59 +02:00
Bartosz Taudul
11ea081c57
Do not use thousands separator for source line numbers. 2022-10-18 22:18:50 +02:00
Bartosz Taudul
c218e46f83
Update manual. 2022-10-18 22:03:01 +02:00
Bartosz Taudul
d99a428ab3
Update NEWS. 2022-10-18 21:44:32 +02:00
Bartosz Taudul
d90fed8296
Implement resetting selected microarchitecture. 2022-10-18 21:44:08 +02:00
Bartosz Taudul
f6cfbe935d
Resize canvas to fit window on page load. 2022-10-18 21:01:46 +02:00
Bartosz Taudul
b9fee59ac8
Do not hide progress bar, leaving the preload element. 2022-10-18 21:01:01 +02:00
Bartosz Taudul
9bc8580f99
Do not crash on resize when application has not started yet. 2022-10-18 21:00:20 +02:00
Bartosz Taudul
dc6c3962d3
Add software S3TC decoder. 2022-10-15 13:06:08 +02:00
Bartosz Taudul
fdb130651d
Detect if hardware supports S3TC. 2022-10-15 12:56:19 +02:00
Bartosz Taudul
5b1c1119c5
Create icon texture while waiting for icon to load. 2022-10-15 12:16:18 +02:00
Bartosz Taudul
4892c32b40
Fix blur caused by fractional DPI scaling. 2022-10-15 11:57:17 +02:00
Bartosz Taudul
9503280f33
Remove TODO. 2022-10-15 11:45:55 +02:00
Bartosz Taudul
55f2da581a
Check if glfwRequestWindowAttention() is available. 2022-10-15 01:15:22 +02:00
Bartosz Taudul
0f025ab604
Update manual. 2022-10-15 01:06:02 +02:00
Bartosz Taudul
fec84bf5c3
Update NEWS. 2022-10-15 00:44:45 +02:00
Bartosz Taudul
306ef02aa2
Do not limit inline propagation to sample count cost. 2022-10-15 00:43:07 +02:00
Bartosz Taudul
564534c703
Perform fast integer comparison before comparing strings. 2022-10-15 00:42:01 +02:00
Bartosz Taudul
47ec7de479
Propagate inlines for hw sample impact. 2022-10-15 00:39:25 +02:00
Bartosz Taudul
e7da2efdd1
Include hardware samples in inline propagation. 2022-10-15 00:35:51 +02:00
Bartosz Taudul
5db18087f5
Propagate inlines to src line addresses. 2022-10-15 00:27:54 +02:00
Bartosz Taudul
ba34596b91
No cost propagation when symbol is narrowed down to a single function. 2022-10-14 21:36:09 +02:00
Bartosz Taudul
d0d6b8fd8e
Use menus in inline call stack popup. 2022-10-14 19:49:06 +02:00
Bartosz Taudul
27ab25709d
Update imgui to f87e891f. 2022-10-14 19:48:38 +02:00
Bartosz Taudul
f25c43462a
Update NEWS. 2022-10-14 17:38:57 +02:00
Bartosz Taudul
a226446a92
Add local call stack navigation menu to asm lines. 2022-10-14 17:37:06 +02:00
Bartosz Taudul
0f283d5825
Select clicked on asm line. 2022-10-13 23:01:06 +02:00
Bartosz Taudul
2ed4b6ea8d
Update NEWS. 2022-10-13 21:23:01 +02:00
Bartosz Taudul
4c69b21a29
Reverse mouse buttons for jumping in symbol view. 2022-10-13 21:22:46 +02:00
Bartosz Taudul
1419283a91
Make the local callstack more readable. 2022-10-13 21:03:33 +02:00
Bartosz Taudul
2a333b8449
Update NEWS. 2022-10-13 20:57:47 +02:00
Bartosz Taudul
7727a17153
Request attention on disconnect. 2022-10-13 20:49:30 +02:00
Bartosz Taudul
1c5d90c98a
Require attention after load / connect. 2022-10-13 20:47:02 +02:00
Bartosz Taudul
d0968844d8
Only request attention if window has no focus. 2022-10-13 20:44:31 +02:00
Bartosz Taudul
b66c3a0e30
Request attention when save finishes. 2022-10-13 20:42:32 +02:00
Bartosz Taudul
8dec765f5f
Require attention on failure popups. 2022-10-13 20:39:43 +02:00
Bartosz Taudul
94fd3b664e
Add attention callback helper. 2022-10-13 20:36:54 +02:00
Bartosz Taudul
0a7ae94fcb
View::Draw() is no longer static. 2022-10-13 19:50:35 +02:00
Bartosz Taudul
c89c4f46ea
Hook up attention callback. 2022-10-13 19:31:47 +02:00
Bartosz Taudul
575f627136
All View ctor parameters need to be explicitly stated. 2022-10-13 19:30:15 +02:00
Bartosz Taudul
c0c3b58955
Remove dead code. 2022-10-13 19:25:36 +02:00
Bartosz Taudul
4a1e93841d
Add attention request function to windowing backend. 2022-10-13 19:22:21 +02:00
Bartosz Taudul
de3190657e
Make sure window redraw is active on refresh callback. 2022-10-13 19:08:37 +02:00
Bartosz Taudul
b88ef29792
Make sure source file data is properly tracked. 2022-10-13 19:00:22 +02:00
Bartosz Taudul
fc85e46f31
Always fill source code query queue when performing a query.
Previous implementation made these two events separate.
2022-10-13 18:15:04 +02:00
Bartosz Taudul
a85c0e18d2
Decouple source code retrieval from the profiler thread.
This will prevent apparent freezes of the profiler when debuginfod queries are
made.
2022-10-13 00:30:17 +02:00
Bartosz Taudul
6ca1c98655
Handle symbol thread crashes.
Should the symbol thread crash, mark that it is gone. This will allow the
profiler to transmit crash call stack, including resolved symbol names and
locations (which will resolve on the main profiler thread).
2022-10-13 00:30:17 +02:00
Bartosz Taudul
9657bdec72
Initialize rpmalloc properly in symbol worker. 2022-10-12 23:51:50 +02:00
Bartosz Taudul
4416dff342
Increase extra data in SymbolQueueItem to 64 bit. 2022-10-12 22:23:06 +02:00
Bartosz Taudul
f64fb95a77
Fix preprocesor condition. 2022-10-12 22:05:19 +02:00
Bartosz Taudul
8ca4bc761d
s_symbolTid is only available if crash handler is there. 2022-10-12 19:56:46 +02:00
Bartosz Taudul
a235dca7ea
Cleanup. 2022-10-12 01:42:22 +02:00
Bartosz Taudul
816101a72f
Update NEWS. 2022-10-12 00:46:00 +02:00
Bartosz Taudul
70dd37bbea
Display local call stack for assembly lines. 2022-10-12 00:45:05 +02:00
Bartosz Taudul
c041b962c0
Construct fake callstack frames for code location data. 2022-10-12 00:27:12 +02:00
Bartosz Taudul
ed455339b3
Remove codeAddressToLocation map. 2022-10-12 00:13:07 +02:00
Bartosz Taudul
0b84b50d9f
Remove locationCodeAddressList map from Worker.
Mapping of source code locations to code addresses is now performed
dynamically during disassembly in SourceView.
2022-10-12 00:13:07 +02:00
Bartosz Taudul
57e039f96c
Restore building code symbol map. 2022-10-11 23:04:06 +02:00
Bartosz Taudul
383ecb6a12
Remove CodeLocation query and CodeInformation response. 2022-10-11 22:56:23 +02:00
Bartosz Taudul
ac6902501a
Get location for address from callstack frame data. 2022-10-11 21:47:28 +02:00
Bartosz Taudul
4d0768ba9d
Replace code location queries with callstack frame ones. 2022-10-11 21:40:45 +02:00
Bartosz Taudul
c9adadf86a
When opening a new trace, set view to whole time span. 2022-10-10 22:55:56 +02:00
Bartosz Taudul
4f3f0e1aae
Update NEWS. 2022-10-10 00:09:58 +02:00
Bartosz Taudul
05f4efa2f4
Display PID in available client tooltip. 2022-10-09 22:01:09 +02:00
Bartosz Taudul
76213331f4
Store PID in broadcasting clients data. 2022-10-09 21:59:18 +02:00
Bartosz Taudul
f2f36876e1
Remove unnecessary check. 2022-10-09 21:59:10 +02:00
Bartosz Taudul
f509ed1561
Include PID in broadcast message. 2022-10-09 21:54:54 +02:00
Bartosz Taudul
ff36c9004f
Update manual. 2022-10-09 21:36:33 +02:00
Bartosz Taudul
c34062cd78
Update NEWS. 2022-10-09 21:21:54 +02:00
Bartosz Taudul
60f0ed8c0e
Include child calls in inline propagation. 2022-10-09 21:12:47 +02:00
Bartosz Taudul
720f339784
Implement inline cost propagation down the stack. 2022-10-09 21:09:25 +02:00
Bartosz Taudul
dbad69cd4f
Add inlines propagation UI. 2022-10-09 21:04:41 +02:00
Bartosz Taudul
a87cbacbc1
Fix offset of source code separator line. 2022-10-09 13:45:20 +02:00
Bartosz Taudul
17d3ac0141
Disable assertions in release builds. 2022-10-08 14:54:54 +02:00
Bartosz Taudul
63743f2760
Don't listen for broadcasts on emscripten. 2022-10-08 14:51:21 +02:00
Bartosz Taudul
fadd103169
Disable update check on emscripten. 2022-10-08 14:44:53 +02:00
Bartosz Taudul
2b6c53a73e
Set initial memory size to 384 MB to prevent growth at start. 2022-10-08 14:43:12 +02:00
Bartosz Taudul
a9afe18c26
Limit running environment support to web. 2022-10-08 14:34:44 +02:00
Bartosz Taudul
6c507a123a
Enable growing of wasm heap. 2022-10-08 14:33:49 +02:00
Bartosz Taudul
f476e6a0f7
Ditto on windows. 2022-10-08 14:09:58 +02:00
Bartosz Taudul
2c289dbb84
Do not freeze symbol thread. 2022-10-08 14:08:31 +02:00
Bartosz Taudul
4399656e83
__GNUC__ version checks are not valid on clang. 2022-10-08 14:04:54 +02:00
Bartosz Taudul
2595f983e6
Include gcc patchlevel in compiler version report. 2022-10-08 14:04:54 +02:00
Bartosz Taudul
6f9dfc8469
Use dladdr, not libbacktrace in fast callstack decode path.
DecodeCallstackPtrFast() may be called outside the symbol processing thread,
for example in the crash handler. Using the less-capable dladdr functionality
doesn't have a big impact here. Callstack decoding in this context is used to
remove the uninteresting top part of the callstack, so that the callstack ends
at the crashing function, and not in the crash handler. Even if this
functionality would be impacted by this change, the damage done is close to
none.

The other alternative is to use locking each time a libbacktrace is to be
used, which does not seem to be worthy to do, considering that the problem
only occurs in a very rare code path.

NB everything was working when it was first implemented, because back then the
callstack decoding was still performed on the main thread, and not on a
separate, dedicated one.
2022-10-08 13:22:56 +02:00
Bartosz Taudul
94ccc37979
Bump available heap to 2GB. 2022-10-06 18:12:51 +02:00
Bartosz Taudul
9f60b53729
Enable file selector on emscripten. 2022-10-06 18:12:51 +02:00
Bartosz Taudul
b369c784a6
Disable closure compiler. 2022-10-06 18:12:50 +02:00
Bartosz Taudul
ec0757c03a
Change file selector to work with callbacks. 2022-10-06 18:12:50 +02:00
Bartosz Taudul
a4e39f3d5f
Enable redraw after screen resize. 2022-10-06 17:32:25 +02:00
Bartosz Taudul
5d7cf137cf
Convert std::string to const char* in printf call. 2022-10-05 23:45:59 +02:00
Bartosz Taudul
754f7a5167
Add makefile target for starting httpd. 2022-10-05 23:44:39 +02:00
Bartosz Taudul
3ca61ad227
Extract file selector functionality. 2022-10-05 22:50:17 +02:00
Bartosz Taudul
5940af8995
Support opening web pages on emscripten. 2022-10-05 01:22:35 +02:00
Bartosz Taudul
7552341ff0
Increase possible inline stack size to 64 elements. 2022-10-04 22:16:20 +02:00
Bartosz Taudul
5874ac11f7
Sample parents show function, not symbol. 2022-10-04 22:03:05 +02:00
Bartosz Taudul
05b639e3b6
Use 32-bit vertex indices on emscripten. 2022-10-02 18:24:26 +02:00
Bartosz Taudul
e530103f43
Cosmetic fixes. 2022-10-02 18:08:27 +02:00
Bartosz Taudul
653d3bb358
Add interactive demo link. 2022-10-02 14:15:13 +02:00
Bartosz Taudul
cf61fbf7ba
Support hidpi. 2022-10-02 13:51:28 +02:00
Bartosz Taudul
4b5a823d39
Adapt render size to fit browser window. 2022-10-02 13:40:14 +02:00
Bartosz Taudul
73f6e73c51
Add basic html wrapper page. 2022-10-02 12:59:44 +02:00
Bartosz Taudul
6dd434a2d6
Run closure compiler on javascript. 2022-10-02 01:02:27 +02:00
Bartosz Taudul
75b95233ea
Preload embedded trace on emscripten. 2022-10-02 00:41:08 +02:00
Bartosz Taudul
dff45f1dc1
Just one compression worker thread on emscripten. 2022-10-02 00:40:43 +02:00
Bartosz Taudul
d33c7e5508
Update NEWS. 2022-10-01 13:00:02 +02:00
Bartosz Taudul
7cdc60886c
Add ZEN4 to microarchitecture selector. 2022-10-01 12:45:11 +02:00
Bartosz Taudul
62c4b70aaa
Reenable ZEN4 cpuid. 2022-10-01 12:40:57 +02:00
Bartosz Taudul
ccb5fefca2
Add ZEN4 microarchitecture data. 2022-10-01 12:40:05 +02:00
Bartosz Taudul
c2142279f1
But do not expose it yet. 2022-10-01 01:42:17 +02:00
Bartosz Taudul
b3dcd57087
Add ZEN4 cpuid. 2022-10-01 01:39:53 +02:00
Bartosz Taudul
ffa48be2d9
Add emscripten build files. 2022-09-30 01:06:34 +02:00
Bartosz Taudul
78169326b3
Setup main emscripten loop. 2022-09-30 00:57:07 +02:00
Bartosz Taudul
863b36d04b
Emscripten expects GLES2 (WebGL 1). 2022-09-30 00:39:42 +02:00
Bartosz Taudul
1d482a417d
Use std::move(), not move(). 2022-09-29 21:02:05 +02:00
Bartosz Taudul
73fe208b97
Remove unused variable. 2022-09-29 21:02:05 +02:00
Bartosz Taudul
c8c198cae7
Drop support for old, broken compilers.
These version macros report 4.2.1 on clang.
2022-09-29 20:59:31 +02:00
Bartosz Taudul
1dd6a778fb
Allow manual disabling of libtbb linkage. 2022-09-29 01:41:35 +02:00
Bartosz Taudul
8b17522dff
Use proper glfw version checks. 2022-09-29 00:45:48 +02:00
Bartosz Taudul
05a3ab8a33
Mark activity when ImGui windowing navigation target is on. 2022-09-28 17:57:29 +02:00
Bartosz Taudul
6fa0f55a83
Update NEWS. 2022-09-28 01:36:58 +02:00
Bartosz Taudul
26d269e857
Non-empty list of client broadcasts marks activity. 2022-09-28 01:34:31 +02:00
Bartosz Taudul
c8c684e9bc
Clear list of clients when View is active. 2022-09-28 01:34:20 +02:00
Bartosz Taudul
b24506492a
Move client broadcasts processing earlier in code. 2022-09-28 01:31:38 +02:00
Bartosz Taudul
f5abdd489d
Mark activity on HTTP response. 2022-09-28 01:24:41 +02:00
Bartosz Taudul
bc30786c05
Mark activity when playback is underway. 2022-09-28 01:17:08 +02:00
Bartosz Taudul
37442a7671
Mark activity when animating message marker. 2022-09-28 01:13:40 +02:00
Bartosz Taudul
64dbaf9d84
Mark activity on buzz anim in zone trace. 2022-09-28 01:12:06 +02:00
Bartosz Taudul
29c7b5f259
Mark activity on frame times histogram highlight. 2022-09-28 01:12:06 +02:00
Bartosz Taudul
1db9681ee2
Mark activity when lock is highlighting. 2022-09-28 01:12:05 +02:00
Bartosz Taudul
fd93f244f0
Mark activity when find zone histogram is highlighting. 2022-09-28 01:12:05 +02:00
Bartosz Taudul
8117d7d4d4
Mark activity when buzz anim is enabled. 2022-09-28 01:12:04 +02:00
Bartosz Taudul
6552108f52
BuzzAnim Update() returns whether it's active. 2022-09-28 01:12:03 +02:00
Bartosz Taudul
499f51f025
Mark activity when animating timeline items. 2022-09-28 01:12:03 +02:00
Bartosz Taudul
09d7b7336f
Mark activity when notification area is in use. 2022-09-28 00:48:45 +02:00
Bartosz Taudul
1f8de433ec
Mark activity when zoom animation is underway. 2022-09-28 00:43:12 +02:00
Bartosz Taudul
03a17c621e
Mark activity when waiting dots are drawn. 2022-09-28 00:36:01 +02:00
Bartosz Taudul
fb4d76469b
Activity tracking global variable. 2022-09-28 00:36:00 +02:00
Bartosz Taudul
c7ec2a9e0e
Check for popup background fade animation. 2022-09-28 00:26:29 +02:00
Bartosz Taudul
b3e9a03856
Check for activity in View. 2022-09-28 00:26:03 +02:00
Bartosz Taudul
a8276c41c3
Allow checking whether View was active.
Currently this only checks if client connection is active.
2022-09-27 22:31:53 +02:00
Bartosz Taudul
a8be0bc91e
Disable cursor blinking. 2022-09-27 22:13:31 +02:00
Bartosz Taudul
258fd73e6e
Remove dead code. 2022-09-27 22:12:18 +02:00
Bartosz Taudul
232fb5aaa4
Disable screen redraw when there are no input events. 2022-09-27 22:02:08 +02:00
Bartosz Taudul
1e7c6e3f49
Handle iconification by waiting for events. 2022-09-27 17:32:01 +02:00
Bartosz Taudul
ff8a85ea2d
Use small font for debug data in about window. 2022-09-26 01:15:37 +02:00
Bartosz Taudul
e7184565b3
No need for more than one space between mnemonic and operands. 2022-09-24 00:39:04 +02:00
Bartosz Taudul
da58c1f55e
Make source location display a bit shorter in asm line. 2022-09-24 00:37:23 +02:00
Bartosz Taudul
55e78ba4f7
Use ellipsis for more condensed source file in asm line. 2022-09-24 00:29:38 +02:00
Bartosz Taudul
8c5dc57359
Add ellipsis to fixed font atlas. 2022-09-24 00:29:21 +02:00
Bartosz Taudul
7ea063539c
Take less space for asm address in relative mode. 2022-09-21 20:39:35 +02:00
Bartosz Taudul
3d0e461140
Assembly lines spacing improvements. 2022-09-21 20:26:17 +02:00
Bartosz Taudul
3fa5b8f15a
Display local jump target source code preview in tooltip. 2022-09-19 00:33:45 +02:00
Bartosz Taudul
0596fac6f2
Display inline function name in local jump label. 2022-09-19 00:33:18 +02:00
Bartosz Taudul
8d626d25f0
Display call target function name more prominently. 2022-09-18 01:12:52 +02:00
Bartosz Taudul
cdcee49776
Make the ARM registers list more complete. 2022-09-17 23:31:42 +02:00
Bartosz Taudul
8da6105ee4
Cosmetics. 2022-09-17 23:31:34 +02:00
Bartosz Taudul
4cf096d883
Mark privileged instructions in the tooltip. 2022-09-17 23:06:16 +02:00
Bartosz Taudul
4c086e94e4
Different coloring for jump/call/ret or privileged mnemonics. 2022-09-17 22:59:50 +02:00
Bartosz Taudul
dc31ebfd9c
Use proper list of x64 registers. 2022-09-17 22:36:29 +02:00
Bartosz Taudul
2bd987b783
Use common colors. 2022-09-17 22:14:35 +02:00
Bartosz Taudul
823557fe74
Update NEWS. 2022-09-17 22:06:35 +02:00
Bartosz Taudul
62622bd65d
Update manual. 2022-09-17 22:06:01 +02:00
Bartosz Taudul
a8a4fe21b3
Adjust assembly register selection colors. 2022-09-17 22:03:41 +02:00
Bartosz Taudul
79a1f5cd80
Tokenize assembly operands. 2022-09-17 21:54:50 +02:00
Bartosz Taudul
0a69ef3b9c
Print asm operands taking tokens into account. 2022-09-16 00:30:56 +02:00
Bartosz Taudul
d823a24534
Dummy tokenization of asm operands. 2022-09-16 00:30:29 +02:00
Bartosz Taudul
4913f0e1e6
Greatly simplify asm line text drawing.
This change also colors asm mnemonics and jump labels. Asm operands are not
yet colored.
2022-09-15 23:36:31 +02:00
Bartosz Taudul
a45293d6ff
Enumerate asm token color names. 2022-09-15 23:36:30 +02:00
Bartosz Taudul
31b5a464cd
Add assembly color tables. 2022-09-15 23:36:30 +02:00
Bartosz Taudul
6dc7c8c6b5
Add assembly keyword maps. 2022-09-15 23:36:29 +02:00
Bartosz Taudul
aa017e6a76
Merge pull request #468 from sherief/exception-handler-fix
Windows exception handler allows other handlers to be called.
2022-09-15 11:33:39 +02:00
Bartosz Taudul
0fc1c0f927
Make symbol thread exit status more robust. 2022-09-13 21:07:03 +02:00
Bartosz Taudul
048e20b68c
Check for macro existence before checking its value. 2022-09-11 13:09:59 +02:00
Sherief Farouk
e8b3d22d76 Windows exception handler allows other handlers to be called.
The profiled app might install handlers to track crashes, write minidumps,
etc. - this patch makes sure the app's exception handler is called when
a crash happens while profiling with Tracy.
2022-09-10 17:16:58 -07:00
Bartosz Taudul
c27bcc524c
Store syntax colors as 32-bit uints. 2022-09-11 00:46:27 +02:00
Bartosz Taudul
f8cf7ff45a
Do not use deprecated grep variants. 2022-09-11 00:32:07 +02:00
Bartosz Taudul
9372d9fb28
Collect asm operation type data. 2022-09-11 00:30:37 +02:00
Bartosz Taudul
ad23932e9f
Merge pull request #467 from simplyWiri/fix-missing-tree-pop
Add missing TreePop in function which is called from inside a TreeNode
2022-09-10 12:05:05 +02:00
simplyWiri
830e7162eb Add missing TreePop in function which is called from inside a TreeNode 2022-09-10 17:09:04 +10:00
Bartosz Taudul
ae0fe3cc93
Merge pull request #466 from Pilzschaf/gpu_c_api_improvements
Added gpu zone begin non-alloc and callstack variants to the C API
2022-09-09 22:59:30 +02:00
Pilzschaf
a55fd64a5b Added gpu zone begin non-alloc and callstack variants to the C API 2022-09-09 21:23:07 +02:00
Bartosz Taudul
097b68e7bb
Merge pull request #465 from Pilzschaf/gpu_c_api_improvements
Added gpu calibration to the C API
2022-09-09 19:22:25 +02:00
Pilzschaf
823519a1de Fix indentation 2022-09-09 18:45:54 +02:00
Pilzschaf
41a1ac203b Added gpu calibration to the C API 2022-09-09 18:40:17 +02:00
Bartosz Taudul
eee6cb06fa
Align jump arrows to pixel boundaries. 2022-09-09 00:32:13 +02:00
Bartosz Taudul
0e930a2c13
Prevent thick zone highlight from going outside the zone box. 2022-09-09 00:18:40 +02:00
Bartosz Taudul
5bd3f3de5f
Don't use space for frame sets that are out of view range.
This becomes problematic at the end of the range, as continuous frames do not
have an "end", but rather essentially persist until the last recorded event.
2022-09-07 23:35:27 +02:00
Bartosz Taudul
f16c64872b
Update manual. 2022-09-05 20:35:39 +02:00
Bartosz Taudul
4fd4baf557
Update NEWS. 2022-09-05 20:32:24 +02:00
Bartosz Taudul
48e7a17d1d
Clicking on a CPU data thread will make it visible. 2022-09-05 20:30:03 +02:00
Bartosz Taudul
d2ab66195c
Allow changing timeline item collapsed state. 2022-09-05 20:29:45 +02:00
Bartosz Taudul
a975687d5f
Update manual. 2022-09-05 20:18:00 +02:00
Bartosz Taudul
02a47fb5bd
Update NEWS. 2022-09-05 20:15:20 +02:00
Bartosz Taudul
5200ea2c84
Hide frame related information if no frame instrumentation. 2022-09-05 20:12:36 +02:00
Bartosz Taudul
23ebce2862
Implement checking if frames are in use. 2022-09-05 20:12:12 +02:00
Bartosz Taudul
53632ccb5b
Cleanup. 2022-09-04 14:56:12 +02:00
Bartosz Taudul
44efb15df1
Remove VisData.
Its functionality is now incorporated into TimelineItem. For purposes of
maintaining visibility of frame sets and locks a much simpler ptr -> bool map
is now used.
2022-09-04 14:46:51 +02:00
Bartosz Taudul
ad2fc03125
Migrate CPU data to timeline item system. 2022-09-04 14:31:02 +02:00
Bartosz Taudul
827b390e34
Add mutable ViewData accessor. 2022-09-04 14:31:01 +02:00
Bartosz Taudul
9c464e9f05
Make timeline item visibility functions virtual. 2022-09-04 14:31:00 +02:00
Bartosz Taudul
135d3b7f30
Fix GPU contexts in options menu. 2022-09-04 13:52:53 +02:00
Bartosz Taudul
06d0989161
Add GPU index accessor. 2022-09-04 13:52:17 +02:00
Bartosz Taudul
9fdafb2ecc
Make the GPU context name primary focus. 2022-09-04 13:47:06 +02:00
Bartosz Taudul
60579d6334
Migrate drawing GPU data to the new timeline item system. 2022-09-04 13:39:20 +02:00
Bartosz Taudul
ec3e88ce53
Manage GPU index counter in View. 2022-09-04 13:37:19 +02:00
Bartosz Taudul
2711af39e5
Check if zoom range is valid.
This is important for GPU zones, which may have broken timing data.
2022-09-04 13:16:26 +02:00
Bartosz Taudul
e41deb1ff6
Check item map too for hidden items. 2022-09-03 23:43:26 +02:00
Bartosz Taudul
10faf16aee
Allow access to item map. 2022-09-03 23:43:17 +02:00
Bartosz Taudul
b66e10972a
Add visibility accessor to TimelineItem. 2022-09-03 23:42:52 +02:00
Bartosz Taudul
ca125bd44c
Collapse Tracy threads by default.
Note that this will likely work only when loading existing traces. In live
captures the thread name may not have yet been retrieved at the point when
timeline item insertion occurs, which will prevent the check from succeeding.
2022-09-03 23:35:35 +02:00
Bartosz Taudul
ec3dcaeef3
Migrate drawing CPU threads to the new timeline item system. 2022-09-03 23:28:54 +02:00
Bartosz Taudul
e3007062fc
Add support for drawing timeline item overlays. 2022-09-03 23:24:00 +02:00
Bartosz Taudul
8e713e6366
Limit access to internal methods. 2022-09-03 23:17:57 +02:00
Bartosz Taudul
5cbf06ba31
Only clip timeline item contents.
Timeline item header may overflow over other items, e.g. the crash marker is
taller than the header line.
2022-09-03 23:09:23 +02:00
Bartosz Taudul
840709fe46
Push pxns to HeaderExtraContents(). 2022-09-03 22:55:54 +02:00
Bartosz Taudul
3ee928a7d1
Fix mass visibility changing. 2022-09-03 22:08:08 +02:00
Bartosz Taudul
d65bde99a2
Hide timeline item if it had no content. 2022-09-03 21:57:56 +02:00
Bartosz Taudul
3780c47bb6
Check if plot is in drawing range. 2022-09-03 21:46:00 +02:00
Bartosz Taudul
0e94ed8fc6
DrawContents reports if anything was drawn. 2022-09-03 21:41:38 +02:00
Bartosz Taudul
eaa78de534
Don't draw separator when timeline item is collapsed. 2022-09-03 21:14:56 +02:00
Bartosz Taudul
5c90fe7a6e
Use the indented spacing.
Plots for some reason were packed tighter.
2022-09-03 21:11:36 +02:00
Bartosz Taudul
6abce4e0c9
Pass hover parameter to HeaderExtraContents(). 2022-09-03 20:04:24 +02:00
Bartosz Taudul
6e36469840
Add non-View-dependent thread color getter. 2022-09-03 19:28:50 +02:00
Bartosz Taudul
0c4ca4cd69
Add function for highlighting a thread. 2022-09-03 19:25:02 +02:00
Bartosz Taudul
e19a3a8767
Implement check for empty plot. 2022-09-03 19:18:01 +02:00
Bartosz Taudul
450fbf5ea0
Draw timeline item separator lines with proper colors. 2022-09-03 19:06:06 +02:00
Bartosz Taudul
fa20700825
Replace timeline item open/close triangles with font carets. 2022-09-03 18:53:05 +02:00
Bartosz Taudul
119152aac1
Worker must be mutable.
This is to allow use of various accessors that cache results, etc.
2022-09-03 18:34:11 +02:00
Bartosz Taudul
b481bb367c
Switch plot drawing to the timeline items system. 2022-09-03 17:51:33 +02:00
Bartosz Taudul
55a82ea714
Make plot color/value formatting generic utilities.
Previous implementations of these functions (in TracyView) are still used
throughout the code. They will be removed in subsequent commits.
2022-09-03 17:51:32 +02:00
Bartosz Taudul
1736fb387a
Allow access to timeline items stored in the controller.
This is similar to the previously existing Vis() access function.
2022-09-03 17:51:32 +02:00
Bartosz Taudul
9355a14657
New TimelineController begin/end logic. 2022-09-03 17:51:31 +02:00
Bartosz Taudul
8034fce416
Allow adding timeline items to TimelineController.
TimelineItem class is basically an expansion of the previous VisData
structure. After the transition process is finished the VisData map will be
removed, as it will no longer have any function.
2022-09-03 17:51:30 +02:00
Bartosz Taudul
449dff0eca
Store View and Worker in TimelineController. 2022-09-03 17:51:30 +02:00
Bartosz Taudul
b42182f0a8
Add base class for timeline items. 2022-09-03 17:51:29 +02:00
Bartosz Taudul
427dc4fffa
Make View::ZoomToRange() public. 2022-09-03 17:51:26 +02:00
Bartosz Taudul
3207df8236
Merge pull request #460 from Krzmbrzl/revamp-cmake
CMake: Fix invalid syntax
2022-09-03 17:51:09 +02:00
Robert Adam
92137e8050 CMake: Fix invalid syntax
In 1f7656e8454ae96f1657cf91abe8b01dc667689c I introduced a new option
but for setting its default value, I accidentally introduced invalid
cmake syntax that blows off as soon as BUILD_SHARED_LIBS is actually
defined to be non-empty.
2022-09-03 17:13:31 +02:00
jkriegshauser
59ae71df2b
Import frame messages (#459)
Co-authored-by: Joshua Kriegshauser <joshuakr@nvidia.com>
Co-authored-by: Bartosz Taudul <wolf@nereid.pl>
2022-09-02 19:44:37 +02:00
Bartosz Taudul
8b75a3fab0
Fix callstackPayload overflow when data to read size was POT. 2022-09-02 18:52:32 +02:00
Bartosz Taudul
2f44f65e02
Don't copy short_ptr. 2022-09-02 18:47:13 +02:00
Bartosz Taudul
66255dc950
Update NEWS. 2022-09-02 01:28:08 +02:00
Bartosz Taudul
2cc5eff9a2
Normalize symbol paths on libbacktrace systems. 2022-09-02 01:23:29 +02:00
Bartosz Taudul
8cc43284bd
Add path normalization function. 2022-09-02 01:23:14 +02:00
Bartosz Taudul
165cc22115
Merge pull request #454 from Krzmbrzl/revamp-cmake
CMake: Add option to explicitly set lib type
2022-08-31 21:17:46 +02:00
Bartosz Taudul
5289a9c999
Merge pull request #453 from Krzmbrzl/fix-cpuid-compile-error
Fix cpuid symbol redefinition on older GCC versions
2022-08-31 21:14:58 +02:00
Robert Adam
1f7656e845 CMake: Add option to explicitly set lib type
With this new option, it is now possible to explicitly build Tracy as a
shared or static library independent from the BUILD_SHARED_LIBS
variable, which always acts on a global scope (thus, affecting all CMake
targets).

If the options is not explicitly given, it will default to whatever
BUILD_SHARED_LIBS would indicate, leaving the default behavior
unchanged.
2022-08-31 18:06:51 +02:00
Robert Adam
0aeadb4c49 Use TRACY_PUBLIC_DIR throughout 2022-08-31 18:06:22 +02:00
Robert Adam
ece8779362 Fix cpuid symbol redefinition on older GCC versions
Since commit 940f32c1a892dd194c3c6d66bb3550149de919fc building the Tracy
library on Linux using a GCC version < 11 would result in compile errors
due to symbol redefinitions of __get_cpuid_max, __get_cpuid and
__get_cpuid_count.

This is because prior to GCC 11 the cpuid.h header file did not have any
include guards and thus including this header more than once would
produce the abovementioned errors.

To work around this issue, including cpuid.h has been wrapped into a
custom header file that itself uses include guards and thus shields
cpuid.h from being included multiple times.

Fixes #452
2022-08-31 17:59:46 +02:00
Bartosz Taudul
107975c8de
Fix time rounding logic.
PrintSmallInt() expects values in the 0-999 range, but the in+1 may produce
1000 here. This is invalid and it either asserted, or outputted an empty
string.

Workaround by simple outputting "1000" as the value here.

This function is only used in context of printing time, and only in specific
context. The end result will be that values like "1000 us" or "1000 ms" may
appear, where they would be otherwise shortened to "1 ms" or "1 s". This may
be a bit unusual, but is acceptable, as the real time value has not yet
crossed the threshold required for such shortening.
2022-08-28 14:50:38 +02:00
Bartosz Taudul
f0386d2f72
Update manual. 2022-08-28 13:26:15 +02:00
Bartosz Taudul
cedd8b590c
Update NEWS. 2022-08-28 13:21:24 +02:00
Bartosz Taudul
c2d527e2e7
Cosmetics. 2022-08-28 13:17:29 +02:00
Bartosz Taudul
74789d1049
Merge pull request #446 from simplyWiri/master
Add WASD panning/zooming functionality to timeline.
2022-08-28 13:13:21 +02:00
Bartosz Taudul
87723cdcc4
Update json.hpp to 3.11.2. 2022-08-27 16:09:42 +02:00
Bartosz Taudul
be392a76fb
Move TracyVersion.hpp to common. 2022-08-27 16:05:36 +02:00
Bartosz Taudul
165099ca87
Merge pull request #448 from hulakdar/multithreaded_d3d12_zones
Multithreaded d3d12 zones
2022-08-26 13:11:35 +02:00
hulakdar
e35db2657b A bit more consistent usage of atomic 2022-08-26 13:25:58 +03:00
hulakdar
391cb4242e Fix d3d12 gpu zones for multithreaded use 2022-08-26 13:07:07 +03:00
Bartosz Taudul
11b11d5f51
Update NEWS. 2022-08-26 00:54:36 +02:00
Bartosz Taudul
f3113f24a9
Update manual. 2022-08-26 00:48:18 +02:00
Bartosz Taudul
72b7d0db5b
Add user data pointer to parameter callback. 2022-08-26 00:46:01 +02:00
simplyWiri
d2e3856724 Add WASD panning/zooming functionality to timeline. 2022-08-22 17:23:57 +10:00
Bartosz Taudul
655d8a01ea
Move vis data to timeline controller. 2022-08-20 17:02:29 +02:00
Bartosz Taudul
49bda91be5
Cosmetics. 2022-08-20 01:45:55 +02:00
Bartosz Taudul
414f467c6e
More jump targets to normalize. 2022-08-19 12:50:47 +02:00
Bartosz Taudul
2f219188e1
Fix function normalization being forced on. 2022-08-18 14:13:53 +02:00
Bartosz Taudul
197007ab47
Keep a list of buffers left to handle.
Previously a bitmap of buffers was repeatedly scanned to see which buffers
still contain data. This process was needlessly wasting cycles (seen as a
hotspot when profiled) and worse yet, the workload increased with the number
of CPU cores (=> buffers used) to handle.

The new implementation instead maintains a list of buffer indices that have to
be handled. This list does not contain empty buffers, so each loop iteration
performs some work, instead of just spinning in search for buffers to handle.
2022-08-18 13:59:56 +02:00
Bartosz Taudul
940f32c1a8
Add include for cpuid. 2022-08-18 13:40:37 +02:00
Bartosz Taudul
1d60c0cd5b
Remove leftovers. 2022-08-18 13:18:39 +02:00
Bartosz Taudul
07a56f1148
Load globals to local variables. 2022-08-18 01:08:22 +02:00
Bartosz Taudul
d62f7d5d13
Shorten zone name in jump popup target submenu. 2022-08-18 00:49:42 +02:00
Bartosz Taudul
f9a4bc55cc
Normalize function names in jump popup. 2022-08-18 00:35:59 +02:00
Bartosz Taudul
a1f09fab35
Assembly lines without source locations are navigatable to. 2022-08-18 00:19:32 +02:00
Bartosz Taudul
3dfa3a77a2
Update manual. 2022-08-17 16:48:45 +02:00
Bartosz Taudul
7df4aef122
Expose source callback registering through a macro. 2022-08-17 16:26:03 +02:00
Bartosz Taudul
687e901347
Update NEWS. 2022-08-17 16:04:21 +02:00
Bartosz Taudul
e8aaf5fa99
Run source file query on payloaded source locations. 2022-08-17 16:04:20 +02:00
Bartosz Taudul
a237f108c7
Use source contents callback. 2022-08-17 16:04:20 +02:00
Bartosz Taudul
ed7be2faaa
Add source contents callback setup. 2022-08-17 16:04:18 +02:00
Bartosz Taudul
4bcb59bbe6
Update font awesome and migrate to v6 headers. 2022-08-17 12:07:38 +02:00
Bartosz Taudul
ef35c01e14
Highlight jump line on hover over jump target label. 2022-08-17 00:30:07 +02:00
Bartosz Taudul
1601ddeab5
Resolve relative file names to absolute ones.
Note that this is a tentative fix, which *should* be working, but it may as
well not be correct in some edge cases. Who knows.
2022-08-16 23:48:46 +02:00
Bartosz Taudul
3dc542a464
Log invalid debuginfod queries.
Filename paths must be absolute, not relative.
2022-08-16 22:05:14 +02:00
Bartosz Taudul
d32dc47845
Add debug logging for debuginfod queries. 2022-08-16 22:05:08 +02:00
Bartosz Taudul
ed733a4b15
Update manual. 2022-08-16 18:58:11 +02:00
Bartosz Taudul
0779151170
Update NEWS. 2022-08-16 18:52:29 +02:00
Bartosz Taudul
827bbeb442
Context menu hide for plots. 2022-08-16 18:51:28 +02:00
Bartosz Taudul
4bf6a2b9d2
Context menu hide for CPU data. 2022-08-16 18:48:54 +02:00
Bartosz Taudul
3aa62a18cc
Context menu hide of GPU zones. 2022-08-16 18:43:13 +02:00
Bartosz Taudul
fa8a071334
Add context menu with hide option to threads on timeline. 2022-08-16 18:40:10 +02:00
Bartosz Taudul
5ef7e42223
Fix indentation. 2022-08-16 18:39:43 +02:00
Bartosz Taudul
06b986ad90
Bump LZ4 to 1.9.4. 2022-08-16 14:43:50 +02:00
Bartosz Taudul
3d9d242153
Fix test application flags. 2022-08-16 14:12:22 +02:00
Bartosz Taudul
72ad40698b
Move initialization of callstack structs to a thread.
Initializing structures for callstack processing (building memory map of the
process, gathering kernel symbols, etc) takes some time, which in some cases
may be significant.

Callstack queries are now handled on a separate thread. In such setup it no
longer makes sense to block main thread execution with this lengthy init
process.

All the heavy initialization phase has been now moved to this separate
processing thread. Some initial callstack queries may now not produce
responses as promptly as before, but this is only because the main thread is
able to start working earlier.

Some parts of the initialization process may be critical to do in the main
thread, for example because the function responsible for gathering callstacks
must be loaded first. This is done still on the main thread, in a new function
InitCallstackCritical().
2022-08-16 13:55:46 +02:00
Bartosz Taudul
d9d31e4d51
Make fixed font more compact.
Note that the negative glyph spacing is const here, regardless of the font
scaling. The alternative of using proportional spacing in reality does not
work as good as it sounds. With fractional scaling some of the glyphs will
no longer land on exact pixel boundaries, which results in blurry text.

Looking at the potential solutions for this problem is moot point, as with
the non-fractional scale of 2x and glyph spacing of -2, there is no longer
enough space separating some letters, which is especially visible in words
like "common" or register "xmm", where the "mm" pair becomes joined.
2022-08-16 13:16:21 +02:00
Bartosz Taudul
26e7d6eb3e
Update manual. 2022-08-16 00:17:59 +02:00
Bartosz Taudul
cde56ef9fe
Update NEWS. 2022-08-15 23:33:27 +02:00
Bartosz Taudul
6659e9967a
Fix alignment of inline function warning triangle. 2022-08-15 23:04:56 +02:00
Bartosz Taudul
c6ad1c4969
Print file name in source view with big font. 2022-08-15 23:01:40 +02:00
Bartosz Taudul
f39efbaa07
Normalize child call names in symbol view. 2022-08-15 22:58:35 +02:00
Bartosz Taudul
00e0187506
Print symbol name in symbol view with big font. 2022-08-15 22:53:32 +02:00
Bartosz Taudul
fa0322f6b4
Push big font to source view. 2022-08-15 22:48:00 +02:00
Bartosz Taudul
d3cb8ccef2
Normalize jump names in assembly lines. 2022-08-15 22:44:31 +02:00
Bartosz Taudul
04aebb090b
Normalize frame names in zone trace. 2022-08-15 22:32:42 +02:00
Bartosz Taudul
fd2918eaf2
Normalize frames in find zone view callstack. 2022-08-15 22:27:36 +02:00
Bartosz Taudul
a5998adf83
Normalize function name in assembly line location popup. 2022-08-15 22:16:05 +02:00
Bartosz Taudul
2031c92f7a
Add source code tooltip to function selection list. 2022-08-15 22:10:59 +02:00
Bartosz Taudul
163e7fd490
Normalize names in function selection list in symbol view. 2022-08-15 22:06:35 +02:00
Bartosz Taudul
b1aca6acf9
Show original name in tooltip in sample parents window. 2022-08-15 21:54:29 +02:00
Bartosz Taudul
dc84752fab
Normalize symbol view symbol name. 2022-08-15 21:51:11 +02:00
Bartosz Taudul
f4524a8453
Show more elements in one-line callstacks. 2022-08-15 21:36:29 +02:00
Bartosz Taudul
697d1f0cad
Fully shorten frame names in one-line callstack calls. 2022-08-15 21:33:25 +02:00
Bartosz Taudul
baf365c0c3
Normalize frame names in memory callstack tree. 2022-08-15 21:29:21 +02:00
Bartosz Taudul
9c4f257596
Normalize frame names in wait stacks tree. 2022-08-15 21:27:05 +02:00
Bartosz Taudul
4d974da290
Add shorten name accessor. 2022-08-15 21:21:50 +02:00
Bartosz Taudul
257a836dc7
Adjust zone name shortening option names.
"Always full" was kinda ambiguous. It could either mean that the name will be
always full (shortening effectively disabled), or that the shortening will be
performed to the maximum extent (as it was).
2022-08-15 20:47:59 +02:00
Bartosz Taudul
c4324873b2
Add tooltips for parent names. 2022-08-15 20:40:49 +02:00
Bartosz Taudul
655bcd40fb
Limit sample statistics frame name tooltip to frame name. 2022-08-15 20:39:35 +02:00
Bartosz Taudul
27165d12a6
Normalize frame names in parents frame tree. 2022-08-15 20:09:35 +02:00
Bartosz Taudul
389cf135c0
Normalize frame names in sample parents call stack view. 2022-08-15 20:04:57 +02:00
Bartosz Taudul
6932eb4b79
Shorten frame names in sample statistics view. 2022-08-15 19:56:17 +02:00
Bartosz Taudul
4d0591cf2f
Extract normalized name tooltip function. 2022-08-15 19:43:03 +02:00
Bartosz Taudul
63d074c5d8
Fix zone size calculation wrt text fitting.
Previously the zone size calculation hasn't took into account the possibility
of the zone going out of the screen. This is now fixed.
2022-08-15 19:38:40 +02:00
Bartosz Taudul
7f99ee2c13
Shorten frame names in callstack table. 2022-08-15 19:38:39 +02:00
Bartosz Taudul
f2001c95a5
Shorten frame names in callstack tooltip. 2022-08-15 17:13:39 +02:00
Bartosz Taudul
112406472a
Do not normalize non-ghost zone names.
These do not have unwanted decorations, but may include useful user
annotations (e.g. "Open file (/etc/passwd)"), which we would not want to
remove.
2022-08-15 17:03:45 +02:00
Bartosz Taudul
d27cb4a094
Normalize names in ghost zone tooltips. 2022-08-15 16:54:12 +02:00
Bartosz Taudul
57cabc1e09
Support zone name shortening without text/zone sizes. 2022-08-15 16:39:25 +02:00
Bartosz Taudul
8531ef6591
Extract ShortenZoneName() function to a separate file. 2022-08-15 16:34:37 +02:00
Bartosz Taudul
07a1383304
Expose zone name normalization as a separate setting. 2022-08-15 16:24:44 +02:00
Bartosz Taudul
89016454f8
Progressively remove namespaces. 2022-08-15 15:44:13 +02:00
Bartosz Taudul
af934f1387
Remove common return value types from function names.
Which types are included is a balance between efficiency and frequency of
occurrence.
2022-08-15 15:38:34 +02:00
Bartosz Taudul
fb6f63f06f
Remove const qualifier from shortened function names. 2022-08-15 15:22:57 +02:00
Bartosz Taudul
60f82dfd2e
Fix off-by-one.
The null terminator was included during the string copy. The destination
pointer points to one-beyond-the-end, and has to be decreased.
2022-08-15 15:12:20 +02:00
Bartosz Taudul
0c6acf3c2e
Use string end pointer. 2022-08-15 14:54:23 +02:00
Bartosz Taudul
d91321a774
Do not shorten kernel module names. 2022-08-15 14:50:57 +02:00
Bartosz Taudul
47a2512957
Change namespace shortening to zone name shortening.
Namespace shortening was kinda ok for function names produced by MSVC, which
are generally clean looking. However, gcc/clang like to produce function names
which include template arguments, function parameters, return values, etc. In
such cases the old algorithm simply didn't work, because removal of everything
before the last :: could as well happen in midst of function parameters list.
The result was certainly not an usable function name.

With this new approach namespaces are no longer explicitly mentioned and this
functionality is simply called zone name shortening.

The user-selectable options were changed to make the shortening always
enabled, disabled, or to apply as needed. Note that the "as needed" approach
will be dynamic, trying to gradually remove more and more from the name, until
it fits in the requested area.

Current implementation is only the first step into making this work. In this
first step the function parameters are reduced to () and the template
arguments are reduced to <>. This alone greatly improves readability of the
zone names.

The option to reduce namespaces to one letter (i.e. std::tr1::hash would
become s:t:hash) will no longer be present, now or in the future.
2022-08-15 14:19:57 +02:00
Bartosz Taudul
c01ad38d46
Start extracting timeline height control logic. 2022-08-15 13:29:45 +02:00
Bartosz Taudul
b0ac78dde1
Don't care about std::regex_error value. 2022-08-14 18:20:40 +02:00
Bartosz Taudul
df00870a4b
InputBuf is no longer than 255 bytes. 2022-08-14 18:20:39 +02:00
Bartosz Taudul
d12fa11762
Change magic value enums to constexprs. 2022-08-14 18:16:30 +02:00
Bartosz Taudul
77e39700b1
Proper way to detect mouse hover over timeline. 2022-08-14 17:17:51 +02:00
Bartosz Taudul
86c2574848
Fix printing floats in source view. 2022-08-14 14:16:56 +02:00
Bartosz Taudul
e289884395
Display jump target even if there's no source location. 2022-08-14 14:01:01 +02:00
Bartosz Taudul
99a110d5b1
Add asm line hover highlight for unknown locations.
In some cases there are many unknown locations next to each other. Having a
hover highlight helps to distinguish one from another.
2022-08-14 13:40:39 +02:00
Bartosz Taudul
d5a46f97c1
Release MemData. 2022-08-14 11:37:24 +02:00
Bartosz Taudul
07d921b322
Cosmetics. 2022-08-14 11:29:36 +02:00
Bartosz Taudul
77e3a480a4
Properly terminate CPU model string. 2022-08-13 19:37:34 +02:00
Bartosz Taudul
7dbfed9aea
Drop access to native window.
The new NFD library is not using this information, and the old one was using
it only on Windows. Oh well.

Removal of this functionality also removes some build-time decisions.
2022-08-12 21:44:24 +02:00
Bartosz Taudul
baea6ddf11
More concise machine code display. 2022-08-09 01:17:24 +02:00
Bartosz Taudul
849e58bfb3
No rpmalloc on emscripten. 2022-08-08 19:40:17 +02:00
Bartosz Taudul
bb22542a90
Decouple rpmalloc usage from TRACY_ENABLE flag. 2022-08-08 19:40:16 +02:00
Bartosz Taudul
3840f39fc9
Fix macros. 2022-08-08 19:16:42 +02:00
Bartosz Taudul
d67e51a4ba
Target native architecture when making debug builds. 2022-08-08 18:47:47 +02:00
Bartosz Taudul
259672abc6
Use proper type in StringKey initialization. 2022-08-08 18:47:11 +02:00
Bartosz Taudul
4cd36ecdea
No parallel execution on emscripten. 2022-08-08 18:41:06 +02:00
Bartosz Taudul
d63d1c9e7f
Load icon during rendering backend setup.
Creating a new window along with setting up an OpenGL context is universally
a lengthy operation. Decode the icon image on a separate thread.
2022-08-07 17:13:38 +02:00
Bartosz Taudul
73be35ea98
Fix unknown source box style. 2022-08-06 23:41:47 +02:00
Bartosz Taudul
4607dca13b
Smaller frame bar color thresholds legend. 2022-08-04 22:32:35 +02:00
Bartosz Taudul
225d6c1ede
Update manual. 2022-08-04 19:17:24 +02:00
Bartosz Taudul
8835a7b35d
Update NEWS. 2022-08-04 19:02:22 +02:00
Bartosz Taudul
49dc3431ab
Allow setting custom FPS targets on frames overview. 2022-08-04 18:58:13 +02:00
Bartosz Taudul
9b5d0747eb
Add overview of frame target colors. 2022-08-04 18:46:37 +02:00
Bartosz Taudul
740155f5e3
Make frame targets input box smaller. 2022-08-04 18:23:25 +02:00
Bartosz Taudul
c3eb65be41
Merge pull request #441 from laurelkeys/patch-1
Update CMakeLists.txt after directory changes
2022-08-04 14:00:29 +02:00
Tiago Chaves
70026097cc
Update CMakeLists.txt 2022-08-04 08:51:08 -03:00
Bartosz Taudul
fc7b3c3c0e
Merge pull request #440 from Danielmelody/master
Using push/pop in all pragma pack pair to avoid potential padding bugs
2022-08-03 13:36:47 +02:00
Daniel
dc74b8adfd Using push/pop in all pragma pack pair to avoid potential padding bugs 2022-08-03 18:39:42 +08:00
Bartosz Taudul
eeffb6d25c
Merge pull request #439 from antiagainst/fix-event-debug
Fix include path and QueueType::PlotData in TracyEventDebug.cpp
2022-08-02 21:27:20 +02:00
Lei Zhang
37bcb9cd4a Fix include path and QueueType::PlotData in TracyEventDebug.cpp
* common/TracyQueue.hpp is now under public/.
* QueueType::PlotData is splitted by cases.
2022-08-02 12:44:13 -04:00
Bartosz Taudul
5a36782c83
Fix inline functions not being attributed to symbols.
Regression was introduced in commit 18112d3c6.
2022-07-31 12:38:24 +02:00
Bartosz Taudul
c6464f44da
Fix typo. 2022-07-30 22:02:25 +02:00
Bartosz Taudul
81431cd35c
Update NEWS. 2022-07-30 21:45:02 +02:00
Bartosz Taudul
8a7e3dc8ba
Update manual. 2022-07-30 21:43:57 +02:00
Bartosz Taudul
e0f813d9e9
Add support for Vsync capture on Linux. 2022-07-30 21:29:44 +02:00
Bartosz Taudul
91b002267e
Emit dedicated Vsync frame messages. 2022-07-30 19:53:40 +02:00
Bartosz Taudul
8b4385498d
Process Vsync frame messages.
Version bump is required due to frame set name pointer hack.
2022-07-30 19:51:29 +02:00
Bartosz Taudul
e86238642a
Add dedicated frame Vsync queue message. 2022-07-30 19:50:42 +02:00
Bartosz Taudul
b19f9e1f4d
Use common functionality to get frame set name. 2022-07-30 19:32:25 +02:00
Bartosz Taudul
92871ba75a
Allow external data insertion into string discovery vectors. 2022-07-30 18:35:50 +02:00
Bartosz Taudul
86bc2020cb
Fix call to rpmalloc_thread_finalize in manual lifetime use-case. 2022-07-30 14:33:39 +02:00
Bartosz Taudul
52643fcd2a
Compatibility fixes for rpmalloc. 2022-07-30 14:13:54 +02:00
Bartosz Taudul
45ba4f2390
Disable auto-cleanup in rpmalloc. 2022-07-30 13:35:44 +02:00
Bartosz Taudul
6be10b6122
Update rpmalloc to 1.4.4. 2022-07-30 13:29:57 +02:00
Bartosz Taudul
7b35d88716
Merge pull request #437 from tmayoff/meson_fix
Meson fix
2022-07-29 11:18:01 +02:00
Tyler Mayoff
1e957d6ceb
fixed includes 2022-07-28 18:36:07 -04:00
Tyler Mayoff
51ddf43333
Fixed source paths 2022-07-28 18:32:54 -04:00
Bartosz Taudul
46292b0719
Dynamically track saved window state. 2022-07-28 00:48:14 +02:00
Bartosz Taudul
aa07820eb7
Rely solely on GLFW DPI handling. 2022-07-28 00:31:10 +02:00
Bartosz Taudul
b86f1a907a
Move all GLFW code to a separate class. 2022-07-28 00:24:52 +02:00
Bartosz Taudul
138f80001e
Add stb_image_resize to the list of used libraries. 2022-07-28 00:24:51 +02:00
Bartosz Taudul
1e8029c4d9
Display icon in the about screen. 2022-07-28 00:24:50 +02:00
Bartosz Taudul
66a6488980
Add centered image helper. 2022-07-28 00:24:50 +02:00
Bartosz Taudul
1eacce9e06
Create texture with resized icon. 2022-07-28 00:24:49 +02:00
Bartosz Taudul
0c36bfba5d
Allow creating RGBA textures. 2022-07-28 00:24:49 +02:00
Bartosz Taudul
2c31ba8016
Don't free icon pixel data. 2022-07-28 00:24:48 +02:00
Bartosz Taudul
add5c1e328
Instantiate stb_image_resize. 2022-07-28 00:24:48 +02:00
Bartosz Taudul
065f13c382
Add stb_image_resize. 2022-07-28 00:24:47 +02:00
Bartosz Taudul
002eb6ae2d
Extract filtering connections functionality. 2022-07-28 00:24:46 +02:00
Bartosz Taudul
a356340783
Extract connection history functionality. 2022-07-28 00:24:46 +02:00
Bartosz Taudul
31b6a88923
Extract window position save/load functionality. 2022-07-28 00:24:45 +02:00
Bartosz Taudul
208755ad53
Extract main thread run queue. 2022-07-28 00:24:45 +02:00
Bartosz Taudul
f0f00512b0
Extract font loading. 2022-07-28 00:24:44 +02:00
Bartosz Taudul
2d327abd80
Move imgui backends to a subdirectory. 2022-07-28 00:24:43 +02:00
Bartosz Taudul
054c26781a
Move fonts to a subdirectory. 2022-07-28 00:24:40 +02:00
Bartosz Taudul
1b728b50bf
Merge pull request #434 from haCo77/master
fix tracy worker threads conflict
2022-07-27 21:37:12 +02:00
Jiangping Xu
ad7c2cf5d8 fix tracy worker threads conflict 2022-07-27 11:44:19 -07:00
Bartosz Taudul
758edf8a05
Update manual. 2022-07-24 14:59:20 +02:00
Bartosz Taudul
c924981044
Update NEWS. 2022-07-24 14:42:11 +02:00
Bartosz Taudul
347317745b
Update manual. 2022-07-24 14:31:57 +02:00
Bartosz Taudul
b782b021c7
Obey custom plot colors. 2022-07-24 14:31:56 +02:00
Bartosz Taudul
b026e09a09
Include custom color in plot configuration. 2022-07-24 13:42:25 +02:00
Bartosz Taudul
1dfe36e962
Implement reading 10 elements at once. 2022-07-24 13:40:06 +02:00
Bartosz Taudul
f4b0654fcd
Allow setting plot color in the configuration message. 2022-07-24 13:32:21 +02:00
Bartosz Taudul
f354735fc4
Plot fill may be disabled. 2022-07-24 13:28:12 +02:00
Bartosz Taudul
b2a94cbfa2
Set plot fill using configuration message. 2022-07-24 13:10:20 +02:00
Bartosz Taudul
dceb2399ee
Set plot staircase using plot configuration message. 2022-07-24 13:09:45 +02:00
Bartosz Taudul
3f51409389
Add step and fill parameters to plot configuration. 2022-07-24 13:05:01 +02:00
Bartosz Taudul
810f1573ac
Use separate messages for transfer of different plot value types. 2022-07-24 13:00:36 +02:00
Bartosz Taudul
aeedf7de2d
Save/load plot steps parameter. 2022-07-24 12:42:39 +02:00
Bartosz Taudul
16627d7313
Plots may now be drawn as staircases. 2022-07-24 12:37:30 +02:00
Bartosz Taudul
f8115168a6
Fill area under plots. 2022-07-24 12:28:47 +02:00
Bartosz Taudul
b0f484d593
Display plot colors in options menu. 2022-07-24 12:13:28 +02:00
Bartosz Taudul
3393471dcc
Draw memory plot ranges on top of plot. 2022-07-24 12:10:46 +02:00
Bartosz Taudul
a3b6a9c95c
Color plot background. 2022-07-24 01:39:51 +02:00
Bartosz Taudul
755df94f45
Move DarkenColor() to a proper source file. 2022-07-24 01:29:52 +02:00
Bartosz Taudul
27a98a3cc2
Make user plot color depend on its name. 2022-07-24 01:26:20 +02:00
Bartosz Taudul
a98bbc2340
Display plot color in plot tooltip. 2022-07-24 01:12:42 +02:00
Bartosz Taudul
7d1539a0ce
Plot coloring, currently by type. 2022-07-24 01:07:10 +02:00
Bartosz Taudul
5bee753376
Add source preview to lock info window source location. 2022-07-24 00:18:57 +02:00
Bartosz Taudul
0a00925a9b
More compact locks drawing. 2022-07-24 00:13:11 +02:00
Bartosz Taudul
efaf1df8d4
Move LockMap and LockHighlight definitions. 2022-07-23 15:54:48 +02:00
Bartosz Taudul
52f333a3f8
Update NEWS. 2022-07-23 13:38:52 +02:00
Bartosz Taudul
f7598d2431
Implement direct children search. 2022-07-23 13:31:41 +02:00
Bartosz Taudul
57f03dfe9a
Implement children messages filtering in zone tooltip. 2022-07-23 13:19:30 +02:00
Bartosz Taudul
c44075544a
Mention C# bindings. 2022-07-23 12:46:39 +02:00
Bartosz Taudul
a75846dd88
Do not try to demangle really long function names. 2022-07-23 12:37:00 +02:00
Bartosz Taudul
d282425287
Fix demangle buffer. 2022-07-23 12:34:35 +02:00
Bartosz Taudul
cb58b4803a
Update NEWS. 2022-07-20 01:23:33 +02:00
Bartosz Taudul
7dc95bf3a8
Fix demangling of functions with names >64KB. 2022-07-20 01:21:43 +02:00
Bartosz Taudul
f52ac31468
Do not duplicate code. 2022-07-20 01:06:12 +02:00
Bartosz Taudul
a04f830962
Force inline string copy functions. 2022-07-20 01:04:59 +02:00
Bartosz Taudul
5e0eb7e26b
Drop string copy length asserts.
These might now truncate data.
2022-07-20 01:03:06 +02:00
Bartosz Taudul
8ccfe93044
Apply 7409767 from libbacktrace. 2022-07-20 00:41:22 +02:00
Bartosz Taudul
fca8a7707d
Don't fail compilation on emscripten. 2022-07-19 15:49:29 +02:00
Bartosz Taudul
4d40a9cb53
Track locking thread on server side. 2022-07-18 02:06:19 +02:00
Bartosz Taudul
440d20b864
Don't transfer lock release thread id.
We already know which thread is holding the lock.
2022-07-18 01:56:09 +02:00
Bartosz Taudul
d6a607b9f0
Update nativefiledialog-extended to 3311592. 2022-07-17 16:22:27 +02:00
Bartosz Taudul
85102f7a19
Update NEWS. 2022-07-17 15:47:39 +02:00
Bartosz Taudul
fedec0caf2
Update manual. 2022-07-17 15:47:39 +02:00
Bartosz Taudul
06c7984a16
Move all client headers and sources to public/ directory. 2022-07-17 15:47:38 +02:00
Bartosz Taudul
c3c799ebc4
Update NEWS. 2022-07-13 01:00:57 +02:00
Bartosz Taudul
94444e2afb
Display compatible Tracy versions for bad protocols. 2022-07-13 00:53:15 +02:00
Bartosz Taudul
b70321fe6a
Add protocol -> version mapping table. 2022-07-13 00:44:02 +02:00
Bartosz Taudul
0624c592e3
Advise about slow send queue. 2022-07-03 15:14:53 +02:00
Bartosz Taudul
edad2d7e35
Monitor send queue size. 2022-07-03 14:52:18 +02:00
Bartosz Taudul
3c49dea10c
Link with UniformTypeIdentifiers on macos. 2022-07-03 13:52:39 +02:00
Bartosz Taudul
de0182f12f
Update NFD. 2022-07-03 13:43:27 +02:00
Bartosz Taudul
71b3706486
Increase contrast on timeline CPU data CPU labels. 2022-07-03 13:04:09 +02:00
Bartosz Taudul
6748756fa1
Increase contrast of plot min/max labels. 2022-07-03 13:01:41 +02:00
Bartosz Taudul
f8f76a3d04
Text drawing with even more increased contrast. 2022-07-03 13:01:41 +02:00
Bartosz Taudul
21128be933
Limit number of make jobs. 2022-07-02 17:46:36 +02:00
Bartosz Taudul
c2a9a4e6be
Add missing includes. 2022-07-02 17:13:20 +02:00
Bartosz Taudul
2331ee04d2
Cleanup TracyView includes. 2022-07-02 17:00:08 +02:00
Bartosz Taudul
96dc8c8d1c
No need to include imgui.h in source view header. 2022-07-02 16:33:45 +02:00
Bartosz Taudul
1879d07eae
TracyImGui.hpp does not need assert.h nor algorithm includes. 2022-07-02 16:29:37 +02:00
Bartosz Taudul
4347cc58b1
Forward declare ImFont. 2022-07-02 16:25:47 +02:00
Bartosz Taudul
fa9e7c02bc
No force inlines in TracySocket. 2022-07-02 16:19:54 +02:00
Bartosz Taudul
a46d3992a2
Thread view adjustment is timeline handling. 2022-07-02 15:44:00 +02:00
Bartosz Taudul
d9ce848bb0
Also extract (and rename) timeline mouse handling. 2022-07-02 15:42:01 +02:00
Bartosz Taudul
889e643d2a
Extract ranges UI from View. 2022-07-02 15:40:51 +02:00
Bartosz Taudul
9fb618c12d
Rename DrawZone* -> DrawTimeline*. 2022-07-02 15:38:10 +02:00
Bartosz Taudul
e3b11821c3
Extract zone timeline rendering from View. 2022-07-02 15:36:36 +02:00
Bartosz Taudul
7b04d8c0b3
Extract frames timeline UI from View. 2022-07-02 15:31:03 +02:00
Bartosz Taudul
0d41a6c48b
Move DrawHistogramMinMaxLabel() to TracyImGui.cpp. 2022-07-02 15:27:08 +02:00
Bartosz Taudul
5ed7d71927
DrawAllocList() is memory. 2022-07-02 15:24:59 +02:00
Bartosz Taudul
c2728fde04
Extract locks UI from View. 2022-07-02 15:24:09 +02:00
Bartosz Taudul
10205f90b4
Also extract timeline CPU data. 2022-07-02 15:20:47 +02:00
Bartosz Taudul
c6b6cb47da
Also move timeline samples. 2022-07-02 15:16:52 +02:00
Bartosz Taudul
e005d4ff36
Extract messages UI from View. 2022-07-02 15:15:24 +02:00
Bartosz Taudul
fe8269fa49
Mark syntax colors constexpr. 2022-07-02 15:10:01 +02:00
Bartosz Taudul
87d639c851
Move DrawStripedRect() out of header. 2022-07-02 15:08:52 +02:00
Bartosz Taudul
c427214f46
Move DrawHelpMarker to TracyImGui.hpp. 2022-07-02 15:07:40 +02:00
Bartosz Taudul
358148920a
Extract annotations UI from View. 2022-07-02 15:04:54 +02:00
Bartosz Taudul
5b451c3557
Extract samples UI from View. 2022-07-02 15:04:53 +02:00
Bartosz Taudul
06a840c19a
Wait stacks are context switches. 2022-07-02 15:01:23 +02:00
Bartosz Taudul
585587fa36
Extract frame tree functionality from View. 2022-07-02 15:01:22 +02:00
Bartosz Taudul
8147eadaf0
Extract connection state and notification area. 2022-07-02 14:47:13 +02:00
Bartosz Taudul
de5c4c678a
Extract memory UI from View. 2022-07-02 14:42:06 +02:00
Bartosz Taudul
f3fe8b27e8
Extract plot drawing from View. 2022-07-02 14:36:54 +02:00
Bartosz Taudul
e98b24a9ed
Extract frame overview UI from View. 2022-07-02 14:19:16 +02:00
Bartosz Taudul
b58a206d9d
More utility extract. 2022-07-02 14:14:27 +02:00
Bartosz Taudul
701cc16cbf
Zone tooltip is zone info. 2022-07-02 14:10:36 +02:00
Bartosz Taudul
003621802f
Split callstack UI from View. 2022-07-02 14:09:15 +02:00
Bartosz Taudul
5a3305095e
Extract CPU data UI from View. 2022-07-02 14:04:45 +02:00
Bartosz Taudul
6f99c8d055
Extract trace info UI from View. 2022-07-02 14:03:01 +02:00
Bartosz Taudul
ee18e07d6f
Cosmetics. 2022-07-02 13:59:54 +02:00
Bartosz Taudul
1aeb1d9a2d
More find zones extraction. 2022-07-02 13:58:37 +02:00
Bartosz Taudul
a6cee9e7f7
Extract statistics UI from View. 2022-07-02 13:57:56 +02:00
Bartosz Taudul
749bab7ab0
Extract playback UI from View. 2022-07-02 13:55:45 +02:00
Bartosz Taudul
44e5218301
Extract more utility functions. 2022-07-02 13:51:50 +02:00
Bartosz Taudul
35f55c781b
Extract compare UI from View. 2022-07-02 13:48:54 +02:00
Bartosz Taudul
7ed1c4ffb1
More navigation extraction. 2022-07-02 13:43:46 +02:00
Bartosz Taudul
10dbefefab
Extract context switch UI from View. 2022-07-02 13:43:09 +02:00
Bartosz Taudul
c9f77ee5fa
Move zone info UI out of View. 2022-07-02 13:37:04 +02:00
Bartosz Taudul
b602d61944
Extract options UI from View. 2022-07-02 13:23:52 +02:00
Bartosz Taudul
d19b337573
Split View navigation functions. 2022-07-02 13:16:06 +02:00
Bartosz Taudul
5b8c8c5309
Extract common zone algorithms from View. 2022-07-02 13:12:30 +02:00
Bartosz Taudul
2473760c04
Extract Find Zone UI to a separate file. 2022-07-02 13:12:29 +02:00
Bartosz Taudul
91bbe03448
Merge pull request #418 from czipperz/czipperz/make-tracy.hpp-if-compatible
Make Tracy.hpp compatible with if() statements without curly braces by removing trailing semicolons
2022-07-02 11:08:44 +02:00
Chris Gregory
3a36d583d9 Make Tracy.hpp compatible with if() statements without curly braces by removing trailing semicolons
This change allows the following code to compile:

if (condition)
  ZoneValue(1);
else
  ZoneValue(2);

All examples in the documentation already use a semicolon after a Tracy macro expression
so this shouldn't be a noticable change in behavior for most clients.
2022-07-01 11:24:28 -04:00
Bartosz Taudul
dd6933fe32
Fix striped rect early exit test. 2022-06-29 01:39:06 +02:00
Bartosz Taudul
e6c54600f1
Fix typo. 2022-06-29 01:32:02 +02:00
Bartosz Taudul
f493d4aa8b
Merge pull request #416 from kklobe/kk/fix-meson-options
Fix Meson options to match build
2022-06-28 19:06:49 +02:00
Kirk
64e9f5e814 Fix Meson options to match build 2022-06-28 12:00:09 -05:00
Bartosz Taudul
a8511d3576
Release 0.8.2. 2022-06-28 17:57:46 +02:00
Bartosz Taudul
1f43cfd2b9
Merge pull request #415 from kklobe/kk/fix-gcc-mac-compile-error
Fix macOS GCC 11/12 compile error
2022-06-28 01:21:00 +02:00
Kirk Klobe
49053775e3 Fix macOS GCC 11/12 compile error 2022-06-27 17:37:12 -05:00
Bartosz Taudul
7f35a299c4
Merge pull request #412 from theblackunknown/fix-windows-vcpkg
Fix building on Windows without `VCPKG_ROOT` env var set
2022-06-27 17:22:21 +02:00
MACHIZAUD Andréa
2eed89f0d8 only build Tracy/capture Release for build-without-vcpkg-integration 2022-06-26 23:22:24 +02:00
MACHIZAUD Andréa
75c383a68c non need to package binaries in build-without-vcpkg-integration 2022-06-26 23:13:32 +02:00
MACHIZAUD Andréa
087e1d8036 Fail with error code if install_vcpkg_dependencies.bat commands fail 2022-06-25 17:52:42 +02:00
Bartosz Taudul
a05285083a
Update xxhash filename in MSVC project. 2022-06-23 01:46:56 +02:00
Bartosz Taudul
1625a45c31
On ARM64 use ISB to yield CPU in spinlocks.
c064b6560b
2022-06-23 01:15:55 +02:00
Bartosz Taudul
68de009e0e
Extract common reference time processing to a function. 2022-06-22 01:56:31 +02:00
Bartosz Taudul
183cbf12a0
Subtract base time directly in TscTime(). 2022-06-22 01:56:31 +02:00
Bartosz Taudul
ac1cd62847
Remove unused intrinsic includes. 2022-06-22 00:49:51 +02:00
Bartosz Taudul
84ea1bc35b
Update ImGui OpenGL loader. 2022-06-21 22:37:20 +02:00
Bartosz Taudul
56863f5ab7
Update ImGui to 1.88 + docking. 2022-06-21 22:18:01 +02:00
Bartosz Taudul
771c043c8e
Update ARM CPU part decoding. 2022-06-21 01:58:15 +02:00
Bartosz Taudul
24f0f3b51c
Update iCrap devices list. 2022-06-21 01:36:11 +02:00
Bartosz Taudul
766123b990
Add comments to ARM Part dispatch. 2022-06-21 01:31:55 +02:00
Bartosz Taudul
dcb29aa40c
Update NEWS. 2022-06-21 00:50:03 +02:00
Bartosz Taudul
1468522126
Replace CPU topology tree with CPU schematics. 2022-06-21 00:45:42 +02:00
Bartosz Taudul
2f6399a4b2
Display true values in plot ranges, not animation values. 2022-06-19 00:39:14 +02:00
MACHIZAUD Andréa
84319911c5 Use $(ProjectDir) for vcpkg msbuild without integration paths. 2022-06-18 17:28:56 +02:00
MACHIZAUD Andréa
5e9b007e90 Uses $(VcpkgManifestRoot) for vcpkg msbuild integration paths. 2022-06-18 17:28:56 +02:00
MACHIZAUD Andréa
2b3ce6dd80 Test both way to pull vcpkg dependencies in CI 2022-06-18 17:28:56 +02:00
Bartosz Taudul
331f18345f
Add braces around initialization of subobjects. 2022-06-16 15:29:39 +02:00
Bartosz Taudul
89ef23da55
Install libdebuginfod-dev. 2022-06-16 15:01:24 +02:00
Bartosz Taudul
ce1b5a07fa
Use ubububu 22.04. 2022-06-16 14:46:56 +02:00
Bartosz Taudul
5437185858
Decrease sampling worker sleep time from 10 to 1 ms. 2022-06-16 14:31:47 +02:00
Bartosz Taudul
d99024dd02
Run sampling worker thread at max priority. 2022-06-16 14:24:11 +02:00
Bartosz Taudul
8383682306
Emit warning if priority change failed. 2022-06-16 14:23:42 +02:00
Bartosz Taudul
2240fd3b0c
Remove invalid assert.
The original intention was to ensure that either a ring buffer with data was
selected (sel >= 0 ), or there is no data left to process (activeNum == 0).
However, in an unlikely case that all ring buffers contain a PERF_RECORD_LOST
event, it is possible for the assert to fail, as there may still be data in
buffers, but at the same time no buffer would be selected. Buffer processing
advances the data pointers, so in the next loop iteration the results may be
different.
2022-06-16 14:07:51 +02:00
Bartosz Taudul
aee8336847
Move ring identifier check out of the loop. 2022-06-16 13:48:15 +02:00
Bartosz Taudul
145e3e213a
Move ring identifier extraction out of loop. 2022-06-16 13:39:07 +02:00
Bartosz Taudul
49844872e6
Merge pull request #410 from benvanik/benvanik-fiber-incomplete
Hiding the "Incomplete context switch data" warning on fibers.
2022-06-14 17:17:40 +02:00
Ben Vanik
aa154792c7 Hiding the "Incomplete context switch data" warning on fibers. 2022-06-14 08:01:19 -07:00
MACHIZAUD Andréa
6aec95e739 Fix vcxproj support without vcpkg integrate install 2022-06-13 22:30:56 +02:00
Bartosz Taudul
8f99232e1e
Update NEWS. 2022-06-12 00:39:41 +02:00
Bartosz Taudul
e084f7c9e3
Merge pull request #408 from beqjanus/issue-407
Avoid "Code is unreachable warning"
2022-06-10 17:04:05 +02:00
Beq
66ba9621bd Avoid "Code is unreachable warning" 2022-06-08 23:37:39 +01:00
Bartosz Taudul
0b2e276dd2
Merge pull request #405 from tksuoran/fix-operator-precedence
Use explicit operator precendence, avoids warning
2022-06-06 20:21:59 +02:00
Timo Suoranta
b8a9083037 Use explicit operator precendence, avoids warning 2022-06-06 17:05:43 +03:00
Bartosz Taudul
2ae4a394a9
Merge pull request #401 from thedmd/inactive-allocations
Add ability to filter callstacks in memory tab by inactive allocations.
2022-06-06 11:22:34 +02:00
thedmd
9ed9e18bc8 Add ability to filter callstacks in memory tab by inactive allocations.
Filtering by inactive allocations helps to pin point wasteful allocations
in an app.
2022-06-06 06:45:35 +02:00
Bartosz Taudul
2d8723b69b
Update NEWS. 2022-06-05 13:16:01 +02:00
Bartosz Taudul
411b3137b5
Merge pull request #365 from theblackunknown/msvc+vcpkg-manifest
Using vcpkg manifest for Windows
2022-06-04 16:44:27 +02:00
MACHIZAUD Andréa
4efcb8c3f5 Fix Manual 2022-06-04 16:26:22 +02:00
MACHIZAUD Andréa
8139d94e14 Add information about vcpkg manifest mode in the manual 2022-06-04 16:26:22 +02:00
MACHIZAUD Andréa
fc5fa369c8 Remove vcpkg builtin-baseline 2022-06-04 16:26:22 +02:00
MACHIZAUD Andréa
fa8bcdfb30 Inject appropriate path for manifest install 2022-06-04 16:26:22 +02:00
Bartosz Taudul
958089794b
Fix MSVC warnings snafu. 2022-06-02 22:04:57 +02:00
Bartosz Taudul
a53c8befdc
Update manual. 2022-05-22 15:32:08 +02:00
Bartosz Taudul
c943749bf2
Merge pull request #395 from Aldarrion/master
Fix crash when compare trace not selected
2022-05-20 11:19:43 +02:00
Bartosz Taudul
1989129185
Merge pull request #394 from graydon/build-adjustments
Build adjustments
2022-05-20 11:18:36 +02:00
Pavel Šmejkal
2c63d9b320 Fix crash when compare trace not selected 2022-05-20 09:26:50 +02:00
Graydon Hoare
e862799797
Support TRACY_NO_ISA_EXTENSIONS build flag. 2022-05-19 23:40:33 -07:00
Graydon Hoare
0d4a4f6d9b
Support TRACY_NO_LTO build flag. 2022-05-19 23:40:27 -07:00
Bartosz Taudul
6233cf3fdf
Merge pull request #380 from Honeybunch/master
Slight tweak to get client library working with mingw
2022-05-14 12:48:09 +02:00
Bartosz Taudul
adf3b5803c
Merge pull request #390 from msimberg/patch-2
Remove duplicate `TRACY_NO_FRAME_IMAGE` CMake option
2022-05-11 12:14:21 +02:00
Mikael Simberg
57c13ed138
Remove duplicate TRACY_NO_FRAME_IMAGE CMake option 2022-05-11 09:39:42 +02:00
Honeybunch
80a9865bbf Making mingw check more explicit 2022-05-10 17:30:59 -07:00
Bartosz Taudul
8af7060a69
Merge pull request #389 from msimberg/patch-1
Remove stray comma from `TRACY_NO_CRASH_HANDLER` option
2022-05-10 15:51:19 +02:00
Mikael Simberg
aa089fb1d3
Remove stray comma from TRACY_NO_CRASH_HANDLER option 2022-05-10 15:49:59 +02:00
Bartosz Taudul
4347b5c99c
Allow using GTK file chooser instead of portal one (#387). 2022-05-09 22:37:40 +02:00
MACHIZAUD Andréa
dad0f039c1 Revert "Support capstone 5 from vcpkg"
This reverts commit 504f341f9f2c9a7f770c7a797ece961cf9c1caed.
2022-05-09 10:42:13 +02:00
MACHIZAUD Andréa
eda71a1983 Bump vcpkg baseline 2022-05-09 10:42:12 +02:00
MACHIZAUD Andréa
c22248d8e7 Restore CI 2022-05-09 10:42:12 +02:00
MACHIZAUD Andréa
9d3725fecf Test on gcc.yml 2022-05-09 10:42:12 +02:00
MACHIZAUD Andréa
f8f74c5f57 Support capstone 5 from vcpkg 2022-05-09 10:42:11 +02:00
MACHIZAUD Andréa
599098912e Remove superfluous vcxproj setup thanks to vcpkg integration 2022-05-09 10:42:11 +02:00
MACHIZAUD Andréa
3adc55d66d Fix weird path ? 2022-05-09 10:42:11 +02:00
MACHIZAUD Andréa
1fabf9dfa5 Update vcxproj vcpkg path 2022-05-09 10:42:11 +02:00
MACHIZAUD Andréa
67d255f2bb Test MSVC Workflow 2022-05-09 10:42:10 +02:00
MACHIZAUD Andréa
adcfe4df35 Add Vcpkg manifest + MSBuild integration 2022-05-09 10:42:10 +02:00
Bartosz Taudul
bdd4d28770
Extend max asm line width, if needed. 2022-05-09 00:44:45 +02:00
Bartosz Taudul
76f3207bc4
Restore the intended spacing for extra asm comments. 2022-05-09 00:37:59 +02:00
Bartosz Taudul
0a432ed349
Ignore ld.mold not found error during detection. 2022-05-05 02:40:00 +02:00
Bartosz Taudul
de312c6cc7
Merge pull request #385 from starmole/master
Add lower case e and b tags
2022-05-04 21:56:45 +02:00
Bartosz Taudul
a354eb4ab8
Merge pull request #381 from bjacob/fix-layout-379
Fix layout bug (https://github.com/wolfpld/tracy/issues/379)
2022-05-04 21:48:34 +02:00
smarkets
1efee40100 add lower case e and b tags 2022-05-04 10:56:05 -07:00
Benoit Jacob
2c4fe22f50 Fix layout bug (https://github.com/wolfpld/tracy/issues/379)
I had introduced this bug recently in https://github.com/wolfpld/tracy/pull/369

Fixes #379
2022-05-04 16:26:42 +00:00
Honeybunch
45bd17b7e8 Slight tweak to get client library working with mingw 2022-05-03 18:31:49 -07:00
Bartosz Taudul
8bf21bfb81
Update microarchitecture CPU ids. 2022-05-03 22:15:12 +02:00
Bartosz Taudul
45a4dc154a
Update microarchitectures list. 2022-05-03 22:01:50 +02:00
Bartosz Taudul
60c9b50f81
Update microarchitecture data. 2022-05-03 21:58:23 +02:00
Bartosz Taudul
f4581c398c
Provide 256x256 application icon (was 48x48). 2022-05-03 02:41:10 +02:00
Bartosz Taudul
fa306dd98e
Merge pull request #378 from robertblaketaylor/master
Fix unreachable error when compiling warnings as errors + timer fallback
2022-05-03 01:42:04 +02:00
Blake Taylor
cc33846111 Fix unreachable error when compiling warnings as errors + timer fallback 2022-05-02 16:35:48 -07:00
Bartosz Taudul
579339dd24
Retrieve correct symbol address. 2022-05-02 01:12:35 +02:00
Bartosz Taudul
85e11c2d97
Merge two conditions. 2022-05-02 01:12:35 +02:00
Bartosz Taudul
caf092d4b4
Symbol map is alway available. 2022-05-02 01:12:34 +02:00
Bartosz Taudul
0c9eb0b5be
Absolute source paths are required by debuginfod. 2022-05-02 01:12:34 +02:00
Bartosz Taudul
6455fcfa91
Make source code query handling easier to follow.
Also, limit debuginfod source file upload to not exceed target frame size.
2022-05-02 01:12:34 +02:00
Bartosz Taudul
b6f155bb6a
Move debuginfod include to TracyCallstack.hpp. 2022-05-02 01:12:34 +02:00
Bartosz Taudul
f540f3ad89
Remove accidentally committed line. 2022-05-02 01:12:34 +02:00
Bartosz Taudul
6e6f19d8f7
Query debuginfod for source code. 2022-05-02 01:12:34 +02:00
Bartosz Taudul
726b70b683
Add debuginfod context accessor. 2022-05-02 01:12:33 +02:00
Bartosz Taudul
ae373b4050
Implement build id retrieval by image name. 2022-05-02 01:12:33 +02:00
Bartosz Taudul
324cab3d34
Merge pull request #377 from Net5F/net/build_option_fixes
Fix build options, add TRACY_TIMER_FALLBACK option.
2022-05-01 23:32:15 +02:00
Michael Puskas
a5ea07f107 Fix build options, add TRACY_TIMER_FALLBACK option.
Renamed TRACY_NO_SYS_TRACE -> TRACY_NO_SYSTEM_TRACING to match the
build flag name. Unlike the meson logic, the CMake logic directly
maps the option name to the build flag that is injected. With the
mismatched name, the flag wasn't being properly applied.

Added TRACY_TIMER_FALLBACK option to expose the same-named flag.

Moved signal.h include to get sigaction definition that was missing when
TRACY_NO_CALLSTACK was defined.
2022-05-01 13:52:27 -07:00
Bartosz Taudul
aa2bbfe5f9
Transfer executable image name in source file queries. 2022-05-01 14:30:18 +02:00
Bartosz Taudul
fd55c1e975
Pass symbol image name to CacheSource(). 2022-05-01 14:25:07 +02:00
Bartosz Taudul
33a6853423
Use big font to print save path. 2022-05-01 13:04:16 +02:00
Bartosz Taudul
ce4c83d45b
String length is known, use memcpy instead of strcpy. 2022-05-01 12:46:09 +02:00
Bartosz Taudul
20cfdc3022
Save executable file names next to build identifiers. 2022-05-01 12:43:15 +02:00
Bartosz Taudul
b4343d58f1
Pass filename to elf_open_debugfile_by_buildid.
This is not needed for anything at this moment, but it will become quite useful
soon.
2022-05-01 12:21:51 +02:00
Bartosz Taudul
89778fee9a
Free dl_iterate_phdr data immediately after use. 2022-05-01 12:18:39 +02:00
Bartosz Taudul
4f1af9deaa
Restrict debuginfod to Linux. 2022-05-01 01:04:05 +02:00
Bartosz Taudul
59a9dc80c4
Update manual. 2022-05-01 00:38:43 +02:00
Bartosz Taudul
4c3b106e5e
Update NEWS. 2022-04-30 23:29:42 +02:00
Bartosz Taudul
6b10ed0af7
Remove debug info retrieval and download separation.
Retrieval of the descriptor has to be performed in a single step. Finding out
what is missing and then downloading in bulk is not possible, as libbacktrace
caches the returned descriptors.
2022-04-30 23:23:20 +02:00
Bartosz Taudul
7e8961d2fc
Workaround dl_iterate_phdr problems.
The code now performs a dry run of a dl_iterate_phdr call, storing the results
in a vector. Then, the original processing loop is issued, but outside of
dl_iterate_phdr.

For possible cause of problems see:
https://github.com/libunwind/libunwind/issues/16
2022-04-30 23:15:16 +02:00
Bartosz Taudul
4559120821
Get descriptors using debuginfod, if not available otherwise. 2022-04-30 21:46:36 +02:00
Bartosz Taudul
4549671caa
Collect and issue debuginfod requests.
Build identifiers stored in vectors are searched linearly. While not optimal,
this is enough for a basic implementation. In the future binary search option
may be explored, to see if it is worthwhile. Possible gains wouldn't be
significant, due to relatively small amount of debug info modules to handle.

Debug info descriptor requests that have not yet been checked for (i.e. not in
the s_di_known vector) are stored in the s_di_pending vector. When a check is
performed from within a libbacktrace callback handler, there are some unknown
problems with downloading data. Hence, the download process is delayed to be
performed at a later time. The debug info descriptors retrieval can be then
repeated.
2022-04-30 21:35:14 +02:00
Bartosz Taudul
d9fb5c71eb
Add debug info data structures. 2022-04-30 20:07:47 +02:00
Bartosz Taudul
bae12548c7
Enable debuginfod in test application. 2022-04-30 19:19:47 +02:00
Bartosz Taudul
8b477291f2
Initialize debuginfod session. 2022-04-30 19:19:00 +02:00
Bartosz Taudul
532c5a240c
Add no-op callstack cleanup procedure. 2022-04-30 19:18:52 +02:00
Bartosz Taudul
6d6b7c0989
Add test application build and run configuration. 2022-04-30 19:02:47 +02:00
Bartosz Taudul
d0be4fa784
Update profiler description. 2022-04-30 19:02:34 +02:00
Bartosz Taudul
d80ad500ee
Do not pass linker flags during compilation. 2022-04-30 19:02:06 +02:00
Bartosz Taudul
254e87cbac
Fix preprocessor syntax. 2022-04-30 19:00:54 +02:00
Bartosz Taudul
2ef014608f
Notify when software sampling setup has failed. 2022-04-29 19:13:40 +02:00
Bartosz Taudul
4c0dd704d8
There are situations in which inSym can be nullptr.
Don't know exactly how to reproduce this. Nevertheless, the capture was
produced in an usual way. This may be dependant on the exact client
configuration.
2022-04-29 19:13:34 +02:00
Bartosz Taudul
fc37f3c04c
Remove leftovers. 2022-04-29 19:13:26 +02:00
Bartosz Taudul
31b3212f76
The mold linker is not recognized by gcc. 2022-04-29 19:13:16 +02:00
Bartosz Taudul
3bc42faeb3
Fix clang test. 2022-04-29 19:13:09 +02:00
Bartosz Taudul
7d80c088fc
Use mold for even faster linking. 2022-04-29 19:12:43 +02:00
Bartosz Taudul
d71ecd5271
Make test program data generation rate more sensible. 2022-04-29 19:12:20 +02:00
Bartosz Taudul
18fec05e57
Merge pull request #375 from robertblaketaylor/master
Add flag to disable crash handler
2022-04-29 00:18:01 +02:00
Blake Taylor
aa7c1db6ad Merge branch 'master' of https://github.com/robertblaketaylor/tracy 2022-04-27 07:13:31 -07:00
Blake Taylor
8c5120ee5a Add flag to disable crash handler 2022-04-27 07:11:53 -07:00
Blake Taylor
5fb8b38f3a Add flag to disable crash handler 2022-04-26 21:19:56 -07:00
Bartosz Taudul
afd4cdec63
LTO + lld wants the compiler to be clang. 2022-04-27 02:33:22 +02:00
Bartosz Taudul
b10c83f358
Use lld linker, if available. 2022-04-27 02:17:16 +02:00
Bartosz Taudul
7f44eba2e9
Process command line parameters immediately after starting. 2022-04-27 01:51:30 +02:00
Bartosz Taudul
92dc52d530
Add --help message to GUI profiler. 2022-04-27 01:44:26 +02:00
Bartosz Taudul
1e35bbd54e
Join update thread before bailing out on bad input. 2022-04-27 01:39:51 +02:00
Bartosz Taudul
1b7e8c3520
Use ImGui keycodes. 2022-04-27 01:16:46 +02:00
Bartosz Taudul
0d547bf4db
Update ImGui to 1.87 + docking. 2022-04-27 00:49:37 +02:00
Bartosz Taudul
bc36f5ff27
Fix buffer overflow. 2022-04-26 22:42:54 +02:00
Bartosz Taudul
7493663e13
It's Debian, it's always Debian.
/usr/lib/gcc/x86_64-linux-gnu/9/include/cpuid.h:223:1: error: redefinition of ‘unsigned int __get_cpuid_max(unsigned int, unsigned int*)’
In file included from ../../client/TracyProfiler.cpp:108,
                 from ../../TracyClient.cpp:23:
/usr/lib/gcc/x86_64-linux-gnu/9/include/cpuid.h:223:1: note: ‘unsigned int __get_cpuid_max(unsigned int, unsigned int*)’ previously defined here
2022-04-26 22:19:32 +02:00
Bartosz Taudul
80d760d950
Define NEON data tables only if NEON is available. 2022-04-26 22:01:09 +02:00
Bartosz Taudul
95cf143336
Remove unused variables. 2022-04-26 22:01:09 +02:00
Bartosz Taudul
c9240c100d
Fix initialization order. 2022-04-26 22:01:09 +02:00
Bartosz Taudul
066c266df9
Add missing includes. 2022-04-26 22:01:09 +02:00
Bartosz Taudul
1a94929780
Use clang to make VS Code builds.
This should improve build times to take only ~65% of time.
2022-04-26 21:19:56 +02:00
Bartosz Taudul
1f3ebc9f41
Use item spacing instead of ExtraLineHeight. 2022-04-26 21:11:38 +02:00
Bartosz Taudul
d56741cbeb
Stop pretending to not require additional fonts. 2022-04-25 23:29:44 +02:00
Bartosz Taudul
e0897e8e40
Draw wait reason/state explanation with small font. 2022-04-25 03:05:12 +02:00
Bartosz Taudul
b59739fac2
Update launch configurations. 2022-04-24 16:07:49 +02:00
Bartosz Taudul
3b33a49bd8
Setup VS Code build tasks. 2022-04-24 16:07:49 +02:00
Bartosz Taudul
2dd61aba49
Makefiles can now build clangd database.
Executing the "make db" will run the build process of the selected tool or
library through the bear wrapper (which has to be available in the system),
which will record the compilation parameters of each source file. This
database can be then used by VS Code to set the proper defines and find all
the required includes.

Note that database building is performed in context of the specific tool or
library. Not all tools have the same set of flags.
2022-04-23 23:46:55 +02:00
Bartosz Taudul
67ab3acbd0
Ignore clangd compile commands database. 2022-04-23 23:16:48 +02:00
Bartosz Taudul
e7be9b4e21
Update vscode debug launch configuration for lldb. 2022-04-23 23:16:13 +02:00
Bartosz Taudul
1dbca1b9bc
Ignore .cache directory.
Such directory may be created by the clangd server.
2022-04-23 23:06:19 +02:00
Bartosz Taudul
37a4478127
Fix horizontal scroll of main window.
Horizontal mouse scroll (or touchpad action) should map to navigation within
the trace. While this was true in most cases, there was an edge case, when the
top buttons row couldn't be entirely displayed, e.g. due to the window being
resized too small, or due to set zoom level. This change disables scroll
action on the main window, which fixes the issue.
2022-04-22 22:38:05 +02:00
Bartosz Taudul
6f126ce0f5
Stop playback when frame is changed with mouse scroll. 2022-04-22 22:02:04 +02:00
Bartosz Taudul
9757fcc0ef
Mouse scroll over playback image also changes frame. 2022-04-22 22:02:03 +02:00
Bartosz Taudul
d9684dcb71
Merge pull request #370 from tmayoff/meson-msvc
Removing C++11 option from msvc in meson build
2022-04-22 15:15:23 +02:00
Tyler Mayoff
27d8f2a65c
Removing c++11 option from msvc 2022-04-21 19:47:36 -04:00
Bartosz Taudul
80f6a93da7
Release 0.8.1. 2022-04-21 19:28:07 +02:00
bjacob
e6a29862ec
Fix column widths for hw counts and source location (#369)
Fix column widths for hw counts and source location
2022-04-21 18:30:55 +02:00
Bartosz Taudul
3d10a7dfed
Update libraries to install on CI. 2022-04-20 19:40:27 +02:00
Bartosz Taudul
ffc5b54409
Update NEWS. 2022-04-20 19:40:27 +02:00
Bartosz Taudul
02cacc0d4a
Update manual. 2022-04-20 19:40:27 +02:00
Bartosz Taudul
94b283b1e6
Use native file selector on Linux. 2022-04-20 19:40:27 +02:00
Bartosz Taudul
e870d68a47
Specify proper NFD GTK source file. 2022-04-20 19:40:27 +02:00
Bartosz Taudul
a852cf390a
Adapt code to new NFD. 2022-04-20 19:40:27 +02:00
Bartosz Taudul
70a8da90ad
Switch NFD to NFD Extended. 2022-04-20 19:40:27 +02:00
Bartosz Taudul
1a1d7bbb54
Sync libbacktrace with 4d2dd0b. 2022-04-20 01:14:41 +02:00
Bartosz Taudul
5439a7cd8a
Update NEWS. 2022-04-18 15:15:42 +02:00
Bartosz Taudul
1e762c246a
Don't show callstack column in messages, if no callstacks. 2022-04-18 15:06:23 +02:00
Bartosz Taudul
468add6799
Update identify.cpp build instructions. 2022-04-18 14:01:56 +02:00
Bartosz Taudul
7cf6123b80
Update NEWS. 2022-04-18 14:00:24 +02:00
Bartosz Taudul
18112d3c66
Drop support for pre-0.7 traces. 2022-04-18 13:59:48 +02:00
Bartosz Taudul
95187c94e9
Bump protocol to simplify IsQueryPrio(). 2022-04-18 13:39:49 +02:00
Bartosz Taudul
cd3f9c8831
Minimize SVG files. 2022-04-16 00:13:10 +02:00
Bartosz Taudul
35ab270ac3
Replace application-icon PNG with SVG. 2022-04-15 23:42:11 +02:00
Bartosz Taudul
6998546f27
Add file icon. 2022-04-13 23:35:06 +02:00
Bartosz Taudul
278c77e485
Update NEWS. 2022-04-13 23:03:48 +02:00
Bartosz Taudul
d0a234bbf5
Add tracy dump mime type definition. 2022-04-13 23:01:06 +02:00
Bartosz Taudul
9013d71d70
Steal desktop entry definition from AUR repository. 2022-04-13 21:55:14 +02:00
Bartosz Taudul
5eb724f34c
Add touchpad support for frames overview. 2022-04-13 01:37:56 +02:00
Bartosz Taudul
29b9d8ffe5
Merge pull request #362 from bjacob/capture-logging
make progress info and ANSI escapes conditional on being a TTY
2022-04-12 23:08:08 +02:00
Benoit Jacob
10ad96c29e 4-space indent 2022-04-12 20:36:08 +00:00
Benoit Jacob
92fdf12e05 make progress info and ANSI colors conditional on being a TTY 2022-04-12 20:31:47 +00:00
Bartosz Taudul
139fad81b9
Merge pull request #363 from bjacob/volatile-disconnect
Make `disconnect` atomic as it's written by a signal handler.
2022-04-12 21:18:40 +02:00
Benoit Jacob
ce1f6d0526 explicitly initialize as false - hope the compiler optimizes that 2022-04-12 17:47:14 +00:00
Benoit Jacob
331f39e6a5 rename to s_disconnect and make file-scope static 2022-04-12 17:45:33 +00:00
Benoit Jacob
55ae38a138 Make disconnect atomic because it's written by a signal handler 2022-04-12 17:34:41 +00:00
Bartosz Taudul
ccf35eb24a
Merge pull request #364 from Juice-Labs/meson-support
Adding tracy_no_sys_trace to enable MinGW builds which have an older version of envtprov.h
2022-04-12 19:13:13 +02:00
David McCloskey
f11e71fd09 Adding tracy_no_sys_trace to enable MinGW builds which have an older version of envtprov.h 2022-04-12 12:07:21 -05:00
Benoit Jacob
8c3868e43b Make disconnect volatile as it's written by a signal handler. 2022-04-12 16:06:54 +00:00
Bartosz Taudul
9b15870991
Merge pull request #361 from Juice-Labs/meson-support
Updating meson to perform a full build.
2022-04-08 19:55:02 +02:00
David McCloskey
ce8cb54b1b Updating meson to perform a full build. 2022-04-08 12:18:08 -05:00
Bartosz Taudul
1fd39e90b9
Implement navigation from jump arrow context menu. 2022-04-06 23:41:46 +02:00
Bartosz Taudul
0e56397c5a
Don't show empty menu when source is not available. 2022-04-06 23:34:30 +02:00
Bartosz Taudul
6854055b49
Add symbol view screenshot. 2022-04-06 02:26:36 +02:00
Bartosz Taudul
5ea8c8ea5e
Update NEWS. 2022-04-06 02:04:25 +02:00
Bartosz Taudul
7893a83633
Display jump arrow context (src and target source code). 2022-04-06 02:01:29 +02:00
Bartosz Taudul
db3736983a
Always open jump arrow context menu. 2022-04-06 02:01:07 +02:00
Bartosz Taudul
4555910536
Extract source fragment printing functionality. 2022-04-06 01:54:14 +02:00
Bartosz Taudul
1b3464a386
Fix wrong source color box. 2022-04-06 01:42:13 +02:00
Bartosz Taudul
e34d79c0c7
Display target location for local jumps. 2022-04-06 01:23:35 +02:00
Bartosz Taudul
a763991a00
Note that feature flags must be consistent. 2022-04-05 20:51:37 +02:00
Bartosz Taudul
fc473a0c9d
Merge pull request #359 from robertblaketaylor/master
Set thread init false on thread exit for manual lifetime cases
2022-04-05 20:35:02 +02:00
Blake Taylor
c176d1d603 -Set thread init false on thread exit for manual lifetime cases 2022-04-05 09:12:05 -07:00
Bartosz Taudul
3d28d1259b
Check if ring buffer was properly mapped. 2022-04-04 17:56:40 +02:00
Bartosz Taudul
2b24ad27b2
Update NEWS. 2022-04-01 19:11:02 +02:00
Bartosz Taudul
2fc64fceba
Select appropriate branch cost, if no retirement data. 2022-04-01 19:09:56 +02:00
Bartosz Taudul
88a153504d
Show branch impact if no retirement data available.
Some CPUs are only able to report branch miss data, but not branch retirement
data.
2022-04-01 19:06:15 +02:00
Bartosz Taudul
d8ec98042a
Add branch retirement state accessor. 2022-04-01 18:48:11 +02:00
Bartosz Taudul
381f706796
Remember if there is branch retirement data. 2022-04-01 18:46:46 +02:00
Bartosz Taudul
4a8c4bde34
Update NEWS. 2022-04-01 18:35:19 +02:00
Bartosz Taudul
e83e83dae9
Revert "Backport SPSCQueue commit 3086fa9."
This reverts commit 2a3a57d245cc3e0736076dadeefd16f60853582f.

Fucking MSVC 2015 has chosen to emit errors on unsupported attributes.
2022-04-01 16:46:50 +02:00
Bartosz Taudul
ffc06087b9
Advise to set perf_event_paranoid to -1.
This enables access to context switch data.
2022-04-01 15:21:10 +02:00
Bartosz Taudul
1efb979e47
Add 0.8 video to README. 2022-03-31 02:13:31 +02:00
Bartosz Taudul
2b47c2a64e
Send priority queries before other queued up queries.
This ensures that simple to handle yet important queries are answered in a
timely manner. Previously an onslaught of slow symbol-related queries could
block e.g. zone name resolving for a couple of minutes.
2022-03-31 00:06:49 +02:00
Bartosz Taudul
5ae9e791a5
Make easy check first. 2022-03-31 00:06:49 +02:00
Bartosz Taudul
d691cb2a06
Define a list of priority queries. 2022-03-31 00:02:02 +02:00
Bartosz Taudul
8aeda02d8a
Update manual. 2022-03-30 16:32:35 +02:00
Bartosz Taudul
36fe040a3a
Update NEWS. 2022-03-30 16:11:02 +02:00
Bartosz Taudul
8532c2d1e0
Expose source file scan in update utility. 2022-03-30 16:08:20 +02:00
Bartosz Taudul
a335efe9e6
Implement scanning for source files missing in cache. 2022-03-30 16:07:15 +02:00
Bartosz Taudul
e086488928
Extract source file caching functionality. 2022-03-30 16:06:35 +02:00
Bartosz Taudul
9ba7171c3d
Release 0.8.0. 2022-03-28 21:20:44 +02:00
Bartosz Taudul
6b340b3700
Merge pull request #347 from bjacob/set-numcpus
set s_numCpus before reading it
2022-03-24 19:59:05 +01:00
Benoit Jacob
5eb3e3a1f0 set s_numCpus before reading it 2022-03-24 18:31:38 +00:00
Bartosz Taudul
fd604444eb
Merge pull request #346 from mcourteaux/master
Warn the user about capstone deprecated branch in the manual.
2022-03-23 18:09:38 +01:00
Bartosz Taudul
2e4c63c6dd
Fix typos. 2022-03-23 18:09:16 +01:00
Martijn Courteaux
9c9c11ae9e Warn the user about capstone deprecated branch in the manual. 2022-03-23 18:05:22 +01:00
Bartosz Taudul
f1fea0331a
Merge pull request #344 from thedmd/callstack_table-clipboard_full_location
In callstack table view, copy full location with line to clipboard
2022-03-19 15:37:59 +01:00
thedmd
dc79ae6fea In callstack table view, copy location with line to clipboard instead just location. 2022-03-19 09:48:48 +01:00
Bartosz Taudul
2a3a57d245
Backport SPSCQueue commit 3086fa9. 2022-03-18 02:09:00 +01:00
Bartosz Taudul
c2fcc699be
Apply SPSCQueue commit 62cdc1f3. 2022-03-18 02:05:55 +01:00
Bartosz Taudul
fdee87b0ae
Update robin_hood to 3.11.5. 2022-03-18 02:01:46 +01:00
Bartosz Taudul
ea59552c4e
Bump zstd to 1.5.2. 2022-03-18 01:52:11 +01:00
Bartosz Taudul
7d14aac137
Set focus on input field when find zone window appears. 2022-03-18 01:47:58 +01:00
Bartosz Taudul
3bb2094751
Sync libbacktrace with 2446c6. 2022-03-18 01:46:12 +01:00
Bartosz Taudul
dc874a732e
Merge pull request #339 from voysys/fix-server-assertion-crash
Ignore uninitialized GPU contexts when rendering GPU events
2022-03-17 18:54:34 +01:00
Bartosz Taudul
4d33dc0f3e
Update manual. 2022-03-15 17:51:28 +01:00
Bartosz Taudul
16f44d021d
Update NEWS. 2022-03-15 17:36:56 +01:00
Bartosz Taudul
8483ef4310
Indicate currently selected annotation. 2022-03-15 17:36:01 +01:00
Bartosz Taudul
4be2aa0682
Allow adding full-view annotations. 2022-03-15 17:26:12 +01:00
Bartosz Taudul
ba4b261ae4
Make the annotations list always accessible. 2022-03-15 17:25:52 +01:00
Bartosz Taudul
f17a579753
Move adding annotations to a separate function. 2022-03-15 17:25:28 +01:00
Bartosz Taudul
42688c9bf3
Add id to annotation description input box. 2022-03-15 17:24:53 +01:00
Bartosz Taudul
0b1e5d2c96
Define ___tracy_demangle on Android. 2022-03-11 15:40:56 +01:00
Bartosz Taudul
469774b1a9
Merge pull request #341 from teajay-fr/bugfix/access_violation_on_error
Avoid accessing address 0 when reporting a failure.
2022-03-10 14:52:40 +01:00
Thomas Bernard
79e146c957 Avoid accessing address 0 when reporting a failure. 2022-03-10 14:28:31 +01:00
Bartosz Taudul
7d3c7049dc
Fix compilation on MSVC 2015. 2022-03-10 12:27:44 +01:00
Niclas Olmenius
2c79194e7d Ignore uninitialized GPU contexts when rendering GPU events
This fixes an assertion crash when viewing GPU zones when no zones have been
recorded on a GPU context if the client is compiled with TRACY_ON_DEMAND
2022-03-09 19:20:56 +01:00
Bartosz Taudul
90d8762c33
Merge pull request #337 from simonvanbernem/master
Make install_vcpkg_dendencies.bat work from any working directory
2022-03-07 19:08:55 +01:00
Simon van Bernem
8c155f8adc Made install_vcpkg_dendencies.bat work from any working directory
pushd %~dp0 will push the directory that contains the file as the working directory and we also pop it at the end to be a good citizen and restore the previous working directory
2022-03-07 18:44:51 +01:00
Bartosz Taudul
843713a96e
Update manual. 2022-03-03 19:05:16 +01:00
Bartosz Taudul
efe22461cc
Implement going to parent zone in find zone window. 2022-03-03 15:39:07 +01:00
Bartosz Taudul
ee4f4f491f
Merge pull request #334 from daverigby/master
Fix macOS build breaks when _GNU_SOURCE defined
2022-02-28 17:44:59 +01:00
Dave Rigby
2073ffb684 program_invocation_short_name is Linux-specific
'program_invocation_short_name' is Linux-specific; other OSs such as
macOS do not support it.

Fixes build break on macOS 12.2 with _GNU_SOURCE defined.
2022-02-28 16:09:06 +00:00
Dave Rigby
31e4bef135 pthread_setname_np takes 1 arg on macOS
pthread_setname_np() can only set the name of the current thread on
macOS, so only pass a single name argument.

Fixes build break on macOS 12.2 with _GNU_SOURCE defined.
2022-02-28 16:07:12 +00:00
Bartosz Taudul
6c33a23390
Merge pull request #333 from sideeffects/opencl_transient
Add transient OpenCL Zones.
2022-02-27 23:19:11 +01:00
johner
194471487d Update TracyOpenCL.hpp
Add transient OpenCL Zones.
2022-02-27 15:53:24 -06:00
Bartosz Taudul
a0ae37a350
Merge pull request #332 from Lectem/cmake_options
CMake: Add missing options
2022-02-23 22:39:19 +01:00
Clément Grégoire
f4f558bdc9 CMake: New description for TRACY_CALLSTACK 2022-02-23 14:29:20 +01:00
Clément Grégoire
d48fdafde7 Fix IPV4 -> IPv4 typo 2022-02-23 14:16:50 +01:00
Clément Grégoire
92a0feb821 CMake: Add the new TRACY_NO_CALLSTACK option 2022-02-23 14:09:04 +01:00
Clément Grégoire
2844fea858 CMake: Add missing options 2022-02-23 10:58:31 +01:00
Bartosz Taudul
a43da3dc13
Update manual. 2022-02-22 21:26:55 +01:00
Bartosz Taudul
6e1d4a7ec1
Update NEWS. 2022-02-22 21:26:55 +01:00
Bartosz Taudul
e2b0268d7a
Allow disabling callstack handling. 2022-02-22 21:26:55 +01:00
Bartosz Taudul
d318f75123
Merge pull request #325 from BrychDaneel/automatic_timer_fallback
Automatic timer fallback
2022-02-21 13:47:50 +01:00
Daniil Brychikov
a9ba1ce688 Codestyle fixes 2022-02-19 11:44:15 +03:00
Daniil Brychikov
73f6c66cde Automatic timer fallback 2022-02-16 15:18:45 +03:00
Bartosz Taudul
46d2977694
prev_state is long. 2022-02-14 22:34:20 +01:00
Bartosz Taudul
9f2ffb05ac
Check if memory can be allocated in a thread.
Consider running the following code with operator new and delete overloaded to
track allocations with call stacks:

std::thread( []({ thread_local std::string str; });

Each call stack requires a memory allocation to be performed by the profiler,
to make the stack available at a later time. When the thread is created, the
TLS block is initialized and the std::string buffer can be allocated. To track
this allocation, rpmalloc has to be initialized. This initialization also
happens within the TLS block.

Now, when the thread exits, the heap managed by rpmalloc may be released first
during the TLS block destruction (and if the destruction is performed in
reverse creation order, then it *will* be destroyed first, as rpmalloc was
initialized only after the std::string initialization, to track the allocation
performed within). The next thing to happen is destruction of std::string and
release of the memory block it contains.

The release is tracked by the profiler, and as mentioned earlier, to save the
call stack for later use, a memory allocation is needed. But the allocator is
no longer available in this thread, because rpmalloc was released just before!

As a solution to this issue, profiler will detect whether the allocator is
still available and will ignore the call stack, if it's not. The other
solution is to disable the rpmalloc thread cleanup, which may potentially
cause leak-like behavior, in case a large number of threads is spawned and
destroyed.

Note that this is not a water-tight solution. Other functions will still want
to allocate memory for call stacks, but it is rather unlikely that such calls
would be performed during TLS block destruction. It is also possible that the
event queue will run out of allocated space for events at this very moment,
and in such a case the allocator will also fail.
2022-02-14 17:55:46 +01:00
Bartosz Taudul
793e6b0e29
Add rpmalloc thread state accessor. 2022-02-14 17:53:27 +01:00
Bartosz Taudul
20680fa6a3
Keep track of rpmalloc thread shutdown state. 2022-02-14 17:52:33 +01:00
Bartosz Taudul
72ae4d2ee4
Merge pull request #326 from Lectem/install_namepace
CMake install should use the Tracy:: namespace
2022-02-12 01:14:52 +01:00
Bartosz Taudul
278878e4f1
Merge pull request #327 from Lectem/fix_cmake_uwp
Fix missing TracyUwp in the CMake headers install
2022-02-12 00:26:57 +01:00
Clément Grégoire
5a67fa99a7 Fix missing TracyUwp in the CMake headers install 2022-02-12 00:20:37 +01:00
Clément Grégoire
0b6c60de76 Since tracy provides the Tracy::TracyClient it should also install with that namespace 2022-02-11 23:58:47 +01:00
Bartosz Taudul
4084dec939
Update AUTHORS. 2022-02-11 20:22:53 +01:00
Bartosz Taudul
af136f8289
Update NEWS. 2022-02-11 20:21:32 +01:00
Bartosz Taudul
a2d017c456
Merge pull request #324 from shapr3d/uwp_fix
Make Tracy usable in UWP applications
2022-02-11 20:20:18 +01:00
Balazs Kovacsics
aa44cedcd2 Fix indentation 2022-02-11 17:14:16 +01:00
Balazs Kovacsics
85e16ee33a Add UWP platform limitations to manual 2022-02-11 14:14:27 +01:00
Balazs Kovacsics
a0a56eaf9e Move TRACY_UWP define to own header 2022-02-10 20:26:45 +01:00
Balazs Kovacsics
7169f5f30a Fix compiling TracyClient.cpp on UWP with defined TRACY_ENABLE 2022-02-09 22:14:36 +01:00
Balazs Kovacsics
10b3d7ad82 Fix compiling TracyClient.cpp on UWP with undefined TRACY_ENABLE 2022-02-09 18:25:04 +01:00
Bartosz Taudul
92b182d47e
Font Awesome is licensed under SIL OFL.
"In the Font Awesome Free download, the SIL OFL license applies to all icons
packaged as web and desktop font files."
2022-02-08 21:30:49 +01:00
Bartosz Taudul
fe927d63f7
Update to Font Awesome 6. 2022-02-08 21:27:51 +01:00
Bartosz Taudul
1a4f369d4a
Backport 19471da from ImGui.
https://github.com/ocornut/imgui/issues/4920
2022-02-03 01:59:56 +01:00
Bartosz Taudul
f058ad01fc
Don't process ring buffers when not connected in on-demand mode. 2022-01-31 20:53:10 +01:00
Bartosz Taudul
361782f3fd
Fix edge case triggered by mouse being out-of-window. 2022-01-29 15:53:50 +01:00
Bartosz Taudul
df96293477
Create GPU source location zones stats entry, if not present.
In case of CPU statistics data, this entry is created during creation of a
source location. This won't be done for GPU zones, as it would needlessly
expand the number of held entries. This is assuming the number of GPU zones
is significantly less than the number of CPU zones.
2022-01-29 15:45:25 +01:00
Bartosz Taudul
32173dca29
Update NEWS. 2022-01-29 15:35:52 +01:00
Bartosz Taudul
f4043d9bb8
Display GPU zone statistics. 2022-01-29 15:35:25 +01:00
Bartosz Taudul
45c7edcc96
GPU source locations zones data accessor. 2022-01-29 15:22:49 +01:00
Bartosz Taudul
6d55f79109
Save source location data counts. 2022-01-29 15:14:43 +01:00
Bartosz Taudul
2ca4b0058a
Add AreGpuSourceLocationZonesReady() query. 2022-01-29 00:51:43 +01:00
Bartosz Taudul
ba87929074
Perform GPU statistics reconstruction.
Note: Zone counts are currently being calculated, but they are not being
saved. Proper usage of this data (as is performed in the CPU counterpart)
would remove the possibility of insertion of new entries into the map in
ReconstructZoneStatistics().
2022-01-29 00:48:01 +01:00
Bartosz Taudul
7870ca9da6
Add GPU mutable children accessor. 2022-01-29 00:40:11 +01:00
Bartosz Taudul
7a1b9efc2f
Add GPU statistics radio button. 2022-01-29 00:33:53 +01:00
Bartosz Taudul
28d029f820
Collection of GPU statistics. 2022-01-29 00:15:33 +01:00
Bartosz Taudul
f9279afaec
GPU zone counting. 2022-01-29 00:15:32 +01:00
Bartosz Taudul
f1095bba12
GPU statistics data accessors. 2022-01-29 00:15:32 +01:00
Bartosz Taudul
8533bdf5f4
Add data structures for GPU statistics. 2022-01-29 00:15:31 +01:00
Bartosz Taudul
fcced3c76a
Don't call SameLine() twice in a row. 2022-01-29 00:15:31 +01:00
Bartosz Taudul
3ee91b909f
Unify comparison for accumulation mode combo box. 2022-01-29 00:15:28 +01:00
Bartosz Taudul
f3f5f1dab8
Merge pull request #313 from cloudhan/update-opencl
Update OpenCL
2022-01-28 12:01:00 +01:00
Cloud Han
c9fb07ffe5 remove blocking collect 2022-01-28 11:55:42 +08:00
Bartosz Taudul
701ecdebaa
Merge pull request #317 from hulakdar/master
Fix MSVC warnings
2022-01-26 21:46:25 +01:00
hulakdar
e98f7e5019 Fix potentially unitialized value warning 2022-01-26 21:08:54 +02:00
hulakdar
9fda60820a Silence padding warnings, as this is intended behaviour 2022-01-26 21:08:54 +02:00
Cloud Han
f6769ecb91 better error discoverability if queue is not created with CL_QUEUE_PROFILING_ENABLE 2022-01-25 12:59:35 +08:00
Cloud Han
9b60c4970e better example 2022-01-25 12:59:35 +08:00
Cloud Han
21b748ac84 add back non-blocking collect 2022-01-25 12:59:28 +08:00
Cloud Han
d660425e00 mute warnings 2022-01-25 12:17:11 +08:00
Cloud Han
f8d231bbc9 stop using macro in TRACY_CL_CHECK_ERROR 2022-01-25 12:17:11 +08:00
Cloud Han
e28c562a20 add log and simple statistics for async kernel 2022-01-25 12:17:04 +08:00
Cloud Han
f6894c8d6c Make OpenCL example async 2022-01-25 12:17:03 +08:00
Cloud Han
d5d0a8676e Update OpenCL support for better error discoverability
Solely rely on `assert` make the error undiscoverable because it only
works if NDEBUG is not defined. Always log with TracyMessage for Release
build.
2022-01-25 12:17:03 +08:00
Bartosz Taudul
8331df64be
Merge pull request #315 from hulakdar/master
Actually check for the required feature
2022-01-22 12:38:26 +01:00
hulakdar
683fcbe5a4 Actually check for the required feature 2022-01-22 11:24:59 +02:00
Bartosz Taudul
332c3aa242
Merge pull request #314 from Dantali0n/fix-opencl-vectoradd
Fix OpenCLVectorAdd example
2022-01-20 13:03:28 +01:00
Bartosz Taudul
94bcc6ffcc
Update OpenCLVectorAdd.cpp
Cosmetics.
2022-01-20 13:02:38 +01:00
Dantali0n
e73d21f5da Bump OpenCLVectorAdd cmake version to 3.10 2022-01-20 12:44:00 +01:00
Dantali0n
1120f0b07e Cross platform solution to linking OpenCLVectorAdd libraries 2022-01-20 12:42:51 +01:00
Dantali0n
bff83aab4a Fix OpenCLVectorAdd example 2022-01-20 11:09:33 +01:00
Bartosz Taudul
7cdf640a82
Merge pull request #312 from Honeybunch/master
Fixing CMake Install
2022-01-13 00:50:47 +01:00
Honeybunch
12b0631f28 Merge branch 'master' of https://github.com/wolfpld/tracy 2022-01-12 14:59:04 -08:00
Honeybunch
a7fbfba27d Fixing install 2022-01-12 14:57:41 -08:00
Bartosz Taudul
fd4f458e3d
Merge pull request #308 from JaldertVicarious/manual-wording-fix
[Minor] wording fix
2022-01-06 13:40:28 +01:00
Jaldert Rombouts
00e1cbcefe
[Minor] wording fix 2022-01-06 10:29:37 +00:00
Bartosz Taudul
4731bb9ec1
Cast GetProcAddress() ptr to const void*. 2022-01-05 20:03:20 +01:00
Bartosz Taudul
199b6ba798
Update copyright date in LICENSE. 2022-01-01 17:43:38 +01:00
Bartosz Taudul
8089040e64
CallTrace() is no longer present. 2022-01-01 17:35:01 +01:00
Bartosz Taudul
621c68352b
Call RtlWalkFrameChain directly from inlined function. 2022-01-01 17:33:39 +01:00
Bartosz Taudul
f5bfb47ec1
Fix line endings. 2022-01-01 17:02:05 +01:00
Bartosz Taudul
c6da04a18b
Use TooltipIfHovered() where appropriate. 2022-01-01 16:57:48 +01:00
Bartosz Taudul
d5f12744c4
Display unique node cost in trees. 2022-01-01 16:27:16 +01:00
Bartosz Taudul
6b9ccb3077
Tooltip shortcut function. 2022-01-01 16:10:49 +01:00
Bartosz Taudul
845cf43711
Update NEWS. 2021-12-31 15:10:07 +01:00
Bartosz Taudul
6257ec6b7f
Make the callstack parents trees scrollable. 2021-12-31 15:08:46 +01:00
Bartosz Taudul
4b167fa3df
Allow time display in callstack parents trees. 2021-12-31 15:06:26 +01:00
Bartosz Taudul
563daed10f
Add bottom/top tree to callstack parents. 2021-12-31 15:01:06 +01:00
Bartosz Taudul
5d439c0165
Round jump separation. 2021-12-30 16:35:18 +01:00
Bartosz Taudul
5a2a58f68f
Make capture output better suited for 80-char-wide terminals. 2021-12-30 16:21:25 +01:00
Bartosz Taudul
776d8336e7
Update manual. 2021-12-30 15:05:53 +01:00
Bartosz Taudul
adb168a5ea
Fix offset. 2021-12-30 03:19:03 +01:00
Bartosz Taudul
36068d1f2b
Condense hw samples. 2021-12-29 14:07:37 +01:00
Bartosz Taudul
0d5fbff07f
Adjust jump arrow separation to DPI scale. 2021-12-29 13:44:58 +01:00
Bartosz Taudul
ae9b9318e8
Fix calculation of jump arrows offset. 2021-12-29 13:41:55 +01:00
Bartosz Taudul
81de0a3a75
Display source location of symbol functions. 2021-12-24 03:19:13 +01:00
Bartosz Taudul
dc2ac4e4b3
Display child calls source locations. 2021-12-24 03:11:46 +01:00
Bartosz Taudul
acd8a32672
Fix referencing unknown symbol. 2021-12-24 02:36:28 +01:00
Bartosz Taudul
69c635f8bf
VK_TIME_DOMAIN_MAX_ENUM_EXT may be undefined. 2021-12-23 21:40:19 +01:00
Bartosz Taudul
c4c43ef7fe
Take rounding into consideration. 2021-12-23 16:02:07 +01:00
Bartosz Taudul
ac21169f35
Vertically condense fixed width font. 2021-12-23 14:17:28 +01:00
Bartosz Taudul
e822dde7e1
Merge thedmd/feature/font-line-spacing into ImGui. 2021-12-23 14:17:01 +01:00
Bartosz Taudul
b83cda575a
Add Rembrandt cpuid. 2021-12-23 13:34:24 +01:00
Bartosz Taudul
29d7115815
Add ADL cpuid. 2021-12-23 13:32:17 +01:00
Bartosz Taudul
12e0cb2036
Reorder uarch list. Push old ones to the bottom. 2021-12-23 13:28:06 +01:00
Bartosz Taudul
4642afdb9d
Add Alder Lake to uarch selection list. 2021-12-23 13:24:26 +01:00
Bartosz Taudul
828f1447be
Update NEWS. 2021-12-23 13:19:51 +01:00
Bartosz Taudul
1ecd28a31f
Add Alder Lake uops info. 2021-12-23 13:17:50 +01:00
Bartosz Taudul
e368266837
Add custom demangler interface. 2021-12-22 18:17:48 +01:00
Bartosz Taudul
6b59ccfe4d
GetFontSize() -> GetTextLineHeight(). 2021-12-22 17:57:57 +01:00
Bartosz Taudul
9fae8b7e42
Don't use obsolete functions. 2021-12-22 17:08:27 +01:00
Bartosz Taudul
8dc403506f
Bump ImGui to 1.86. 2021-12-22 17:00:41 +01:00
Bartosz Taudul
5d78e5ca1f
Update manual. 2021-12-22 16:42:57 +01:00
Bartosz Taudul
2f0d4a7707
Merge pull request #294 from Lectem/symbols_post_init
Call SymLoadModuleEx for modules loaded after init (Fixes #293)
2021-12-22 16:36:08 +01:00
Bartosz Taudul
29dc2fadf9
Do not bail-out on software sampling failure. 2021-12-21 22:09:40 +01:00
Bartosz Taudul
f1fa352a13
/sys/kernel/debug/tracing/... files are accessible on android. 2021-12-21 21:10:17 +01:00
Bartosz Taudul
efae847690
Replace getline(). 2021-12-21 20:28:18 +01:00
Bartosz Taudul
7f10265e34
Keep ring buffer size unsigned. 2021-12-21 20:24:52 +01:00
Bartosz Taudul
81ae7c06b8
Android libstdc++ is really stupid, it seems. 2021-12-21 19:56:32 +01:00
Bartosz Taudul
c4e08def0d
Update NEWS. 2021-12-21 16:24:09 +01:00
Bartosz Taudul
12b7efd88a
Update feature matrix. 2021-12-21 15:56:12 +01:00
Bartosz Taudul
5741bcfd32
Make ring buffer size adjustable.
If call stack capture is enabled for context switch data, the 64KB buffer is
too small to work without overruns. However, if the default buffer size is
increased, then the maximum locked memory limit is hit.

This change keeps the small buffer size for all the buffers that may be used
without escalated privileges. The context switch buffer is bigger, but it does
not need to obey the limits, as the application is running as root, if it is
to be used.
2021-12-21 15:48:40 +01:00
Bartosz Taudul
db64a5fa7e
Explicitly save context switch callstack samples. 2021-12-21 15:24:11 +01:00
Bartosz Taudul
67c2ffcb17
Look for context switch stacks on both ends of a switch. 2021-12-21 14:36:47 +01:00
Bartosz Taudul
c5654c333a
Process explicit context switch callstack samples. 2021-12-21 14:18:32 +01:00
Bartosz Taudul
3f1c540b3a
Further split ProcessCallstackSampleImpl(). 2021-12-21 14:18:14 +01:00
Bartosz Taudul
d88bf2c7a8
Separate message type for context switch callstack samples. 2021-12-21 14:05:07 +01:00
Bartosz Taudul
0ba2c0a86e
Collect context switch callstack on Linux. 2021-12-21 13:59:16 +01:00
Bartosz Taudul
0c041795b6
Move Linux calltrace processing to a separate function. 2021-12-21 13:58:43 +01:00
Bartosz Taudul
4a89a30556
Implement checking if any TID is within current process. 2021-12-21 13:52:52 +01:00
Bartosz Taudul
b8d7824a4f
Increase ring buffer size. 2021-12-21 13:27:08 +01:00
Bartosz Taudul
5768486ac0
Add support for compiling assembly files. 2021-12-21 12:22:43 +01:00
Bartosz Taudul
8c45ed33fd
Bump zstd to 1.5.1. 2021-12-21 12:22:42 +01:00
Bartosz Taudul
6fa3491bb7
Merge pull request #304 from Krzmbrzl/patch-4
Mention dependency on libtbb
2021-12-20 13:23:13 +01:00
Bartosz Taudul
b2e29a503b
Cosmetics. 2021-12-20 13:22:53 +01:00
Robert Adam
a46be65b05
Mention dependency on libtbb
Fixes #239
2021-12-20 12:00:27 +01:00
Bartosz Taudul
e0e1919fbf
Merge pull request #302 from Krzmbrzl/patch-3
CMakeLists: Fix typo
2021-12-19 03:10:27 +01:00
Robert Adam
96141cdef0
CMakeLists: Fix typo
Fixes #298
2021-12-18 20:14:06 +01:00
Bartosz Taudul
f207f2abd4
Merge pull request #300 from Krzmbrzl/patch-2
CMake: Mark include directories as SYSTEM
2021-12-17 17:58:52 +01:00
Robert Adam
43303323a0
CMake: Mark include directories as SYSTEM
This usually prevents the compiler from emitting warnings about stuff it found in
the included files.
Since the CMakeLists.txt seems to be exclusively meant for code that is making use
of Tracy rather than Tracy itself using it to build, silencing the warnings should probably
be what most folks would want.

This will prevent things like #126
2021-12-17 17:23:16 +01:00
Lectem
5d0466b729 Rename GetModuleName and call it before sym* use 2021-12-12 14:32:24 +01:00
Bartosz Taudul
a13b046698
User manual polish pass. 2021-12-11 21:00:31 +01:00
Bartosz Taudul
9b624049a5
Immediately disconnect connection on disconnect request.
The disconnect handling logic is broken on the client, after the symbol
resolution was moved to a separate thread. Use workaround until a proper fix
is available.
2021-12-11 13:15:50 +01:00
Lectem
17855cbac5 Call SymLoadModuleEx for modules loaded after init
This fixes issue #293. Symbols are not loaded if the module is loaded dynamically after the SymInitialize call.
This may stall the symbol resolver thread a bit the first time a module is loaded.
2021-12-08 21:30:06 +01:00
Bartosz Taudul
14392a6e0e
Merge pull request #290 from Honeybunch/master
Exporting cmake targets for install
2021-12-07 18:44:05 +01:00
Honeybunch
ef795ba49d Exporting cmake targets for install 2021-12-06 08:58:25 -08:00
Bartosz Taudul
14cdf3d43e
Use perf_event_open for context switch tracking. 2021-12-05 12:02:28 +01:00
Bartosz Taudul
0a3da9efdb
Optional CPU idx storage in RingBuffer. 2021-12-05 03:03:14 +01:00
Bartosz Taudul
d7dc2d6127
Extend process state descriptions, add P (parked). 2021-12-05 01:32:33 +01:00
Bartosz Taudul
6a0d233613
Proper mmap failure detection. 2021-12-05 01:32:33 +01:00
Bartosz Taudul
22284d57e7
Don't identify samples if there will be no context switches. 2021-12-05 01:32:30 +01:00
Bartosz Taudul
0c809b14d5
Merge pull request #289 from napoleon89/c-is-connected
Added IsConnected C API Equivalent
2021-12-04 18:47:21 +01:00
Bartosz Taudul
14825d8e5a
Proper formatting. 2021-12-04 18:27:26 +01:00
Nathan Day
3bf1e7ec1c Updated documentation 2021-12-04 17:26:17 +00:00
Nathan Day
bdafd0c7b6 Added IsConnected C API Equivalent 2021-12-04 16:55:41 +00:00
Bartosz Taudul
bbbae35925
Only identify samples when IdentifySamples is set. 2021-12-04 15:16:17 +01:00
Bartosz Taudul
20f8c8b8a4
Add IdentifySamples flag to the protocol.
On Windows there is no way to distinguish callstack data coming from random
sampling and from context switches. Each callstack timestamp has to be matched
against the context switch data in order to decide its origin. This is
obviously non-trivial.

On some other platforms, the origin information may be available right away,
in which case the process of matching against the context switch data, which
possibly includes postponing callstacks for processing in the future, may be
completely omitted.
2021-12-04 14:50:25 +01:00
Bartosz Taudul
2008c88983
Silence compiler warnings. 2021-12-04 13:41:55 +01:00
Bartosz Taudul
152d47f4d3
Update manual. 2021-12-02 02:34:21 +01:00
Bartosz Taudul
c98680ad0b
Add support for sample data without time. 2021-12-02 02:06:05 +01:00
Bartosz Taudul
74e2a63516
Don't require time to be available for samples. 2021-12-02 01:29:22 +01:00
Bartosz Taudul
051b1ba8f5
Display sampling disabled message on debug log channel. 2021-12-02 00:49:01 +01:00
Bartosz Taudul
6579399bfd
Update xxHash to 0.8.1. 2021-12-01 21:52:31 +01:00
Bartosz Taudul
1a0cf3ff46
Update robin_hood to 3.11.3. 2021-12-01 21:44:56 +01:00
Bartosz Taudul
ce7faf99c9
Show tooltip on disabled item. 2021-12-01 17:41:00 +01:00
Bartosz Taudul
b4987f5fc4
Update manual. 2021-11-29 19:40:52 +01:00
Bartosz Taudul
899b466ba4
There is more than one wait stack. 2021-11-29 19:34:43 +01:00
Bartosz Taudul
688dd470bc
Update NEWS. 2021-11-29 19:30:14 +01:00
Bartosz Taudul
5c379603b5
Move onlyActive check out of the loops. 2021-11-29 19:23:31 +01:00
Bartosz Taudul
04f045b22b
Replace "restrict time" with time range limits in memory. 2021-11-29 19:20:56 +01:00
Bartosz Taudul
de11604910
Add memory time range limit UI. 2021-11-29 18:17:19 +01:00
Bartosz Taudul
bad8df4878
Update feature matrix. 2021-11-28 13:44:41 +01:00
Bartosz Taudul
f3ee2235f6
Enable sample parents selection for self-less symbols. 2021-11-27 18:12:06 +01:00
Bartosz Taudul
05f9c74170
Don't include inlines when separate inlines are enabled. 2021-11-27 18:05:05 +01:00
Bartosz Taudul
582fcd5538
Fix sample parents for the whole symbol.
Previously when whole symbol was selected, it wasn't. All the inlines were
ignored and the data was displayed only for the base (self) symbol.
2021-11-27 17:55:18 +01:00
Bartosz Taudul
d8a611e952
Also calculate sample parents without inlines. 2021-11-27 17:47:09 +01:00
Bartosz Taudul
687d4defc0
Cosmetics. 2021-11-27 17:46:43 +01:00
Bartosz Taudul
52eeddd63a
Fix display of entry call stacks when inlines are present. 2021-11-27 16:41:27 +01:00
Bartosz Taudul
ed25c27228
Update manual. 2021-11-27 15:46:24 +01:00
Bartosz Taudul
a84fd26ecb
Change toggle button to faux drop down. 2021-11-27 15:40:23 +01:00
Bartosz Taudul
11a8f30ff9
Update NEWS. 2021-11-27 15:34:00 +01:00
Bartosz Taudul
355a179678
Merge callstack samples with the same timestamp. 2021-11-27 15:29:33 +01:00
Bartosz Taudul
4f735e1ae2
Extract callstack merging. 2021-11-27 15:06:58 +01:00
Bartosz Taudul
58d5fb2ff4
Fix calculation of child sample counts. 2021-11-27 14:49:22 +01:00
Bartosz Taudul
702c87dad0
Display list of child calls. 2021-11-27 14:43:31 +01:00
Bartosz Taudul
6a7b4e6066
Add calculation of child stats to source view. 2021-11-27 14:42:23 +01:00
Bartosz Taudul
85f755f3f5
Use proper base symbol address. 2021-11-27 14:30:46 +01:00
Bartosz Taudul
a02575322f
Collect child sample addresses. 2021-11-27 02:03:59 +01:00
Bartosz Taudul
2462e6cc7c
Update NEWS. 2021-11-27 00:07:59 +01:00
Bartosz Taudul
6fd53a662a
Update manual. 2021-11-27 00:07:54 +01:00
Bartosz Taudul
e3d16a162e
Merge pull request #288 from slembcke/master
Add fibers to TracyC.h
2021-11-27 00:01:24 +01:00
slembcke
bfe94b921e Renaming to match convention. 2021-11-26 17:00:22 -06:00
slembcke
87a727dd7f Add fibers to TracyC.h 2021-11-26 16:49:39 -06:00
Bartosz Taudul
d41447b0c9
Pass full module path to LoadLibraryEx(). 2021-11-25 23:27:20 +01:00
Bartosz Taudul
a27d1902ae
Store paths to kernel modules. 2021-11-25 23:27:05 +01:00
Bartosz Taudul
cd3be7c175
Update NEWS. 2021-11-25 23:14:09 +01:00
Bartosz Taudul
8428ede59d
Retrieve kernel symbols on Windows. 2021-11-25 23:12:41 +01:00
Bartosz Taudul
4bde9022e1
Properly acknowledge unavailable symbol code. 2021-11-25 22:44:56 +01:00
Bartosz Taudul
abdd6020ba
No need to remember addresses of symbol code queries. 2021-11-25 22:35:43 +01:00
Bartosz Taudul
b4da047355
Don't filter out kernel symbols from code transfer. 2021-11-25 22:28:05 +01:00
Bartosz Taudul
e8fb2abb2a
Dispatch kernel code retrieval. 2021-11-25 22:27:35 +01:00
Bartosz Taudul
47ea2a222d
Add new metadata message, not for wire transfer. 2021-11-25 22:24:17 +01:00
Bartosz Taudul
01db142144
Rpmalloc is initialized here. 2021-11-25 22:23:28 +01:00
Bartosz Taudul
1ed174c1b6
Expose GetModuleName() outside TracyCallstack.cpp. 2021-11-25 21:56:13 +01:00
Bartosz Taudul
2bd1e5bca7
Merge pull request #283 from expenses/c-gpu-zones
Implement a bare-bones C API for graphics profiling
2021-11-24 12:50:20 +01:00
Ashley Ruglys
2db109ab98
Add serial functions 2021-11-24 11:56:43 +01:00
Ashley Ruglys
2995db4b5e
Remove the 'active' argument 2021-11-24 11:45:37 +01:00
Bartosz Taudul
ac331d0343
Fix one frame lag of out-of-trace dimming. 2021-11-22 01:19:37 +01:00
Bartosz Taudul
6c08943e66
Don't perform any work in collapsed windows. 2021-11-22 01:15:22 +01:00
Bartosz Taudul
9b1b56de26
Increase big font size. 2021-11-21 23:57:31 +01:00
Bartosz Taudul
f63e4481b5
Update manual. 2021-11-20 17:09:21 +01:00
Bartosz Taudul
cad65ab52f
Handle magic dbghelp line numbers.
https://github.com/Microsoft/microsoft-pdb/issues/16
https://docs.microsoft.com/en-us/archive/blogs/jmstall/line-hidden-and-0xfeefee-sequence-points
2021-11-20 17:09:20 +01:00
Bartosz Taudul
bcdbd2f7d7
Add simple fiber example. 2021-11-20 17:09:20 +01:00
Bartosz Taudul
b3562c99fb
Display jump target/source function names. 2021-11-20 14:50:26 +01:00
Bartosz Taudul
7b2ed41179
Push small font to SourceView. 2021-11-20 14:47:13 +01:00
Bartosz Taudul
f0d524ad1f
Don't pass font to SourceView ctor. 2021-11-20 14:44:22 +01:00
Bartosz Taudul
3e78c826cf
Adapt minimum samples distance to DPI scaling. 2021-11-20 13:51:42 +01:00
Bartosz Taudul
8d65b190d6
Handle frame image dictionary creation failures. 2021-11-20 03:30:28 +01:00
Bartosz Taudul
b4dab753e6
List jump source locations. 2021-11-20 02:30:49 +01:00
Bartosz Taudul
fbe85ff8d3
Adapt hotness indicators to DPI scale. 2021-11-20 02:19:50 +01:00
Bartosz Taudul
0f215c7393
Keep text shadow offset constant.
ImGui aligns the text to be pixel perfect. Fractional offset of shadow made it
move not in sync with the text proper.
2021-11-20 01:55:47 +01:00
Bartosz Taudul
261721b8a3
Don't provide number of segments to generate in a circle. 2021-11-20 01:46:34 +01:00
Bartosz Taudul
dd6a973fbe
Adapt context switch line size to DPI scale. 2021-11-20 01:46:14 +01:00
Bartosz Taudul
a075323a80
Draw smaller "inline" index in callstacks. 2021-11-20 01:36:05 +01:00
Bartosz Taudul
b8766ad5d7
Apply DPI scale to text shadow. 2021-11-20 01:24:37 +01:00
Bartosz Taudul
be9cbfc3e2
Move GetScale() to TracyImGui.hpp. 2021-11-20 01:21:06 +01:00
Bartosz Taudul
9af87a8c20
Fonts should have integer size.
Otherwise rendering artifacts will be present.
2021-11-20 01:17:09 +01:00
Bartosz Taudul
cccce5534c
Replace Arimo with Droid Sans. 2021-11-20 01:14:46 +01:00
Bartosz Taudul
d0d0aca758
Use font helpers. 2021-11-19 21:09:13 +01:00
Bartosz Taudul
e0a6c51a2f
Add font set/unset helpers. 2021-11-19 21:06:07 +01:00
Bartosz Taudul
dd8083e0ee
Prevent out-of-bounds access.
This fixes the issue when assembly view is scrolled to the bottom of the
screen and display scale is reduced by the user. In such case clipper will
report DisplayStart to be at the end element, which would cause out-of-bounds
access to the m_asm array.

Clipper self-fixes this in the next frame, so this workaround is enough.
2021-11-19 20:58:09 +01:00
Bartosz Taudul
c23abca979
Round jump arrows offsets. 2021-11-19 20:56:09 +01:00
Bartosz Taudul
be7d688558
Update licenses. 2021-11-19 20:49:28 +01:00
Bartosz Taudul
10e680e601
Replace Cousine fixed-width font with Fira Code Retina. 2021-11-19 18:39:20 +01:00
Bartosz Taudul
fdadb9cb63
Update source view font. 2021-11-18 23:03:17 +01:00
Bartosz Taudul
04477a64b7
Update font pointers held in main.cpp. 2021-11-18 22:55:27 +01:00
Bartosz Taudul
f9904c1f5d
Update NEWS. 2021-11-18 22:49:03 +01:00
Bartosz Taudul
f3ea9e1314
Add run-time UI scaling menu. 2021-11-18 22:48:32 +01:00
Bartosz Taudul
cfec8257cb
Don't change ImGui fonts during render job. 2021-11-18 22:48:14 +01:00
Bartosz Taudul
2243b6e293
Reset style. 2021-11-18 22:47:58 +01:00
Bartosz Taudul
40b9fe7dae
Reload font atlas. 2021-11-18 22:47:46 +01:00
Bartosz Taudul
902de497dc
Allow forceful insertion into main thread queue.
This is useful to run some tasks outside of the main render job.
2021-11-18 22:46:59 +01:00
Bartosz Taudul
89ca010146
Add scale setup callback infrastructure. 2021-11-18 22:22:11 +01:00
Bartosz Taudul
5a9344716d
Extract fonts and style setup to separate functions. 2021-11-18 22:14:31 +01:00
Bartosz Taudul
18a35dd0c3
Document TRACY_CRASH_SIGNAL macro. 2021-11-18 21:49:25 +01:00
Bartosz Taudul
c5e41b34b7
Update NEWS. 2021-11-18 20:45:45 +01:00
Bartosz Taudul
01a0363c29
Adapt item width to DPI scale. 2021-11-18 20:33:44 +01:00
Bartosz Taudul
bbbd78883c
Allow crash signal selection by user. 2021-11-18 20:20:10 +01:00
Bartosz Taudul
0b869bcb13
Adapt network graph to DPI scale. 2021-11-18 20:12:41 +01:00
Bartosz Taudul
1dff4329e4
Adapt window sizes to DPI scaling. 2021-11-18 19:20:45 +01:00
Bartosz Taudul
4d397aeb67
Add helper for getting DPI scaling. 2021-11-18 19:04:21 +01:00
Bartosz Taudul
09de127ca2
Adapt release notes window size to DPI scaling. 2021-11-18 18:57:43 +01:00
Ashley Ruglys
bf1896f6ba
memset the thread to 0 when writing the GpuZoneEnd as this seems to prevent an assert failure 2021-11-17 18:14:57 +01:00
Ashley Ruglys
cc45865239
Small formatting changes 2021-11-17 11:31:02 +01:00
Ashley Ruglys
91b4058dc4
Implement bare-bones functionality for gpu contexts in the C api 2021-11-17 11:27:52 +01:00
Bartosz Taudul
1002e949d6
Enable playback frame change with mouse wheel. 2021-11-15 02:34:13 +01:00
Bartosz Taudul
176bc279f1
Don't copy short_ptr. 2021-11-15 02:18:19 +01:00
Bartosz Taudul
641338cb3c
Remove postponed samples when they are handled. 2021-11-14 23:55:44 +01:00
Bartosz Taudul
bb30333947
Implement erase() in SortedVector.
Requires vector to be sorted, in order to not bother with recalculating
sortedEnd value.
2021-11-14 23:54:39 +01:00
Bartosz Taudul
710a488af0
Handle postponed samples with SortedVector. 2021-11-14 23:48:50 +01:00
Bartosz Taudul
590a4afb89
Full dequeue is needed to handle symbol queries. 2021-11-14 19:24:05 +01:00
Bartosz Taudul
1575455a54
Update licenses. 2021-11-14 19:08:06 +01:00
Bartosz Taudul
a5f5dcc00f
Remove capacity safeties. 2021-11-14 18:52:57 +01:00
Bartosz Taudul
5306034893
Remove unused methods. 2021-11-14 18:52:27 +01:00
Bartosz Taudul
9055a31156
Decrease number of SPSCQueue items to 8K.
This matches the query limit set on the server.
2021-11-14 18:51:11 +01:00
Bartosz Taudul
a203eb5aef
Adapt to SPSCQueue interface. 2021-11-14 18:50:59 +01:00
Bartosz Taudul
93f83fc50c
Remove allocator silliness. 2021-11-14 18:42:07 +01:00
Bartosz Taudul
fe04cf0b35
Move SPSCQueue to tracy namespace. 2021-11-14 18:31:58 +01:00
Bartosz Taudul
20e3ec92b9
Replace readerwriterqueue with SPSCQueue. 2021-11-14 18:27:25 +01:00
Bartosz Taudul
f2380590f9
Limit server query space to 8K entries.
In the default configuration this limit is unlikely to be hit. On Windows the
send buffer is 64 KB, which results in ~5K entries. On Linux the buffer is a
bit higher and the number of entries is lower than 7K.
2021-11-14 18:14:52 +01:00
Bartosz Taudul
0e05d70691
Remove obsolete check. 2021-11-14 17:09:37 +01:00
Bartosz Taudul
ffa8bf4d75
Use table instead of map to track reentrant calls. 2021-11-14 16:42:11 +01:00
Bartosz Taudul
cb004e9cc0
Sort source location zones only when needed. 2021-11-14 16:05:55 +01:00
Bartosz Taudul
befeffb61e
Add ensure_sorted() method for SortedVector. 2021-11-14 15:57:20 +01:00
Bartosz Taudul
404168ec69
Check whether symbols are ready, not source locations. 2021-11-14 15:51:29 +01:00
Bartosz Taudul
e0872ce61b
Cosmetics. 2021-11-14 15:51:27 +01:00
Bartosz Taudul
864d7e4e47
Sort symbols list only when actually needed. 2021-11-14 13:05:05 +01:00
Bartosz Taudul
b978a7c652
Sort plot data only when needed (i.e. to draw). 2021-11-14 13:01:27 +01:00
Bartosz Taudul
68d2812e82
Retarget ToyPathTracer to MSVC 2022. 2021-11-14 12:22:52 +01:00
Bartosz Taudul
50e532ebc0
Display unknown locations dimmed in callstack trees. 2021-11-14 02:27:43 +01:00
Bartosz Taudul
19f87502d3
Keep wait stacks header on top. 2021-11-14 02:17:02 +01:00
Bartosz Taudul
2040ef945f
Color kernel frames in callstack trees. 2021-11-14 02:06:22 +01:00
Bartosz Taudul
0666dc0813
Update NEWS. 2021-11-13 23:08:03 +01:00
Bartosz Taudul
014f084393
UI cosmetics. 2021-11-13 22:27:54 +01:00
Bartosz Taudul
41c5d93a11
Use big icons in the rest of dialogs. 2021-11-13 22:23:18 +01:00
Bartosz Taudul
be264896f0
Use big icons in bad version dialogs. 2021-11-13 22:20:00 +01:00
Bartosz Taudul
46e0584cca
Use big icons in load/cleanup dialogs. 2021-11-13 22:16:37 +01:00
Bartosz Taudul
d4a5df0244
Use big icon in waiting for connection dialog. 2021-11-13 22:14:47 +01:00
Bartosz Taudul
6d3113f2df
Add icons to big font. 2021-11-13 22:12:54 +01:00
Bartosz Taudul
1d7ab70199
Non-memory tree callstacks are not needed. 2021-11-13 22:09:16 +01:00
Bartosz Taudul
b4726833e9
Cosmetics. 2021-11-13 22:09:10 +01:00
Bartosz Taudul
633cd1262c
Draw callstack tree for wait stacks. 2021-11-13 22:06:04 +01:00
Bartosz Taudul
5f9a0ab61f
Wait stacks mode selection. 2021-11-13 22:06:04 +01:00
Bartosz Taudul
4f6e9bbb65
Generic callstack tree builder.
Previously this was exclusive for memory callstacks.
2021-11-13 22:06:04 +01:00
Bartosz Taudul
c6be16dcd2
Rename PathData -> MemPathData. 2021-11-13 21:28:56 +01:00
Bartosz Taudul
a2547ccf1d
Rename CallstackFrameTree -> MemCallstackFrameTree. 2021-11-13 21:26:28 +01:00
Bartosz Taudul
c2e9b602be
Remind user where the build files are located. 2021-11-13 20:52:54 +01:00
Bartosz Taudul
98edee9b07
Change memory call stack tree icons. 2021-11-13 20:42:52 +01:00
Bartosz Taudul
667112c71f
Some old traces might have invalid image names. 2021-11-13 20:34:54 +01:00
Bartosz Taudul
0c7c3ae641
Time range limits for wait stacks. 2021-11-13 18:43:55 +01:00
Bartosz Taudul
94d4272c9c
Allow limiting wait stacks to certain threads. 2021-11-13 18:20:06 +01:00
Bartosz Taudul
265a39e7c9
Don't select out-of-context asm lines. 2021-11-13 17:35:02 +01:00
Bartosz Taudul
50627646c1
Don't highlight asm lines out of context on hover. 2021-11-13 16:36:46 +01:00
Bartosz Taudul
25316ddada
Display notification icon when context is limited. 2021-11-13 16:34:51 +01:00
Bartosz Taudul
cc425c4a2d
Separate function for checking asm function context. 2021-11-13 16:34:50 +01:00
Bartosz Taudul
9ba5180b04
Add wait stacks window. 2021-11-13 15:58:25 +01:00
Bartosz Taudul
45df37e3a9
Separate callstack table drawing functionality. 2021-11-13 15:56:57 +01:00
Bartosz Taudul
c1f6d6c9ce
Cosmetics. 2021-11-13 15:39:37 +01:00
Bartosz Taudul
14b469f219
Direct selection of find zone callstack. 2021-11-13 15:31:48 +01:00
Bartosz Taudul
151eadc69e
Direct selection of sample entry call stack index. 2021-11-13 15:15:49 +01:00
Bartosz Taudul
601f0a17df
Remove "Go to frame" button. 2021-11-13 15:13:35 +01:00
Bartosz Taudul
81c66ad126
Fix samples order on save, not load.
Sorting samples during load was a major mistake, as three different background
processing threads were concurrently accessing the samples table, and it was
being sorted in one of them!
2021-11-13 03:25:47 +01:00
Bartosz Taudul
0ab73e2aa7
Detect context switch samples during reconstruction. 2021-11-13 03:15:20 +01:00
Bartosz Taudul
484ed84252
Display context switch samples count. 2021-11-13 02:52:08 +01:00
Bartosz Taudul
d8d6423266
Context switch samples counting. 2021-11-13 02:47:39 +01:00
Bartosz Taudul
8ef212c26e
Determine if postponed callstacks are for context switches.
Samples are processed only when new context switch data has been received.
2021-11-13 02:44:54 +01:00
Bartosz Taudul
745b795d50
Detect context switch callstack samples.
Context switch callstack samples are not included in the sampling data
statistics (as these don't represent random sampling), but are rather put into
a separate dedicated data structure.

For this to work, a complete context switch data has to be available for the
callstack timestamp. There is no guarantee it will be present at the time it
is needed, so a second structure is added to allow postponing qualification of
callstacks.
2021-11-13 02:40:32 +01:00
Bartosz Taudul
5b799e0e45
Monitor when new context switch data is received. 2021-11-13 02:38:33 +01:00
Bartosz Taudul
00834ed32b
No need to pass time and callstack. 2021-11-13 02:26:11 +01:00
Bartosz Taudul
06c1bb4e59
Open callstack windows when clicking on context switch. 2021-11-13 01:34:49 +01:00
Bartosz Taudul
4b74777fcf
Display image name in callstack tooltips. 2021-11-13 01:31:28 +01:00
Bartosz Taudul
1200409a44
Display context switch wait call stack. 2021-11-13 01:21:47 +01:00
Bartosz Taudul
ce8e42f00b
Separate drawing callstack tooltip from drawing its contents. 2021-11-13 01:08:36 +01:00
Bartosz Taudul
aed1360a9c
Update to MSVC 2022. 2021-11-13 00:49:26 +01:00
Bartosz Taudul
97c519811c
Capture context switch call stacks on Windows. 2021-11-12 12:22:29 +01:00
Bartosz Taudul
987f70a9d4
Signal initialization failure through exit code. 2021-11-11 12:43:59 +01:00
Bartosz Taudul
f925da5e01
Handle fiber enter -> enter case (without leave in between). 2021-11-06 21:14:37 +01:00
Bartosz Taudul
d33de972f0
Properly show fiber context switch data. 2021-11-06 21:06:08 +01:00
Bartosz Taudul
40cd5435df
Fix context switch reconstruction condition. 2021-11-06 20:49:15 +01:00
Bartosz Taudul
69e5cf796d
Construct faux context switch data from fiber events. 2021-11-06 20:38:16 +01:00
Bartosz Taudul
efeed326bf
Context switch data may exists without CPU data. 2021-11-06 20:22:08 +01:00
Bartosz Taudul
904a444ea5
Label fiber threads across the UI. 2021-11-06 19:27:36 +01:00
Bartosz Taudul
0075050679
Allow checking if thread is a fiber. 2021-11-06 19:02:02 +01:00
Bartosz Taudul
3ede2a1345
Explicit tracking of fiber state in ThreadData.
This replaces the use of hard-to-track global state with well-defined accessor
functionality.
2021-11-06 18:55:29 +01:00
Bartosz Taudul
765561de81
Serialize continuous frame events. 2021-11-05 01:13:24 +01:00
Bartosz Taudul
0427904d4a
Fix zone validation thread piggybacking. 2021-11-04 22:50:55 +01:00
Bartosz Taudul
373a6fc19e
Add event debug routine. 2021-11-04 22:30:16 +01:00
Bartosz Taudul
4c774130ee
Allow direct switching from one fiber to another. 2021-11-04 17:51:32 +01:00
Bartosz Taudul
5782d8a53b
Merge pull request #277 from napoleon89/callstack_undefined_parameters
Added unused parameters when TRACY_HAS_CALLSTACK is undefined
2021-11-04 17:01:28 +01:00
Nathan Day
4fece233d9 Added unused parameters when TRACY_HAS_CALLSTACK is undefined 2021-11-04 15:24:58 +00:00
Bartosz Taudul
b3dd3612f4
Merge pull request #276 from alexanderbock/patch-1
Removing explicit compiler define check for GL_TIMESTAMP
2021-11-04 11:34:31 +01:00
Alexander Bock
f7fb2af5c2
Update TracyOpenGL.hpp
Removing explicit GL_TIMESTAMP check
2021-11-04 10:46:13 +01:00
Bartosz Taudul
887826a28a
Remove dead code. 2021-11-03 18:58:53 +01:00
Bartosz Taudul
fceb065329
Fiber name transport. 2021-11-03 18:57:30 +01:00
Bartosz Taudul
211b202d8e
Process fiber entry and leave events. 2021-11-02 01:53:10 +01:00
Bartosz Taudul
b4e4c05088
Thread context data may be invalidated due to fibers. 2021-11-02 01:52:41 +01:00
Bartosz Taudul
d522af99b9
Threads may be mapped to fibers. 2021-11-02 01:51:54 +01:00
Bartosz Taudul
0718330016
Add fiber labels to places with thread information. 2021-11-02 01:48:28 +01:00
Bartosz Taudul
e5c44afdcb
Distinguish fiber threads with green color. 2021-11-02 01:48:07 +01:00
Bartosz Taudul
bb72bf10e9
Add fiber failures. 2021-11-02 01:47:31 +01:00
Bartosz Taudul
93b6d88c4c
Save/load fiber thread flag. 2021-11-02 01:46:29 +01:00
Bartosz Taudul
8f44f1c68b
Store fiber state is ThreadData. 2021-11-02 01:45:01 +01:00
Bartosz Taudul
229d547e91
Add fiber support on client side. 2021-11-02 00:11:09 +01:00
Bartosz Taudul
8b15cd049c
Skip comparing known to be matching memory. 2021-10-30 01:26:31 +02:00
Bartosz Taudul
1ecdb8aa2a
Report device name on Android. 2021-10-26 18:09:56 +02:00
Bartosz Taudul
1cbd6950cf
Update NEWS. 2021-10-23 02:06:56 +02:00
Bartosz Taudul
bd108220cb
Drain symbols queue if on-demand and not connected. 2021-10-23 01:54:38 +02:00
Bartosz Taudul
3d13ec7018
Pump symbols queue during profiler termination. 2021-10-23 01:47:04 +02:00
Bartosz Taudul
fe9c63b8d2
Signal symbol resolution thread destruction. 2021-10-23 01:46:00 +02:00
Bartosz Taudul
02ce9b7d8b
Extract symbol queue item handling. 2021-10-23 01:35:01 +02:00
Bartosz Taudul
2b9265cc40
Move symbol resolution to a separate thread. 2021-10-22 22:25:09 +02:00
Bartosz Taudul
b4cfb1f2d5
Add SPSC symbol queue. 2021-10-22 22:22:27 +02:00
Bartosz Taudul
f2b0aadedc
Return external names, instead of sending them.
Note that the old function is still used by code, so this commit won't
compile.
2021-10-22 22:20:30 +02:00
Bartosz Taudul
e2610b1483
Add space for piggy-backing symbol data transfer. 2021-10-22 22:17:09 +02:00
Bartosz Taudul
af5da6f53c
Move inline string copy helpers to a separate header. 2021-10-22 21:53:46 +02:00
Bartosz Taudul
75f77a068f
Use rpmalloc in readerwriterqueue. 2021-10-22 20:39:10 +02:00
Bartosz Taudul
60b36df077
Cosmetics. 2021-10-21 01:49:20 +02:00
Bartosz Taudul
6c53c36bfe
Remove server query quota. 2021-10-21 01:48:52 +02:00
Bartosz Taudul
93b6fd72c3
Keep lock until we're done with the data. 2021-10-21 01:31:03 +02:00
Bartosz Taudul
4348c5428d
Returned strings may be invalidated, so copy them. 2021-10-21 01:30:17 +02:00
Bartosz Taudul
ff54317a87
Move EnsureReadable() and co. to top of source file. 2021-10-21 00:06:14 +02:00
Bartosz Taudul
6d490ffd28
Revert "Use SPSC queue for frame images."
This reverts commit 02e76faff7a17a907457078997c42c1b0d6b0f0f.

Let's not limit frame image reporting to just one thread.
2021-10-20 23:18:03 +02:00
Bartosz Taudul
ebb64540bb
Update licenses list. 2021-10-20 22:59:54 +02:00
Bartosz Taudul
ce2a7d6741
Offset field is not used. 2021-10-20 22:57:23 +02:00
Bartosz Taudul
02e76faff7
Use SPSC queue for frame images. 2021-10-20 22:57:23 +02:00
Bartosz Taudul
ff3382391e
Remove BlockingReaderWriterQueue and semephores. 2021-10-20 22:57:22 +02:00
Bartosz Taudul
3d21c4e7ea
Add amalgamated readerwriterqueue 1.0.5. 2021-10-20 22:45:30 +02:00
Bartosz Taudul
8a9c450e87
Merge pull request #273 from Mulej/master
Fix TracyCAppInfo macro argument name
2021-10-18 23:04:35 +02:00
Matej Mulej
036a61f9a4
Fix TracyCAppInfo macro argument name 2021-10-18 20:40:09 +00:00
Bartosz Taudul
250f7ecdb6
Update NEWS. 2021-10-17 13:15:22 +02:00
Bartosz Taudul
8f6a911f1e
Save/load sum of values in plots. 2021-10-17 13:14:44 +02:00
Bartosz Taudul
0b190b1a69
Calculate sum of values in reconstructed memory plot. 2021-10-17 13:14:23 +02:00
Bartosz Taudul
04db76d5fd
Calculate plot values sum during data import. 2021-10-17 13:07:37 +02:00
Bartosz Taudul
facd2be33b
Display average plot value. 2021-10-17 13:05:10 +02:00
Bartosz Taudul
0bd1364c2f
Calculate plot values sum. 2021-10-17 13:04:56 +02:00
Bartosz Taudul
a1511a39bd
Delta-encode code information pointers. 2021-10-16 16:29:06 +02:00
Bartosz Taudul
b099df75c2
Update NEWS. 2021-10-16 16:16:05 +02:00
Bartosz Taudul
dfb1ce64df
Sample data inconsistency warning. 2021-10-16 16:15:19 +02:00
Bartosz Taudul
2493cad5ad
Bump ImGui do 1.85 + docking. 2021-10-12 20:23:38 +02:00
Bartosz Taudul
bcaac7b53f
Add ~2 second overflow grace period.
This fixes issues when the GPU is actually permitted to report out-of-order
timestamps (e.g. when tasks are scheduled by the GPU, instead of being forced
to execute in submission order).
2021-10-11 00:29:24 +02:00
Bartosz Taudul
733d267768
Disable OpenGL callstacks when fibers are enabled.
This has little impact, but saves much of the hassle.
2021-10-10 16:39:22 +02:00
Bartosz Taudul
5ccf369919
Implement callstack serialization. 2021-10-10 16:14:17 +02:00
Bartosz Taudul
a421083e58
Crash reports may be serialized. 2021-10-10 15:58:24 +02:00
Bartosz Taudul
9d89b84efd
Support serialized queue for Lua messages. 2021-10-10 15:55:22 +02:00
Bartosz Taudul
082255f940
Messages may now use serialized queue. 2021-10-10 15:54:21 +02:00
Bartosz Taudul
f8d37b45a3
Update NEWS. 2021-10-10 14:59:14 +02:00
Bartosz Taudul
13b28714ee
Display failure context in capture utility. 2021-10-10 14:52:30 +02:00
Bartosz Taudul
20074e64f4
Fix processing of serialized zone color, value and validation. 2021-10-10 14:43:36 +02:00
Bartosz Taudul
d3905bd4bb
Add context to zone text failures. 2021-10-10 14:14:33 +02:00
Bartosz Taudul
930ef77ea9
Add zone value failure context. 2021-10-10 14:12:13 +02:00
Bartosz Taudul
9300934fa5
Separate zone value and text failures. 2021-10-10 14:05:21 +02:00
Bartosz Taudul
909f5916b1
Use possibly-synchronous macros for C API zones. 2021-10-09 15:51:29 +02:00
Bartosz Taudul
2cea5bc5b2
Add C API async-or-sync queue macros. 2021-10-09 15:50:30 +02:00
Bartosz Taudul
5835011d0f
Allow serialized zone validation. 2021-10-09 15:50:09 +02:00
Bartosz Taudul
7c046eb7ac
Use possibly-synchronous macros for Lua zones. 2021-10-09 15:41:27 +02:00
Bartosz Taudul
fcda1f6a7f
Keep Lua zone insertion time to a minimum.
No functional changes here. Only the variable retrieval was separated from
filling in the queue items. While with the async queue this makes no
difference, it will be important when the serial queue is used here.
2021-10-09 15:35:11 +02:00
Bartosz Taudul
7527f33d6c
Handle serialized zones. 2021-10-09 15:31:45 +02:00
Bartosz Taudul
2eeade89ba
Add macro for handling serial dequeue thread context checks. 2021-10-09 15:30:58 +02:00
Bartosz Taudul
2d5d4293a9
Move thread context check to a separate function. 2021-10-09 15:16:36 +02:00
Bartosz Taudul
13acec38f7
Use the possibly-synchronous macros in C++ zones. 2021-10-09 14:58:33 +02:00
Bartosz Taudul
6411b35d68
Provide macros for async-or-sync queue insertion.
If fibers are enabled, then some events which were traditionally stored in
async queues will have to be serialized. These macros provide the needed
infrastructure for this.
2021-10-09 14:55:32 +02:00
Bartosz Taudul
250ef2cf6e
Change thread id size from 64 to 32 bits.
Both Windows and Linux use 32-bit thread identifiers. MacOS has a 64-bit
counter, but in practice it will never overflow during profiling and no false
aliasing will happen.

These changes are only done client-side and in the network protocol. The
server still uses 64-bit thread identifiers, to enable virtual threads, etc.
2021-10-08 00:42:52 +02:00
Bartosz Taudul
07bc665d8c
Drop support for Cygwin. 2021-10-07 23:28:40 +02:00
Bartosz Taudul
12f693372a
Cosmetics. 2021-10-07 23:28:31 +02:00
Bartosz Taudul
b7a27d02af
Fix total time in find zone, if limit range is enabled. 2021-09-28 01:11:22 +02:00
Bartosz Taudul
9cb54982cb
Fix crash. 2021-09-27 18:13:45 +02:00
Bartosz Taudul
8eb038280f
Update manual. 2021-09-27 02:19:20 +02:00
Bartosz Taudul
c2e94355f0
Add icon to samples label. 2021-09-27 02:07:02 +02:00
Bartosz Taudul
99f2d0e059
Fix vertical spacing in inline symbols list. 2021-09-27 01:54:37 +02:00
Bartosz Taudul
28ae970887
Remove trailing whitespace. 2021-09-27 01:54:15 +02:00
Bartosz Taudul
d5db075286
Update AUTHORS. 2021-09-23 22:14:52 +02:00
Bartosz Taudul
458fdaa126
Update NEWS. 2021-09-23 22:14:11 +02:00
Bartosz Taudul
b6eee83463
Merge pull request #257 from xxxbxxx/filter-by-srcloc
Filter samples by zones source locations
2021-09-23 22:12:42 +02:00
xavier
f37ef1affd Display the samples after the groups in the "find zone" window
to make it clear they are filtered by selected group.
2021-09-23 21:03:56 +02:00
xavier
61670e30aa Update samples statistics continuously in the "find zone" window 2021-09-23 21:03:56 +02:00
xavier
63acfe72e7 Apply group filters to the samples statistics in the "find zone" window
reduce memory by storing the thread ids next to the zones intead of
making zone lists per thread.

speed-up by reading the zones in linear order rather than bisecting
the whole list for each sample.
2021-09-23 21:03:56 +02:00
xavier
41130d2a69 Avoid useless work when there aren't any samples 2021-09-23 21:03:56 +02:00
xavier
1233b39b69 Move samples before groups in "find zone" window
and fix style
2021-09-23 21:03:56 +02:00
xavier
0089c832f7 Cache samples statistics in the "find zone" window 2021-09-23 21:03:56 +02:00
xavier
ed42c2388c Add samples statistics to the "find zone" window 2021-09-23 21:03:56 +02:00
xavier
e4ce9f0f41 Include threadid in SampleDataRange
TODO: maybe make lists per thread to avoid increasing the packed structure by 2 bytes?
2021-09-23 21:03:56 +02:00
xavier
6b901a7156 Extract DrawSamplesStatistics() 2021-09-23 21:03:56 +02:00
Bartosz Taudul
4c220bdc14
Always display statistics mode selection.
Even if only one option is available.
2021-09-23 18:32:59 +02:00
Bartosz Taudul
f74818ece5
Make accumulation combo consistent. 2021-09-23 18:28:19 +02:00
Bartosz Taudul
9e67491766
Update NEWS. 2021-09-23 18:17:55 +02:00
Bartosz Taudul
bcfc4a4fa7
Fix message thread assignment in import-chrome. 2021-09-23 18:08:03 +02:00
Bartosz Taudul
74d0e79b8c
Vcpkg changed everything again. 2021-09-21 02:09:54 +02:00
Bartosz Taudul
2a994f1c81
Backport freetype 2.11 fix from imgui. 2021-09-20 22:45:52 +02:00
Bartosz Taudul
0b03d7b2ad
Merge pull request #265 from nagisa/nagisa/manual-lifetime-for-c
Expose TRACY_MANUAL_LIFETIME APIs to C API clients
2021-09-18 15:20:42 +02:00
Simonas Kazlauskas
173a165a57 Add startup/shutdown_profiler to the manual
Also remove the documentation for the now-gone `___tracy_init_thread`
function.
2021-09-18 14:54:00 +03:00
Simonas Kazlauskas
54ee3d8a94 Expose TRACY_MANUAL_LIFETIME APIs to C API clients
These are extremely useful for ecosystems such as Rust. There are a
couple of reasons why:

1. Rust strongly advises against relying on life before/after main, as
   it is difficult to reason about. Most users working in Rust will
   generally be quite surprised when encountering this concept.
2. Rust and its package manager makes it easy to use packages (crates)
   and somewhat less straightforward to consider the implications of
   including a dependency.

   In case of the `rust_tracy_client` set of packages, I currently have
   to warn throughout the documentation of the package that simply
   adding a dependency on the bindings package is sufficient to
   potentially accidentally broadcast a lot of information about the
   instrumented binary to the broader world. This seems like a major
   footgun given how easy is it to forget about having added this
   dependency.

Ability to manually manage the lifetime of the profiler would be a great
solution to these problems.
2021-09-18 14:54:00 +03:00
Bartosz Taudul
e929946120
Merge pull request #264 from michal-z/master
Undo my previous change regarding zig cc.
2021-09-17 11:37:24 +02:00
Michal Ziulek
789328f73d
Undo my previous change.
-D_WIN32_WINNT=0x601 must be defined when building TracyClient.cpp for mingw-w64 on Windows. In that case definitions I've added are not needed.
2021-09-17 11:34:40 +02:00
Bartosz Taudul
058e89011f
Merge pull request #261 from michal-z/master
Fixed TracyClient.cpp compile error when using zig cc (#260).
2021-09-14 19:53:28 +02:00
Michal Ziulek
ad97854f12
Fixed compile error when using zig cc. 2021-09-14 19:30:20 +02:00
Bartosz Taudul
d011d65b3c
Merge pull request #255 from graydon/tracy-capture-seconds-argument
Add `-s <seconds>` parameter to capture.cpp
2021-08-26 11:14:23 +02:00
Graydon Hoare
26fd867e52
Add -s <seconds> parameter to capture.cpp 2021-08-25 22:52:23 -07:00
Bartosz Taudul
dfb4020a92
Add missing include for intptr_t. 2021-08-22 13:38:28 +02:00
Bartosz Taudul
673dfd0f02
Update ImGui GLFW and OpenGL 3.x backends.
The new embedded ImGui OpenGL loader has been extended with a couple of
functions and definitions needed by TracyTexture.cpp.
2021-08-22 13:30:46 +02:00
Bartosz Taudul
30445b656f
Update ImGui to 1.84.1 + docking. 2021-08-21 00:52:30 +02:00
Bartosz Taudul
c82bf3915b
Extend thread expansion grace period to half a second.
Previously a framerate-dependent 10 frame count was used.
2021-08-19 00:24:11 +02:00
Bartosz Taudul
38f156259c
Update NEWS. 2021-08-19 00:01:52 +02:00
Bartosz Taudul
fd84b2e026
Vulkan headers must be now manually included. 2021-08-19 00:00:20 +02:00
Bartosz Taudul
e380e3f80e
Merge pull request #249 from lukasberbuer/readme-links
Bundle links in README including latest documentation
2021-08-02 00:40:39 +02:00
Lukas Berbuer
6c3c94b5f4 Bundle links in README including latest documentation 2021-08-01 23:48:45 +02:00
Bartosz Taudul
acccad2772
Merge pull request #248 from lukasberbuer/cmake-options-simplify
Simplify CMake option definition
2021-08-01 13:25:12 +02:00
Lukas Berbuer
a7bbd51c61 Simplify CMake option definition 2021-08-01 13:14:32 +02:00
Bartosz Taudul
7a5270e6f1
Update NEWS. 2021-08-01 13:07:50 +02:00
Bartosz Taudul
36752c67bd
Update AUTHORS. 2021-08-01 13:07:23 +02:00
Bartosz Taudul
7130e27865
Merge pull request #247 from lukasberbuer/cmake-options
Full CMake integration
2021-08-01 13:05:16 +02:00
Lukas Berbuer
958386709f Add documentation for CMake integration 2021-08-01 12:54:31 +02:00
Lukas Berbuer
0fe755fc85 Add options to CMakeLists.txt
Major parts taken from https://github.com/Manu343726/tracy/blob/master/CMakeLists.txt
2021-08-01 12:26:42 +02:00
Bartosz Taudul
0c2b27382e
Update manual. 2021-07-26 01:40:06 +02:00
Bartosz Taudul
b7dbbee149
Update NEWS. 2021-07-26 01:25:49 +02:00
Bartosz Taudul
7304558bdf
Cycle through assembly blocks when right-clicking source line. 2021-07-26 01:21:58 +02:00
Bartosz Taudul
55a966f9c6
Fix assert. 2021-07-26 01:18:17 +02:00
Bartosz Taudul
c222327edb
Silence siunitx errors. 2021-07-25 12:57:52 +02:00
Bartosz Taudul
6f855ebcd4
Update libbacktrace to d0f5e95. 2021-07-25 12:34:11 +02:00
Bartosz Taudul
d2b3182ab6
Update stb_image to 2.27. 2021-07-25 12:05:07 +02:00
Bartosz Taudul
924224501e
Remove exception handler during profiler destruction. 2021-07-25 11:48:27 +02:00
Bartosz Taudul
61c9e8e6d8
Crash handler may be not installed. 2021-07-25 11:46:20 +02:00
Bartosz Taudul
54fa21bcbb
Restore original signal handlers on profiler exit. 2021-07-25 11:40:22 +02:00
JIA-ss
5936e7c86c
Multi Dll Proj will Crash, Under Unity (#244) 2021-07-25 11:28:42 +02:00
Bartosz Taudul
06ae39d9cc
Fix debug build. 2021-07-18 16:34:24 +02:00
Bartosz Taudul
8ea89ad58a
Update manual. 2021-07-18 16:15:32 +02:00
Bartosz Taudul
be3118faab
Update NEWS. 2021-07-18 16:15:32 +02:00
Bartosz Taudul
8b489c95ff
Rename slow branches/cache to branch/cache impact. 2021-07-18 16:15:32 +02:00
Bartosz Taudul
0e603a0997
Render relative hw samples values. 2021-07-18 16:15:32 +02:00
Bartosz Taudul
d0fad4fd39
Rename relative hw samples to "impact". 2021-07-18 16:15:31 +02:00
Bartosz Taudul
83b159b43b
Count hw stats, if relative mode is set. 2021-07-18 15:00:22 +02:00
Bartosz Taudul
fbf2c87a20
Include hw stats in AddrStatData. 2021-07-18 15:00:22 +02:00
Bartosz Taudul
e30608afbf
Store and pass AddrStat data in one data structure. 2021-07-18 15:00:22 +02:00
Bartosz Taudul
9c7a122d94
Implement counting relative hw samples data.
This exploits the fact that AddrStat has two data fields (local and ext) to
store branch and cache information.
2021-07-18 15:00:22 +02:00
Bartosz Taudul
8c78af4d00
Drop limitView from GatherIpHwStats interface. 2021-07-18 15:00:21 +02:00
Bartosz Taudul
a5e655d1ee
Add relative hw samples checkbox. 2021-07-18 15:00:21 +02:00
Bartosz Taudul
b4c1313a2e
Make hw stats cost a parameter. 2021-07-18 02:03:29 +02:00
Bartosz Taudul
50f7deb1a3
Merge pull request #243 from benvanik/patch-4
Indenting empty GPU zone tree nodes when grouped to keep zones aligned.
2021-07-17 20:48:43 +02:00
Ben Vanik
ba185b18f9 Indenting empty grouped CPU/GPU zone tree nodes to keep things aligned. 2021-07-17 11:46:29 -07:00
Bartosz Taudul
4f3195153a
Merge pull request #242 from benvanik/patch-3
Fixing unbalanced tree pop in grouped GPU zones.
2021-07-17 20:03:41 +02:00
Ben Vanik
e3165c333b Fixing unbalanced tree pop in grouped GPU zones. 2021-07-17 09:25:44 -07:00
Bartosz Taudul
ef2a25319c
Update NEWS. 2021-07-11 19:46:02 +02:00
Bartosz Taudul
edae542a48
Allow selecting image name for filtering from a list. 2021-07-11 19:43:51 +02:00
Bartosz Taudul
b6db644ac6
Add hasher and comparator for StringIdx. 2021-07-11 19:43:40 +02:00
Bartosz Taudul
d6835f3a7a
Use correct language version for library. 2021-07-07 02:45:13 +02:00
Bartosz Taudul
0affc27abf
Merge pull request #238 from rokopt/non-reentrant-time-manual-fix
Update manual to reflect timing-mode GUI changes
2021-06-27 17:35:07 +02:00
Terence Rokop
c51e4fd11d
Update manual to reflect timing-mode GUI changes 2021-06-26 17:23:54 -07:00
Bartosz Taudul
6ddb24f57f
Update AUTHORS. 2021-06-26 22:53:02 +02:00
Bartosz Taudul
9f185310be
Merge pull request #230 from rokopt/recursive-zone-timings
Introduce "non-reentrant time" statistics view
2021-06-26 21:17:45 +02:00
Terence Rokop
68ec7abdf4
Move responsibility for spacing of combo box
Thereby fix a spurious horizontal separator bar.
2021-06-26 11:51:57 -07:00
Terence Rokop
d6fd252ce4
Add more spacing to pre-existing options 2021-06-26 10:41:24 -07:00
Terence Rokop
e105d2d96c
Aesthetic fixes to accumulation mode combo box
Shorter text fields and more spacing.
2021-06-26 10:41:23 -07:00
Terence Rokop
1dd117533e
Avoid non-reentrant option in sampling/symbol view 2021-06-26 10:41:23 -07:00
Terence Rokop
f000dce73f
Replace "enum class" switches with explicit casts 2021-06-26 08:30:15 -07:00
Terence Rokop
d6761c2ffa
Update manual for accumulation mode combo box 2021-06-25 21:33:12 -07:00
Terence Rokop
b392671a7a
Make time accumulation mode use combo box 2021-06-25 21:27:45 -07:00
Bartosz Taudul
2e466852ac
Merge pull request #237 from ilmai/master
Add meson.build
2021-06-24 22:02:32 +02:00
Jussi Viiri
fbed24dc0f Add meson.build 2021-06-24 22:41:50 +03:00
Bartosz Taudul
9a22b8e83c
Cosmetics. 2021-06-23 20:43:46 +02:00
Bartosz Taudul
913463635a
Cosmetics. 2021-06-23 20:37:14 +02:00
Terence Rokop
894c90f867
Update manual with new non-reentrant-time option 2021-06-20 18:00:47 -07:00
Terence Rokop
9366e58d12
Introduce "Non-reentrant time" radio button
Add to the statistics view an option for "Non-reentrant
time", which displays the count of and time spent in zone
events which were the only appearances (at that time) of
their zones on their threads' stacks.

Besides the GUI changes, this involves:

- Introducing a tri-state accumulation mode to replace the
boolean "self time":  now there's "Self time only",
"Child time", and "Non-reentrant time".

- Removing the separate "selfTotal" from SrcLocZonesSlim,
making "total" represent whichever of the now three options
is active, which in turn requires keeping track of the
accumulation mode in StatisticsCache and invalidating that
cache when the accumulation mode changes.
2021-06-20 17:56:15 -07:00
Terence Rokop
66053e37f7
Add non-reentrant stats to SourceLocationZones
Extend SourceLocationZones with fields to track the count
and time of non-reentrant zone events -- that is, zone
events which were the only appearances (at the time) of
those zones on their threads' stacks.
2021-06-20 17:56:15 -07:00
Terence Rokop
c90e39e06e
Keep track of zone appearances on thread stacks
Start keeping track, using the previously-introduced
SrcLocCountMap, of the number of appearances of each zone
on each thread's stack at a given time.
2021-06-20 17:56:15 -07:00
Terence Rokop
1f0b4656f4
Introduce SrcLocCountMap
Add to ThreadData a map from source location to a counter,
which will be used to keep track of the number of
appearances of zones with the corresponding source locations
on each thread's stack.
2021-06-20 17:56:14 -07:00
Terence Rokop
0a8ec09566
Introduce View::IsZoneReentry()
These two methods can search a timeline to determine whether
a given ZoneEvent is the only appearance of the given zone
on the current thread stack, or a re-entry.
2021-06-20 17:53:38 -07:00
Bartosz Taudul
32b1e8dcb0
No kernel symbol on macos. 2021-06-20 19:35:05 +02:00
Bartosz Taudul
759dd39f77
Update manual. 2021-06-20 19:18:36 +02:00
Bartosz Taudul
0e0692b7f7
Don't display hw samples as time in selected lines summary. 2021-06-20 16:01:19 +02:00
Bartosz Taudul
e9aca02880
Make hw sample cost in source files relative to whole symbol. 2021-06-20 15:55:21 +02:00
Bartosz Taudul
846bde1a11
Narrow down search range. 2021-06-20 14:37:56 +02:00
Bartosz Taudul
15b42039bd
Add very early exit test. 2021-06-20 14:34:47 +02:00
Bartosz Taudul
d4b92e0fbe
Add early exit conditions. 2021-06-20 14:33:08 +02:00
Bartosz Taudul
a10d71b766
Switch loop order for better cache locality on the slow path. 2021-06-20 14:30:55 +02:00
Bartosz Taudul
a9a16b4d94
Narrow down search region. 2021-06-20 14:24:42 +02:00
Bartosz Taudul
22352dd29b
Select optimized path before entering loop. 2021-06-20 14:22:14 +02:00
Bartosz Taudul
5d86002f82
Calculate all CPU usage values in one go. 2021-06-20 14:19:18 +02:00
Bartosz Taudul
5efc03cdf9
Move cycles up in cost combo selector. 2021-06-20 12:50:13 +02:00
Bartosz Taudul
c445c3805c
Merge remote-tracking branch 'origin/master' into hw 2021-06-20 11:13:02 +02:00
Bartosz Taudul
d90758e92d
Merge pull request #235 from avoroshilov/fix-compilation-warning
Fix compilation warning
2021-06-20 10:57:17 +02:00
Andrey Voroshilov
5670493757 Fix compilation warning 2021-06-19 23:26:03 -07:00
Bartosz Taudul
13c103065a
Update NEWS. 2021-06-20 01:17:38 +02:00
Bartosz Taudul
7e17c8643c
Don't show hw events as time. 2021-06-20 01:08:18 +02:00
Bartosz Taudul
bc4016e97c
Don't depend on callstack frames to match hw samples to source. 2021-06-20 01:01:29 +02:00
Bartosz Taudul
2f3ee594f0
Use square root to make slow branches and cache less spiky. 2021-06-20 00:50:14 +02:00
Bartosz Taudul
3305ea2775
Keep raw hw sample data visually separate. 2021-06-20 00:46:29 +02:00
Bartosz Taudul
07fe0a5447
Use enum for cost selection. 2021-06-20 00:45:39 +02:00
Bartosz Taudul
3cc69b221e
Select Zstd compression when Zstd level is changed. 2021-06-20 00:25:30 +02:00
Bartosz Taudul
80e1b0c2cf
Don't display hw samples as time in files list. 2021-06-20 00:14:19 +02:00
Bartosz Taudul
52708268fe
Store 64-bit integers in AddrStat. 2021-06-20 00:08:25 +02:00
Bartosz Taudul
4e6a1bae22
Don't display time for hw samples. 2021-06-20 00:04:08 +02:00
Bartosz Taudul
326a2a70d8
Add indirect hw statistics. 2021-06-20 00:01:37 +02:00
Bartosz Taudul
ad2b6e932b
Don't scroll cost combo list. 2021-06-20 00:01:21 +02:00
Bartosz Taudul
a5991036dc
Add more hw stats as cost. 2021-06-19 23:43:46 +02:00
Bartosz Taudul
c7b3d42852
Calculating cost in cycles and retirements. 2021-06-19 23:39:33 +02:00
Bartosz Taudul
90149641df
Reset cost selection when no samples. 2021-06-19 23:17:24 +02:00
Bartosz Taudul
8d52d2acfd
Disable inline context if no inline symbols available. 2021-06-19 21:40:30 +02:00
Bartosz Taudul
2e3241ba54
Restrict hardware samples to inline function context. 2021-06-19 20:50:06 +02:00
Bartosz Taudul
6cc844abee
Display inline symbol address. 2021-06-19 20:20:52 +02:00
Bartosz Taudul
cb63b35cb1
Update NEWS. 2021-06-19 20:14:39 +02:00
Bartosz Taudul
748c22df8e
Darken assembly instructions which aren't in current context. 2021-06-19 20:11:53 +02:00
Bartosz Taudul
53111f9dd9
Save/load code symbol map. 2021-06-19 19:58:16 +02:00
Bartosz Taudul
ee13d3fa44
Retrieve address of symbol, not first instruction in line. 2021-06-19 19:52:33 +02:00
Bartosz Taudul
8045ceee5d
Display function assigned to assembly line. 2021-06-19 19:52:33 +02:00
Bartosz Taudul
ec3ee09f09
Add inline symbols map accessors. 2021-06-19 19:13:34 +02:00
Bartosz Taudul
654331a8c8
Create code address -> symbol map. 2021-06-19 19:07:57 +02:00
Bartosz Taudul
fe7db6db4e
Send symbol address in code information message. 2021-06-19 19:07:56 +02:00
Bartosz Taudul
3ce2f6209a
Return symbol address in DecodeCodeAddress(). 2021-06-19 19:02:08 +02:00
Bartosz Taudul
cc0ca341bb
Add cost criteria selection UI. 2021-06-19 18:16:11 +02:00
Bartosz Taudul
7ad9cafefb
Add child call samples hints to the UI. 2021-06-19 17:41:29 +02:00
Bartosz Taudul
6e8d57bc98
Update context switches look. 2021-06-19 16:50:25 +02:00
Bartosz Taudul
c17a913cf5
Update zones look. 2021-06-19 16:43:56 +02:00
Bartosz Taudul
b91cd9148d
Add 2-segment line drawing wrapper. 2021-06-19 16:22:50 +02:00
Bartosz Taudul
188320db48
Simplify zone color data retrieval. 2021-06-19 16:20:35 +02:00
Bartosz Taudul
f6c2255e88
Update manual. 2021-06-19 14:24:59 +02:00
Bartosz Taudul
7e1622083e
Use monotonic raw clock for hardware sampling. 2021-06-19 13:40:31 +02:00
Bartosz Taudul
2c4b2ce6f0
Document how bad graphic drivers are. 2021-06-19 13:19:49 +02:00
Bartosz Taudul
5e582ef057
Omit line number from source locations, if not known. 2021-06-19 12:47:55 +02:00
Bartosz Taudul
91f1845d92
Add LocationToString() helper. 2021-06-19 12:33:23 +02:00
Bartosz Taudul
c69cf5bd3f
Cosmetics. 2021-06-19 12:33:16 +02:00
Bartosz Taudul
8e5a53a191
Merge remote-tracking branch 'origin/master' into hw 2021-06-19 12:19:10 +02:00
Bartosz Taudul
7fbf796ecb
Merge pull request #234 from avoroshilov/fix-crash-conversion
Fix a crash in Worker c-tor when converting certain JSON files
2021-06-19 12:01:27 +02:00
Andrey Voroshilov
d4d77006ac Fix a crash in Worker c-tor when converting certain JSON files 2021-06-19 01:12:41 -07:00
Bartosz Taudul
e1b68232dc
Better describe kernel ghost zones. 2021-06-19 01:40:05 +02:00
Bartosz Taudul
a96410547b
Display thread kernel time. 2021-06-17 01:56:16 +02:00
Bartosz Taudul
d49da69972
Count kernel samples. 2021-06-17 01:47:19 +02:00
Bartosz Taudul
7086f2db65
Merge branch 'master' into hw 2021-06-17 01:37:10 +02:00
Bartosz Taudul
fde62b4e6e
Dynamically load some dbghelp functions. 2021-06-17 01:34:45 +02:00
Bartosz Taudul
c41a5b0df0
Update manual. 2021-06-17 01:03:25 +02:00
Bartosz Taudul
8f8a28db60
Allow manual setting of DPI scale. 2021-06-17 00:52:50 +02:00
Bartosz Taudul
d2ebe341f2
Allow filtering out kernel symbols from statistics view. 2021-06-16 01:43:09 +02:00
Bartosz Taudul
f145ca5897
Fix assert. 2021-06-16 01:39:43 +02:00
Bartosz Taudul
538cf3bcf1
Deprecate cygwin and mingw. 2021-06-16 00:59:30 +02:00
Bartosz Taudul
2f7d79adba
No _alloca() on cygwin. 2021-06-16 00:52:12 +02:00
Bartosz Taudul
50e0d4781b
No kernel cache on cygwin. 2021-06-16 00:51:30 +02:00
Bartosz Taudul
48fe6550a6
Kernel code is unreachable from user space. 2021-06-15 21:40:08 +02:00
Bartosz Taudul
f1bf663160
Load kernel symbols. 2021-06-15 21:28:32 +02:00
Bartosz Taudul
2d5f6a411c
Add windows kernel module discovery. 2021-06-15 21:28:32 +02:00
Bartosz Taudul
8fa9860764
Load windows device drivers list. 2021-06-15 21:28:31 +02:00
Bartosz Taudul
bdb11f6e48
Use same kernel module name as on Linux. 2021-06-15 02:31:51 +02:00
Bartosz Taudul
5b642cad01
Implement combining sample callstacks.
This is required, because Windows will send two callstacks with the same
timestamp, one for kernel-space, second for user-space.
2021-06-15 02:25:12 +02:00
Bartosz Taudul
db1dc311b0
Add Int48 clearing function. 2021-06-15 02:04:32 +02:00
Bartosz Taudul
0fdd5ab01b
Extract callstack sample processing implementation. 2021-06-15 01:59:49 +02:00
Bartosz Taudul
6d03b18d1c
Don't filter out kernel frames on win32. 2021-06-15 01:40:21 +02:00
Bartosz Taudul
891e1ac280
Read combine samples flag on server. 2021-06-15 01:33:43 +02:00
Bartosz Taudul
697ec4372e
Set combine samples flag on win32. 2021-06-15 01:32:18 +02:00
Bartosz Taudul
06dcdd342f
Combine flags in welcome message. 2021-06-15 01:26:50 +02:00
Bartosz Taudul
004681b02b
Merge remote-tracking branch 'origin/master' into hw 2021-06-14 23:54:34 +02:00
Bartosz Taudul
5834a4be44
Update NEWS. 2021-06-14 23:52:23 +02:00
Bartosz Taudul
39e317f36d
Fix display of messages with newlines. 2021-06-14 23:51:41 +02:00
Bartosz Taudul
d07db80b44
Fix rpmalloc init for shared libraries. 2021-06-13 12:15:36 +02:00
Bartosz Taudul
698e5f0210
Probe precise_ip for software sampling. 2021-06-13 01:21:09 +02:00
Bartosz Taudul
2d2a5c92fd
Increase symbol retrieval size limit to 128 KB. 2021-06-13 01:16:29 +02:00
Bartosz Taudul
e17316fded
Document one more android workaround. 2021-06-13 01:13:20 +02:00
Bartosz Taudul
1f07a4ce35
One more query to acknowledge. 2021-06-13 01:08:04 +02:00
Bartosz Taudul
f773e18375
Different color for kernel frames in callstacks. 2021-06-12 16:16:56 +02:00
Bartosz Taudul
0c13889589
Distinguish kernel symbols on statistics list. 2021-06-12 16:09:44 +02:00
Bartosz Taudul
be07ccc1d3
Kernel symbols don't have parents. 2021-06-12 16:09:43 +02:00
Bartosz Taudul
b35dfe71d1
Send kernel symbol information. 2021-06-12 16:08:50 +02:00
Bartosz Taudul
3968945e6a
Display kernel ghost zones with a different color. 2021-06-12 15:35:44 +02:00
Bartosz Taudul
4dc05ab858
Implement retrieval of kernel symbol names. 2021-06-12 15:27:35 +02:00
Bartosz Taudul
0168ab6535
Server queries must be always acknowledged. 2021-06-12 14:44:55 +02:00
Bartosz Taudul
0a954fda87
Capture kernel frames on Linux.
Garbage frames ("markers") have to be filtered out.
2021-06-12 14:36:07 +02:00
Bartosz Taudul
ed50447f7a
Use alias for s_ring[i]. 2021-06-12 13:13:53 +02:00
Bartosz Taudul
f4c95eb021
Load linux kernel symbols list. 2021-06-11 01:31:02 +02:00
Bartosz Taudul
ca2130d56c
Process all data available in ring buffers. 2021-06-10 02:07:29 +02:00
Bartosz Taudul
5b7cd06840
Don't init rpmalloc, if we know it has been done already. 2021-06-10 01:48:11 +02:00
Bartosz Taudul
7889d33044
Add fast versions of tracy_malloc/tracy_free. 2021-06-10 01:18:03 +02:00
Bartosz Taudul
c20721ca4f
Update NEWS. 2021-06-09 21:17:44 +02:00
Bartosz Taudul
ff54c29913
Save/load GPU timer overflow information. 2021-06-09 21:12:50 +02:00
Bartosz Taudul
9e28f441c8
Cosmetics. 2021-06-09 21:12:42 +02:00
Bartosz Taudul
27e61b8204
Remove not needed check. 2021-06-09 21:08:48 +02:00
Bartosz Taudul
7aa575fd2e
Display GPU timer overflow notification. 2021-06-09 21:08:48 +02:00
Bartosz Taudul
de2ca9b22a
Change check for showing GPU timestamp accuracy. 2021-06-09 21:08:48 +02:00
Bartosz Taudul
b7b9912b10
Handle GPU timer overflows with heuristics. 2021-06-09 21:08:47 +02:00
Bartosz Taudul
90b51568e9
Add common lzcnt implementation.
Not really tested, so fingers crossed.
2021-06-09 20:29:43 +02:00
Bartosz Taudul
c61a7ef57b
Update NEWS. 2021-06-09 02:38:47 +02:00
Bartosz Taudul
bb0f5025b2
Also ignore "atomic" header. 2021-06-09 02:14:01 +02:00
Bartosz Taudul
9c2ea8a71f
Specify minimum length of subframe skip in one place. 2021-06-09 02:13:00 +02:00
Bartosz Taudul
e1c3babf43
Check whole ignore list on ARM. 2021-06-09 02:06:28 +02:00
Bartosz Taudul
854613f210
Ignore atomic_base.h implementation. 2021-06-09 02:05:44 +02:00
Bartosz Taudul
85da04bcc4
Add hw samples line part to source view. 2021-06-09 00:19:17 +02:00
Bartosz Taudul
def9570eda
Extract rendering hw samples line part. 2021-06-09 00:19:17 +02:00
Bartosz Taudul
18cace42ca
Display hw samples tooltip for source lines. 2021-06-08 23:46:30 +02:00
Bartosz Taudul
82bfee5127
Move helper functions to top of the file. 2021-06-08 23:46:29 +02:00
Bartosz Taudul
2eb50bcf42
Hardware sample data was already queried. 2021-06-08 23:46:29 +02:00
Bartosz Taudul
66318bdb3b
Display target FPS also as time available. 2021-06-08 22:56:06 +02:00
Bartosz Taudul
c79bfa349f
Update ARM CPU parts list. 2021-06-04 19:41:59 +02:00
Bartosz Taudul
ecf0e3d587
Update apple devices list. 2021-06-04 19:16:51 +02:00
Bartosz Taudul
b68c23fc64
Update x86 CPU models list. 2021-06-04 18:59:41 +02:00
Bartosz Taudul
4316d48bea
Add a note about CPUID list. 2021-06-04 18:48:01 +02:00
Bartosz Taudul
7c378cd0a9
Add Rocket Lake uarch data. 2021-06-04 18:40:37 +02:00
Bartosz Taudul
cc831e8192
Description is not supposed to be formatted. 2021-06-04 15:29:08 +02:00
Bartosz Taudul
0b05587b05
Don't need to format const string. 2021-06-04 15:27:23 +02:00
Bartosz Taudul
cb849ee14c
Capitalize Tracy name. 2021-06-04 15:17:20 +02:00
Bartosz Taudul
3c076ddb6f
Opening unsupported trace gives option to download update. 2021-06-04 15:17:20 +02:00
Bartosz Taudul
39cf98f98c
Move OpenWebpage() to a separate source file. 2021-06-04 15:17:14 +02:00
Bartosz Taudul
86510c48e0
Use proper type. 2021-06-04 15:16:44 +02:00
Bartosz Taudul
b281ce9c0e
Add missing include. 2021-06-04 15:01:50 +02:00
Bartosz Taudul
859aa3b2b0
Setup system tracing before launching profiler threads.
This makes sure that profiler threads are properly included in sample data on
Linux. This was previously working because sample capture was performed
system-wide. Now samples are only captured in client context, which includes
all spawned threads. Since this inclusion only works for threads which will be
spawned after the trace starts, no thread can be created before sampling setup
is done.
2021-06-04 14:07:46 +02:00
Bartosz Taudul
3c31fb56a8
Allow range-limiting hardware samples. 2021-06-04 13:58:00 +02:00
Bartosz Taudul
a1acea0c50
Support hw sample times on server. 2021-06-04 13:38:45 +02:00
Bartosz Taudul
2765be92fb
Sample time for hardware samples. 2021-06-04 12:50:55 +02:00
Bartosz Taudul
1616411257
Use AVX2 to search in strings with 32-byte blocks. 2021-06-03 13:49:38 +02:00
Bartosz Taudul
348582d6e4
Search for string matches with 8-byte blocks. 2021-06-03 13:10:26 +02:00
Bartosz Taudul
f8bb24ed36
Search for a character in string in 8-byte blocks. 2021-06-03 12:47:00 +02:00
Bartosz Taudul
483d31c1f4
Ringbuffer tail is not updated by kernel. 2021-06-03 01:14:44 +02:00
Bartosz Taudul
eb38640114
Fix uninitialized pointer. 2021-06-03 00:53:49 +02:00
Bartosz Taudul
b79014f3ee
Optimize parsing numbers.
Don't read byte-by-byte, process data in 8-byte packets.
2021-06-03 00:27:01 +02:00
Bartosz Taudul
b7c5939bb8
Merge remote-tracking branch 'origin/master' into hw 2021-06-02 01:12:28 +02:00
Bartosz Taudul
f4d80a4f5f
Fix rpmalloc init for TRACY_MANUAL_LIFETIME path. 2021-05-31 22:55:30 +02:00
Bartosz Taudul
1badc53e71
Update NEWS. 2021-05-31 22:40:57 +02:00
Bartosz Taudul
3da84d1579
Hide rpmalloc init behind thread local boolean. 2021-05-31 22:38:22 +02:00
Bartosz Taudul
b0fc0d5dcc
Check if rpmalloc has to be initialized before each operation.
The C++11 spec states in [basic.stc.thread] thread storage duration:

2. A variable with thread storage duration shall be initialized before its
   first odr-use (3.2) and, if constructed, shall be destroyed on thread exit.

Previously Tracy relied on the TLS data being initialized:
- During thread creation (MSVC).
- Or during first use in a thread, but the initialization was performed for
  the whole TLS block.

It seems that new compilers are more granular with how they perform the
initialization, hence rpmalloc init has to be checked before each allocation,
as it cannot be "folded" into, for example, initialization of the profiler
itself.
2021-05-31 02:31:42 +02:00
Bartosz Taudul
92fb197aac
Use weak compare, yield thread. 2021-05-31 02:22:13 +02:00
Bartosz Taudul
94ec6a0d9d
Move TracyYield.hpp to common. 2021-05-31 02:19:35 +02:00
Bartosz Taudul
c41473b445
Cosmetics. 2021-05-31 02:12:16 +02:00
Bartosz Taudul
3feb2473a2
Fix rpmalloc on ios.
https://github.com/mjansson/rpmalloc/issues/146
2021-05-30 13:38:29 +02:00
Timo Suoranta
f6eb909152
Documentation for CMake FetchContent support 2021-05-30 12:51:04 +02:00
Timo Suoranta
629b6d88bb
Provide CMake TracyClient header only library 2021-05-30 12:45:16 +02:00
Bartosz Taudul
e606c75695
Don't require GL headers if tracing is disabled. 2021-05-29 12:01:03 +02:00
Bartosz Taudul
688a9722c7
Update ImGui to 1.83 + docking. 2021-05-25 22:21:54 +02:00
Bartosz Taudul
4fc02f5680
Ignore intrinsic wrappers during code location resolution. 2021-05-24 00:02:44 +02:00
Bartosz Taudul
f8ccd8c40d
Move TracyStackFrames to common. 2021-05-23 23:51:56 +02:00
Bartosz Taudul
a6011cd1ad
Ignore intrinsic wrappers in callstack frames.
With gcc/clang the wrapper functions for intrinsics are annoyingly inserted at
top level of stack traces, making it hard to see the call site. Filter out all
known instrinsic headers.
2021-05-23 23:22:45 +02:00
Bartosz Taudul
c13611cf0c
Make unreliable hw stats darker. 2021-05-23 21:32:48 +02:00
Bartosz Taudul
cfb6d0d2ae
Timestamp conversion might be temporarily unavailable. 2021-05-23 20:32:09 +02:00
Bartosz Taudul
233a0bb6d6
Set precise_ip to 0 for cache on Intel.
Fuck knows how this is supposed to work. perf_event_open() opens the
descriptor successfully, but it produces no samples, if precise_ip is not 0.
There are no such problems on ARM (where precise_ip is 3, but maybe it is not
supported at all on that architecture, again, fuck knows if), and on AMD
perf_event_open() does not succeed when precise_ip > 0.
2021-05-23 19:45:13 +02:00
Bartosz Taudul
b2d5fe8e1f
Reduce sampling frequency. 2021-05-23 19:03:11 +02:00
Bartosz Taudul
b1e4d16537
PIDs are no longer needed in samples. 2021-05-23 19:00:45 +02:00
Bartosz Taudul
bbd1c4505c
Restrict perf to return events only for the current PID. 2021-05-23 18:53:09 +02:00
Bartosz Taudul
4ad6f682c8
Exclude VM-related stuff. 2021-05-23 18:44:16 +02:00
Bartosz Taudul
fece23a32b
Set frequency, not period.
This enables sampling on ARM dev board.
2021-05-23 18:02:06 +02:00
Bartosz Taudul
7d3119cbac
Remove irrelevant flag. 2021-05-23 18:01:18 +02:00
Bartosz Taudul
d869b9a8bc
Update manual. 2021-05-23 16:25:18 +02:00
Bartosz Taudul
19c41b94c0
Add glow to hotness indicators on lines. 2021-05-23 13:52:38 +02:00
Bartosz Taudul
a6f85bd061
Color hardware samples stats. 2021-05-23 13:13:38 +02:00
Bartosz Taudul
48ab346835
Add goodness color table accessor. 2021-05-23 12:49:40 +02:00
Bartosz Taudul
2544b891de
Add goodness color generator. 2021-05-23 12:49:20 +02:00
Bartosz Taudul
1b589855e8
Adjust hotness color scaling. 2021-05-23 12:29:48 +02:00
Bartosz Taudul
815cf7d00a
Display hardware counter statistics in asm line columns. 2021-05-23 02:39:31 +02:00
Bartosz Taudul
77c33327f4
Merge remote-tracking branch 'origin/master' into hw 2021-05-23 01:01:21 +02:00
Bartosz Taudul
5f7225ce32
Merge pull request #224 from keur/external_trace_use_file_and_line
Use file:line when comparing traces
2021-05-22 12:36:05 +02:00
Bartosz Taudul
1fc0e1ead5
Merge pull request #225 from stgatilov/patch-1
Tiny fix in manual
2021-05-22 12:13:26 +02:00
Kevin Kuehler
871d41be1f Implement FindMatchingZone(..)
Sets m_compare to the matched index. It supports multiple flags. It can
be run by comparing function name, source file, line number, and any
combination thereof. When searching for a match, we do 3 runs, quitting
out if any of them succeed.

  1. Look for zone with same function same, source file, line number.
  2. Look for zone with same function same, source file.
  3. Look for zone with same function same.
2021-05-22 01:33:06 -07:00
stgatilov
e01ba2d7d4
Tiny fix in manual
Without parentheses, bitwise-and takes precedence over bitwise-or.
2021-05-22 14:20:36 +07:00
Bartosz Taudul
34ca6d865e
Sample branches and cache more frequently. 2021-05-22 02:28:32 +02:00
Bartosz Taudul
c7026cbc1f
Reduce hw sample period. 2021-05-22 02:27:34 +02:00
Bartosz Taudul
089eda0be9
Precise_ip should be shared in each pair of counters. 2021-05-22 02:16:49 +02:00
Bartosz Taudul
fef507dfa2
Merge remote-tracking branch 'origin/master' into hw 2021-05-22 02:05:47 +02:00
Bartosz Taudul
68948712b4
Don't sleep if queues are empty, but there's queries to handle. 2021-05-22 01:12:42 +02:00
Bartosz Taudul
6bb05c5b97
Update NEWS. 2021-05-22 01:12:33 +02:00
Bartosz Taudul
1e6aedf9e6
Limit client query response rate.
Original idea by xavier <xavierb@gmail.com>
2021-05-22 01:05:06 +02:00
Bartosz Taudul
306055ebfa
Cosmetics. 2021-05-22 00:46:11 +02:00
Kevin Kuehler
5ab84d0c3f Use file:line when comparing traces
When comparing traces, where multiple classes share the same zone
names, the behavior prior to this patch was to auto-select the first
matching zone name in the other trace. Instead, find the most correct
zone by using filename and line number.
2021-05-21 15:25:26 -07:00
Bartosz Taudul
621d1b03cd
Update manual. 2021-05-21 22:28:38 +02:00
Bartosz Taudul
0f8ea78cd4
Update NEWS. 2021-05-21 22:28:38 +02:00
Bartosz Taudul
d7541bbdba
Allow disabling inline resolution on windows.
Original commit a6b25497 by xavier <xavierb@gmail.com>:

add TRACY_CALLSTACK_IGNORE_INLINES to tradeoff speed vs precision in win32 DecodeCallstackPtr()

SymQueryInlineTrace() is too slow in some cases:
300000 queries backlog getting processed at ~70 per second is prohibitive.

(without inlines resolution, it's more like ~20000 queries per second)
2021-05-21 22:27:35 +02:00
Bartosz Taudul
8ec08465ee
Add debug messages to perf event setup. 2021-05-21 01:47:45 +02:00
Bartosz Taudul
afcebb6e6a
Add debug print macros. 2021-05-21 01:47:31 +02:00
Bartosz Taudul
4d668741eb
Probe for acceptable precise_ip value.
This is stupid, but it's exactly what perf does... Sigh.
2021-05-21 01:33:37 +02:00
Bartosz Taudul
ea5a9ee83b
Merge remote-tracking branch 'origin/master' into hw 2021-05-20 20:56:16 +02:00
Bartosz Taudul
87cff004a4
Show hw samples tooltip when there are no samples. 2021-05-20 20:10:27 +02:00
Bartosz Taudul
3ba82ba4d6
Separate IPC, cache and branch data in tooltip. 2021-05-20 19:56:23 +02:00
Bartosz Taudul
c6f071a66a
Save and load hardware sample data. 2021-05-20 19:37:51 +02:00
Bartosz Taudul
9eda9dc696
Merge pull request #222 from xxxbxxx/gcc11
build with gcc 11
2021-05-20 17:59:03 +02:00
xavier
28e5aae17e build with gcc 11 2021-05-20 17:30:54 +02:00
Bartosz Taudul
30ba177168
Merge pull request #221 from RichardUSTC/patch-1
The value for paramter 'compressed_ttf_size' passed to 'AddFontFromMemoryCompressedTTF' seems to be a typo.
2021-05-20 11:09:37 +02:00
Bin LI
bde4d6c496
fix the typo
The value for paramter 'compressed_ttf_size' passed to 'AddFontFromMemoryCompressedTTF' seems to be a typo.
2021-05-20 09:13:26 +08:00
Bartosz Taudul
df50eb890f
Fix printing percentage. 2021-05-20 02:53:49 +02:00
Bartosz Taudul
bcb7b94272
Tid is not needed. 2021-05-20 02:39:22 +02:00
Bartosz Taudul
5a7e9cdbdd
0% miss rates are fine too. 2021-05-20 02:31:00 +02:00
Bartosz Taudul
f0f3babacf
Set correct message types. 2021-05-20 02:27:36 +02:00
Bartosz Taudul
9b4716c49e
Display cache and branch miss rates. 2021-05-20 02:26:02 +02:00
Bartosz Taudul
227a8d1aee
Process additional hardware sample data. 2021-05-20 02:19:11 +02:00
Bartosz Taudul
5f3d1c0faf
Sample cache and branch stats. 2021-05-20 02:15:23 +02:00
Bartosz Taudul
9ef5430c01
Document perf kernel parameters. 2021-05-20 02:00:49 +02:00
Bartosz Taudul
faf87809d7
Reduce hw sampling rate. 2021-05-20 01:48:52 +02:00
Bartosz Taudul
24b5e16718
Display hw sampling stats in tooltip. 2021-05-20 01:37:59 +02:00
Bartosz Taudul
741de5c8fb
Allow disabling cycle/retirement sampling. 2021-05-19 23:38:32 +02:00
Bartosz Taudul
3a0e12043d
Differentiate hw samples from code addresses. 2021-05-19 23:29:27 +02:00
Bartosz Taudul
2e38e70049
Reduce hardware sampling perdiod. Don't sample time. 2021-05-19 23:21:21 +02:00
Bartosz Taudul
28cc72a69c
Display hardware samples count. 2021-05-19 23:05:58 +02:00
Bartosz Taudul
3228e20c2e
Add hardware samples accessors. 2021-05-19 23:05:50 +02:00
Bartosz Taudul
373a2b66c6
Collect hardware sample data. 2021-05-19 23:05:33 +02:00
Bartosz Taudul
101cdd9b4b
Don't send thread id for hw samples. 2021-05-19 22:52:13 +02:00
Bartosz Taudul
64ed3d057d
Add no-op dispatch of HW samples. 2021-05-19 21:09:55 +02:00
Bartosz Taudul
7794443453
Collect CPU cycles and instruction retirement events. 2021-05-19 21:09:55 +02:00
Bartosz Taudul
16101571e0
Close perf_event file descriptor on exec. 2021-05-19 21:09:55 +02:00
Bartosz Taudul
9cd1b26bc7
Keep count of ring buffers separate from number of CPUs. 2021-05-19 21:09:55 +02:00
Bartosz Taudul
b7d52d2eab
Store RingBuffer identifier. 2021-05-19 21:09:52 +02:00
Bartosz Taudul
07778badcc
Release 0.7.8. 2021-05-19 20:36:38 +02:00
Bartosz Taudul
efc1777051
Implement range limit for child samples. 2021-05-19 20:26:50 +02:00
Bartosz Taudul
6d8abfe640
Add utility for trace version identification. 2021-05-18 02:49:41 +02:00
Bartosz Taudul
5ec1313af1
Drop legacy code for reading long unsupported traces. 2021-05-18 02:24:56 +02:00
Bartosz Taudul
98551ab892
Simplify history a bit. 2021-05-18 02:20:19 +02:00
Bartosz Taudul
b7832a2510
Cherry-pick https://github.com/facebook/zstd/pull/2653 2021-05-18 02:10:30 +02:00
Bartosz Taudul
2544a91c6b
Merge pull request #220 from ktf/patch-1
Fix compilation on macOS 11.0.0 with XCode 12.5
2021-05-17 13:37:26 +02:00
Giulio Eulisse
aace8ac317
Update TracyView.cpp 2021-05-17 12:09:14 +02:00
Giulio Eulisse
2cdc3abba2
Update TracyImGui.hpp 2021-05-17 12:07:35 +02:00
Giulio Eulisse
4ab706d538
Update TracyMouse.cpp 2021-05-17 12:07:06 +02:00
Giulio Eulisse
bcb250aaab
Update TracySourceView.cpp 2021-05-17 12:06:37 +02:00
Giulio Eulisse
63e2c16e74
Do not use relative include path for ImGUI.h
#pragma once gets confused by `../../imgui/imgui.h` and `imgui.h` on macOS with XCode 12.5.
2021-05-17 12:05:14 +02:00
Bartosz Taudul
8219a0e4ca
Fix shift. 2021-05-15 18:39:01 +02:00
Bartosz Taudul
12da89a45e
Update manual. 2021-05-15 18:32:52 +02:00
Bartosz Taudul
e3f54dc4dd
Update NEWS. 2021-05-15 18:09:07 +02:00
Bartosz Taudul
c91c7a7fd5
Use zstd dict for packing/unpacking frame images.
This only affects run-time memory usage and needs an offline calculation of
the dictionary. Results vary depending on similarity of image blocks.

agora        34.96 MB ->  28.21 MB
agora2       40.75 MB ->  34.14 MB
android-vk   36.21 MB ->  18.44 MB
astar3       44.72 MB ->  43.38 MB
clipper1    134.36 MB ->  52.16 MB
fi           50.82 MB ->  40.79 MB
fi-big      537.74 MB -> 469.54 MB
test         23.26 MB ->   1.87 MB
2021-05-15 18:06:44 +02:00
Bartosz Taudul
d555256546
Don't use separate texture compression context.
Previously it was needed, as saving could be made at the same time the UI was
active. Currently saving blocks UI access to data structures, as it possibly
may need to sort unsorted vectors.
2021-05-15 18:04:14 +02:00
Bartosz Taudul
925a23a053
Add texture packer with zstd dict support. 2021-05-15 18:04:14 +02:00
Bartosz Taudul
a53f5702b1
Calculate frame images dictionary. 2021-05-15 18:03:50 +02:00
Bartosz Taudul
56958a018c
Only show dict building checkbox if there are frame images. 2021-05-15 15:52:54 +02:00
Bartosz Taudul
3d75bf653a
Add interface for frame images dict building. 2021-05-15 15:50:20 +02:00
Bartosz Taudul
859b8e4193
Add zstd dict builder. 2021-05-15 14:56:38 +02:00
Bartosz Taudul
959ddc3501
Update manual. 2021-05-15 14:33:10 +02:00
Bartosz Taudul
0414473c9f
Update NEWS. 2021-05-15 14:27:49 +02:00
Bartosz Taudul
92ae003308
Improve trace saving experience.
This adds additional dialog, which allows selection of compression mode. Also,
when a trace cannot be saved, a failure popup will be displayed.
2021-05-15 14:25:45 +02:00
Bartosz Taudul
ab830962c8
Fix notifications disappearing after a long UI lock. 2021-05-15 14:21:45 +02:00
Bartosz Taudul
fe71ae3272
Update manual. 2021-05-15 13:12:54 +02:00
Bartosz Taudul
068141abfc
Update NEWS. 2021-05-15 13:09:46 +02:00
Bartosz Taudul
7f1f929662
Decode PID and TID when generating imported thread names. 2021-05-15 13:08:51 +02:00
Bartosz Taudul
8ea02a4794
Cosmetics. 2021-05-15 13:03:42 +02:00
Bartosz Taudul
6b2de1c8b5
Pack PID + TID. 2021-05-15 12:56:52 +02:00
Bartosz Taudul
3005d5a939
Cosmetics. 2021-05-15 12:54:29 +02:00
Bartosz Taudul
cb0bc67790
Bump zstd to 1.5.0. 2021-05-15 00:48:15 +02:00
Bartosz Taudul
bb25687f7e
Update manual. 2021-05-11 18:37:08 +02:00
Bartosz Taudul
84bb131f81
Update NEWS. 2021-05-11 18:32:06 +02:00
Bartosz Taudul
42a272edf5
Allow control of sampling frequency. 2021-05-11 18:31:20 +02:00
Bartosz Taudul
05b5f1cfe1
Update manual. 2021-05-11 01:57:10 +02:00
Bartosz Taudul
8bdae80960
Update NEWS. 2021-05-11 01:43:07 +02:00
Bartosz Taudul
4f76fb2cda
Store location in SourceLocation during chrome import. 2021-05-11 01:37:59 +02:00
Bartosz Taudul
db734e3e0a
Parse custom location tags. 2021-05-11 01:37:59 +02:00
Bartosz Taudul
97f54f539d
Merge pull request #211 from c-cube/multi-pid-import
chrome-import: handle multiple pids
2021-05-10 18:59:03 +02:00
Simon Cruanes
b512ce3fa8 do not mangle tid if there is no pid 2021-05-10 11:49:07 -04:00
Simon Cruanes
d38f579ec3 refactor after review 2021-05-10 11:20:48 -04:00
Simon Cruanes
7e694d452a improve chrome importer to better display string arguments 2021-05-10 10:59:03 -04:00
Simon Cruanes
b71c9c12c4 map {tid,pid} from catapult into a virtual tid 2021-05-06 20:47:03 -04:00
Bartosz Taudul
f03b677ffa
Use correct size value. 2021-05-06 22:26:40 +02:00
Bartosz Taudul
7f0191d19f
Use streaming zstd API. 2021-05-06 22:21:52 +02:00
Bartosz Taudul
3c6a06f97e
Update manual. 2021-05-06 18:29:22 +02:00
Bartosz Taudul
d39580fa38
Update NEWS. 2021-05-06 18:24:34 +02:00
Bartosz Taudul
fa1a717e3c
Add support for importing zstd-compressed chrome traces. 2021-05-06 18:10:08 +02:00
Bartosz Taudul
a6c6943a6c
Check if GetThreadDescription() is supported.
This functionality is available since Win 10 1607.
2021-05-04 16:13:42 +02:00
Bartosz Taudul
402d749d13
Update NEWS. 2021-05-02 18:20:26 +02:00
Bartosz Taudul
7c5c2d5721
Merge pull request #206 from xxxbxxx/vulkan-linux
Support VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT
2021-05-02 18:17:19 +02:00
xavier
1c097140cd Support VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_EXT
to enable profiling vulkan on linux.
2021-05-02 18:03:25 +02:00
Bartosz Taudul
8d21202aaa
Remove floating point computation within hot loops. 2021-05-02 16:36:35 +02:00
Bartosz Taudul
2e1d0deb3f
Update NEWS. 2021-05-02 02:51:28 +02:00
Bartosz Taudul
7708184f73
Merge pull request #204 from nosferalatu/Direct3D11
Direct3D11
2021-05-02 02:46:24 +02:00
Bartosz Taudul
ab627f9da2
Build zig-zag path in a preallocated buffer. 2021-05-02 02:40:36 +02:00
David Farrell
3f2d0bbf6e The ToyPathTracer example uses the D3D11 GPU zones 2021-05-01 17:31:49 -07:00
Bartosz Taudul
c668a08530
Missing space. 2021-05-02 02:21:49 +02:00
David Farrell
23010ee4d0 Updated README.md 2021-05-01 16:56:52 -07:00
David Farrell
3ad3d0234f Updated documentation with D3D11 information. 2021-05-01 16:54:59 -07:00
David Farrell
fe2adc8df4 Updated authors 2021-05-01 16:31:06 -07:00
David Farrell
dcf33b51cf Updated comment to say that both OpenGL _and_ Direct3D11
don't need per-zone thread id.
2021-05-01 16:31:06 -07:00
David Farrell
76294ca458 This commit makes the D3D11 code consistent with the D3D12 code.
It now properly supports TRACY_CALLSTACK as well as the
Tracy*Transient macros.

The order of the macros now has the same order as the D3D12 file.

Added support for TracyD3D11ContextName().

I removed TRACY_D3D11_NO_SINGLE_THREAD, because I'm not
sure what that is supposed to be used for. It was set
up in an upstream fork of Tracy.
2021-05-01 16:27:59 -07:00
David Farrell
9546ff18b8 Removed CMakeLists.txt 2021-05-01 15:03:53 -07:00
David Farrell
e9fd767884 Added missing comma in GpuContextNames 2021-05-01 15:03:02 -07:00
Rahul Gupta
a950e444b5 Updated as suggested by wolf in the PR 2021-05-01 14:55:45 -07:00
Rahul Gupta
c5fa9be41e Fixed the Macro Errors and Renamed Class names for more consistency 2021-05-01 14:55:45 -07:00
Hugo Amiard
4bf449c4c0 Fix Linux build 2021-05-01 14:55:45 -07:00
Hugo Amiard
d44d7db489 Add D3D11 Gpu Context/Zone 2021-05-01 14:55:45 -07:00
Hugo Amiard
aea72b28ce Add SourceLocation macros 2021-05-01 14:55:45 -07:00
Hugo Amiard
fb60fb9928 Add CMake support 2021-05-01 14:55:45 -07:00
Bartosz Taudul
0525cbc791
Update NEWS. 2021-05-01 18:26:13 +02:00
Bartosz Taudul
6c633762f9
Update manual. 2021-05-01 18:25:33 +02:00
Bartosz Taudul
ad7777b3c9
Mouse scroll -> mouse wheel. 2021-05-01 18:23:56 +02:00
Bartosz Taudul
4a8bfb4fac
Add ctrl/shift modifiers to mouse wheel zoom speed. 2021-05-01 18:20:19 +02:00
Bartosz Taudul
0bd6479f85
Optimizer IM_FIXNORMAL2F. 2021-05-01 18:10:29 +02:00
Bartosz Taudul
630615c6c2
Apply IM_NORMALIZE2F_OVER_ZERO optimization. 2021-05-01 18:10:20 +02:00
Bartosz Taudul
0e6a25fdd8
Directly compare time, with data piggybacked in low bits. 2021-05-01 15:04:56 +02:00
Bartosz Taudul
a688d24665
Replace two memory reads with just one. 2021-05-01 14:32:02 +02:00
Bartosz Taudul
088dd06197
Use DrawLine() in TracyView.cpp. 2021-05-01 13:59:43 +02:00
Bartosz Taudul
837272afba
Properly align context switch darken boxes. 2021-05-01 13:39:19 +02:00
Bartosz Taudul
a1aefe33a0
Use DrawLine() in TracySourceView.cpp. 2021-05-01 12:55:56 +02:00
Bartosz Taudul
c27c81db4c
Use DrawLine() in DrawCpuData(). 2021-05-01 02:59:43 +02:00
Bartosz Taudul
fe22d5a6f6
Add fast line drawing function.
This skips unnecessary construction of ImVec2 vector.

Note: unlike AddLine(), this function doesn't add 0.5 to x and y coordinates.
The user is expected to do it on his own, which if done in just one place will
be performance beneficial.
2021-05-01 02:57:35 +02:00
Bartosz Taudul
b9ce9540be
Remove namespace indent in TracyImGui.hpp. 2021-05-01 02:26:46 +02:00
Bartosz Taudul
57d87af8a2
Add tooltips for register read/write markers. 2021-05-01 00:22:11 +02:00
Bartosz Taudul
a001683a77
Update NEWS. 2021-04-29 21:05:36 +02:00
Bartosz Taudul
86ff14ad7e
Update manual. 2021-04-29 21:05:10 +02:00
Bartosz Taudul
eb7d220eea
Added support for TRACY_NO_FRAME_IMAGE define. 2021-04-29 20:55:16 +02:00
Bartosz Taudul
de5f258b03
Display complementary assembly address tooltips. 2021-04-29 20:33:10 +02:00
Bartosz Taudul
854439cdb1
Display jump target in asm instruction tooltip. 2021-04-29 20:27:32 +02:00
Bartosz Taudul
ac9b97319a
Extract jump name retrieval. 2021-04-29 20:08:18 +02:00
Bartosz Taudul
05894f6f14
Shuffle code around to avoid error C2712. 2021-04-29 19:10:30 +02:00
Bartosz Taudul
251f331f99
Update NEWS. 2021-04-29 18:24:37 +02:00
Bartosz Taudul
56f0bdd571
ARM doesn't follow x64 canonical address requirements. 2021-04-29 18:24:37 +02:00
Bartosz Taudul
505656df5a
Trace frame count may be zero. 2021-04-29 18:24:37 +02:00
Bartosz Taudul
7cfaaf6310
Exactly known latency shouldn't vary. 2021-04-29 18:24:37 +02:00
Bartosz Taudul
9bc3afabe7
Add robin hood natvis.
https://gist.github.com/ikrima/1184c75b979cbfa655c0883c0d4ab068
2021-04-29 18:24:34 +02:00
Bartosz Taudul
4a1142fddf
Merge pull request #201 from nosferalatu/dont_early_out_in_memfree_when_ptr_is_zero
Change ev.ptr nullptr early-out to properly handle nullptrs
2021-04-21 23:44:21 +02:00
David Farrell
be963f184c Change ev.ptr nullptr early-out to happen only when there is not a previous allocation for address 0. Custom memory pools (like custom allocators for Vulkan memory pools) can allocate at address 0, so the previous code would cause the Tracy server to alloc(0), free(0) (but early out), then on the next alloc(0) it would have a MemAllocTwiceFailure (because it skipped the free). 2021-04-21 11:53:55 -07:00
Bartosz Taudul
da9a32fd09
Update manual. 2021-04-20 18:34:08 +02:00
Bartosz Taudul
0bbda5ea11
Pressing Z will temporarily switch child calls. 2021-04-20 18:19:00 +02:00
Bartosz Taudul
e189f596ac
Add no-statistics guards. 2021-04-18 22:59:10 +02:00
Bartosz Taudul
cbf8550a45
Update NEWS. 2021-04-18 22:46:10 +02:00
Bartosz Taudul
d234f4dbe4
Generate child sample data during capture. 2021-04-18 22:44:37 +02:00
Bartosz Taudul
fb872fa088
Add child samples to source view percentages. 2021-04-18 22:23:55 +02:00
Bartosz Taudul
cba72859e9
No parents if only child samples. 2021-04-18 22:00:49 +02:00
Bartosz Taudul
141a4bc0fe
Fix scroll bar display of child-only samples. 2021-04-18 22:00:49 +02:00
Bartosz Taudul
c7da9b1092
Fix rendering of lines with no local samples. 2021-04-18 22:00:49 +02:00
Bartosz Taudul
66ef71cf7b
Gather child IP stats for addresses without samples. 2021-04-18 22:00:49 +02:00
Bartosz Taudul
ef93c69ee9
Make child calls more discoverable. 2021-04-18 22:00:48 +02:00
Bartosz Taudul
2009f63e32
Group time/samples data by local and child. 2021-04-18 20:43:23 +02:00
Bartosz Taudul
a5afa2cb4e
Use correct address for child sample information. 2021-04-18 20:43:23 +02:00
Bartosz Taudul
4970c48c51
Don't shadow variables. 2021-04-18 20:43:23 +02:00
Bartosz Taudul
c859d655ad
Include child calls in asm view percentages. 2021-04-18 20:43:22 +02:00
Bartosz Taudul
50a1faa880
Don't print zero sample counts in tooltips. 2021-04-18 20:16:05 +02:00
Bartosz Taudul
5f97c484f1
Include child samples in symbol view file list. 2021-04-18 19:42:24 +02:00
Bartosz Taudul
046881e32f
Add AddrStat::operator+=( AddrStat ). 2021-04-18 19:40:43 +02:00
Bartosz Taudul
22a8c53e8b
Account for case with no local samples (external only). 2021-04-18 19:21:53 +02:00
Bartosz Taudul
b217e00dd9
Hackfix support for UTF-8 in source files. 2021-04-18 19:14:12 +02:00
Bartosz Taudul
526d0cd22a
Display child time and samples in symbol stats. 2021-04-18 19:10:39 +02:00
Bartosz Taudul
c5eb398319
Gather external IP stats (no range limit case). 2021-04-18 19:04:29 +02:00
Bartosz Taudul
8db9bcf7f8
Disable child calls checkbox while processing data. 2021-04-18 18:27:39 +02:00
Bartosz Taudul
0d8ee47231
Store instruction pointer stats as AddrStat. 2021-04-18 16:16:47 +02:00
Bartosz Taudul
3845c392fa
Cosmetics. 2021-04-18 15:52:42 +02:00
Bartosz Taudul
55efa64b3f
Do not copy instruction pointer maps. 2021-04-18 15:51:50 +02:00
Bartosz Taudul
32e3c0ebb1
Display child sample counts in info window. 2021-04-18 15:06:54 +02:00
Bartosz Taudul
34b80ac52f
Add child samples count getters. 2021-04-18 15:03:42 +02:00
Bartosz Taudul
2f6adf3641
Add child calls UI. 2021-04-18 15:00:19 +02:00
Bartosz Taudul
ffe8aebfbd
Extend address stats to include child samples. 2021-04-18 15:00:19 +02:00
Bartosz Taudul
df462f109d
Reconstruct child sample data. 2021-04-18 15:00:19 +02:00
Bartosz Taudul
4dc6222ba1
Add child samples data structure. 2021-04-18 14:42:35 +02:00
Bartosz Taudul
fa8c99fd74
Fix missing limit range checkbox in source view.
This could happen if range was limited in such a way, that no sample was
within the region.
2021-04-18 14:42:35 +02:00
Bartosz Taudul
0476e851ff
Force inline LZ4_NbCommonBytes(). 2021-04-18 14:42:35 +02:00
Bartosz Taudul
aee39d3fcd
Disable collapsing of connection window. 2021-04-18 14:42:31 +02:00
Bartosz Taudul
d71d76414b
Allow setting NO_PARALLEL_SORT externally. 2021-04-15 19:55:50 +02:00
Bartosz Taudul
207a48e986
Merge pull request #197 from jwdevel/use-rpmalloc-in-ProfilerThreadDataKey
Use tracy_malloc rather than 'new' in ProfilerThreadDataKey
2021-04-12 19:35:24 +02:00
JW
915693ac39 Use tracy_malloc rather than 'new' in ProfilerThreadDataKey
This codepath, involving a workaround for GCC < 8.4, called 'new' and
'delete' directly, which could cause infinite recursion when
user-provided versions of those functions were themselves using Tracy
functionality.

Now, this codepath uses Tracy's internal allocator.

See issues #194, #196
2021-04-12 10:06:35 -07:00
Bartosz Taudul
40efbe8529
Use rpmalloc for initialization-related allocations. 2021-04-10 13:02:32 +02:00
Bartosz Taudul
2bb5d126fd
rpmalloc_thread_initialize is called in RPMallocInit. 2021-04-10 12:55:00 +02:00
Bartosz Taudul
efc12c2032
Merge pull request #195 from jkriegshauser/windows-getenv-fix
Windows getenv fix
2021-04-10 12:27:57 +02:00
joshuakr
fa942d18fe Fix spacing 2021-04-09 15:35:44 -07:00
joshuakr
e845c23493 Removed duplicate function 2021-04-09 15:35:07 -07:00
joshuakr
3fad55d7bc Missed one 2021-04-09 15:34:21 -07:00
joshuakr
eac23cead2 PR feedback 2021-04-09 15:33:01 -07:00
Eric van Beurden
fc142b4f9c fixed a build break on AARCH64. 2021-04-09 13:50:35 -07:00
Eric van Beurden
00ac6d1d8e worked around Windows broken getenv() call. 2021-04-09 13:50:02 -07:00
Bartosz Taudul
7e33165c40
Merge pull request #194 from jkriegshauser/centos7-shutdown-crash
Fix centos shutdown crash
2021-04-09 21:15:18 +02:00
Joshua Kriegshauser
76a02205f3 Fix centos shutdown crash 2021-04-09 11:58:34 -07:00
Bartosz Taudul
07996c16cf
Fix gcc 8.3 with LTO.
In member function ‘UpdateSampleStatisticsImpl’:
warning: argument 1 value ‘18446744073709551598’ exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
         auto cfdata = (CallstackFrame*)alloca( ( fxsz-1 ) * sizeof( CallstackFrame ) );
                                        ^
2021-04-09 01:15:18 +02:00
Bartosz Taudul
69300ef6ec
Welcome window shouldn't be collapsible. 2021-04-08 01:35:58 +02:00
Bartosz Taudul
2477f33a6d
Update robin-hood-hashing to 3.11.1. 2021-04-08 01:07:56 +02:00
Bartosz Taudul
5cada49780
Update NEWS. 2021-04-01 20:18:24 +02:00
Bartosz Taudul
592644ae43
Don't issue warning if only disconnect is in send queue. 2021-04-01 20:16:47 +02:00
Bartosz Taudul
9b7f759347
Allow checking if disconnect was requested. 2021-04-01 20:16:29 +02:00
Bartosz Taudul
e6398250ca
Update NEWS. 2021-04-01 18:49:37 +02:00
Bartosz Taudul
450013bc27
Update to current uops.info xml file.
This updates ZEN3 and adds Tiger Lake.
2021-04-01 18:46:00 +02:00
Bartosz Taudul
da29ec975b
Release 0.7.7. 2021-04-01 18:15:07 +02:00
Bartosz Taudul
e35d02186d
Merge pull request #191 from benvanik/patch-2
Add missing declarations for the _named variants of memory alloc/free.
2021-03-31 23:43:52 +02:00
Ben Vanik
b7e1fec37f
Add missing declarations for the _named variants of memory alloc/free. 2021-03-31 14:30:31 -07:00
Bartosz Taudul
8ddf26fff2
Simplify code. 2021-03-27 15:24:42 +01:00
Bartosz Taudul
741aebaa77
Update NEWS. 2021-03-27 14:16:11 +01:00
Bartosz Taudul
4c4fc7197c
Add source preview to entry call stacks window. 2021-03-27 14:15:18 +01:00
Bartosz Taudul
9bbffcb67f
Add source tooltip in memory frame trees. 2021-03-27 14:09:40 +01:00
Bartosz Taudul
5ebffe388a
Check for file name pointer validity. 2021-03-27 14:09:35 +01:00
Bartosz Taudul
ff6ecef5f3
Add source preview to statistics window. 2021-03-27 14:02:52 +01:00
Bartosz Taudul
62ac5544b6
Trim empty lines at top and bottom of source preview. 2021-03-27 13:55:22 +01:00
Bartosz Taudul
a15ba0c7fb
Show source preview tooltip in find zones. 2021-03-27 13:47:20 +01:00
Bartosz Taudul
895a63b41a
Add source preview to call stack window. 2021-03-27 13:43:12 +01:00
Bartosz Taudul
e2be45c0ba
Show preview of lock source locations in options window. 2021-03-27 13:43:12 +01:00
Bartosz Taudul
8f0c5e867e
Source tooltip implementation. 2021-03-27 13:43:11 +01:00
Bartosz Taudul
0b6e55ee87
Store fixed-width font in View. 2021-03-27 13:43:11 +01:00
Bartosz Taudul
d56f7dab09
Remove unneeded forward declarations. 2021-03-27 13:05:59 +01:00
Bartosz Taudul
1cb6c17991
Move syntax color tables to a common header. 2021-03-27 13:03:19 +01:00
Bartosz Taudul
ff5435ff67
Cosmetics. 2021-03-27 13:03:19 +01:00
Bartosz Taudul
02cb035768
Update NEWS. 2021-03-26 02:43:09 +01:00
Bartosz Taudul
0b5a923e91
Display preview of source code for assembly instructions. 2021-03-26 02:42:15 +01:00
Bartosz Taudul
bd4335bace
Move source file parsing logic to a separate file. 2021-03-26 02:42:14 +01:00
Bartosz Taudul
174bb4d2f1
Extract source code tokenizer to a separate file. 2021-03-26 01:53:49 +01:00
Bartosz Taudul
ca79cd5faf
Update manual. 2021-03-26 00:41:09 +01:00
Bartosz Taudul
b80899863b
Consistently use "entry call stacks". 2021-03-26 00:40:54 +01:00
Bartosz Taudul
d8e9d369a0
Update NEWS. 2021-03-26 00:28:16 +01:00
Bartosz Taudul
2fe1fb974a
Display number of entry call stacks in a tooltip. 2021-03-26 00:27:23 +01:00
Bartosz Taudul
514acf1bac
Don't copy stats. 2021-03-26 00:21:19 +01:00
Bartosz Taudul
29133431bc
Calculate symbol address for parents earlier.
While currently this makes no sense, it will be also used in common code
path.
2021-03-26 00:17:46 +01:00
Bartosz Taudul
ec16182887
Only pack pointer if needed. 2021-03-26 00:14:12 +01:00
Bartosz Taudul
eaef966aa9
Merge pull request #188 from annacrombie/fix_TRACY_NO_FILESELECTOR_macro
fix TRACY_NO_FILESELECTOR macro
2021-03-17 02:19:10 +01:00
Stone Tickle
9816c99f5d
add note about TRACY_NO_FILESELECTOR in docs 2021-03-17 09:02:33 +09:00
Stone Tickle
1918c0ffe6
fix TRACY_NO_FILESELECTOR macro 2021-03-17 08:51:24 +09:00
Bartosz Taudul
ea2a7f639b
Don't link with OpenGL.
The OpenGL is dynamically loaded by gl3w.
2021-03-16 22:59:28 +01:00
Bartosz Taudul
e3409406d1
Merge pull request #187 from annacrombie/update_gl3w
update gl3w
2021-03-16 22:57:55 +01:00
Bartosz Taudul
248bc8734e
Merge pull request #186 from annacrombie/fix_function_macro
replace __FUNCTION__ with __func__ from c99 std
2021-03-16 22:55:28 +01:00
Stone Tickle
97313a295b
remove explicit linking for dlopened OpenGL 2021-03-17 06:43:52 +09:00
Stone Tickle
0f6c766167
update gl3w 2021-03-16 16:17:01 +09:00
Stone Tickle
d68cd15173
replace __FUNCTION__ with __func__ from c99 std
https://gcc.gnu.org/onlinedocs/gcc/Function-Names.html

__FUNCTION__ gives warnings with -Wpedantic
2021-03-16 15:51:54 +09:00
Bartosz Taudul
06b1214aff
Update ImGUI to 1.82 + docking. 2021-03-15 21:13:01 +01:00
Bartosz Taudul
753c007557
Update NEWS. 2021-03-09 22:19:42 +01:00
Bartosz Taudul
8dd92f32af
Handle memory double allocation failure. 2021-03-09 22:19:42 +01:00
Bartosz Taudul
4846b4f450
Update NEWS. 2021-03-09 02:18:24 +01:00
Bartosz Taudul
6d5710901c
Fix ZoneColor channel order. 2021-03-09 02:14:57 +01:00
Bartosz Taudul
c288a7903b
Make {Startup,Shutdown}Profiler() signatures consistent. 2021-03-08 02:39:51 +01:00
Bartosz Taudul
57d636f243
Update NEWS. 2021-02-27 20:00:01 +01:00
Bartosz Taudul
99c6b91c0c
Fix sending GPU context name in on-demand mode. 2021-02-27 19:59:32 +01:00
Bartosz Taudul
401ee2ff2e
Update NEWS. 2021-02-25 22:26:29 +01:00
Bartosz Taudul
7f1b29ec7a
Set windows code page to utf8. 2021-02-25 19:21:45 +01:00
Bartosz Taudul
1070d74acf
Update NEWS. 2021-02-25 18:54:49 +01:00
Bartosz Taudul
9a5d3b729d
Fix vcpkg. 2021-02-25 18:40:27 +01:00
Bartosz Taudul
c12de1b326
Merge pull request #178 from sideeffects/master
Add IsActive accessor to ScopedZone.
2021-02-16 20:52:29 +01:00
John Lynch
f3fd935263 Add ZoneIsActive and ZoneIsActiveV macros. 2021-02-16 13:38:54 -06:00
John Lynch
29af8352ee Add IsActive accessor to ScopedZone. 2021-02-12 20:30:43 -06:00
Bartosz Taudul
d8c1dae9e1
Merge pull request #177 from sideeffects/master
Use triple underscore in ZoneColor!
2021-02-12 19:28:31 +01:00
John Lynch
d471c890b1 Use triple underscore! 2021-02-12 11:08:43 -06:00
Bartosz Taudul
9c598b034e
Merge pull request #176 from sideeffects/master
Fix typo in ZoneColor macro.
2021-02-12 17:54:49 +01:00
John Lynch
d28eb62448 Fix typo in ZoneColor macro. 2021-02-12 10:49:44 -06:00
Bartosz Taudul
5ea71ea20d
Apparently program_invocation_short_name may be not defined. 2021-02-11 18:12:59 +01:00
Bartosz Taudul
f0e1d77ebc
Update imgui to 1.81 + docking. 2021-02-11 00:30:41 +01:00
Bartosz Taudul
26a8ec3909 Reuse existing variable. 2021-02-10 18:56:07 +01:00
Bartosz Taudul
3c3cfe5eea Update email. 2021-02-10 02:43:05 +01:00
Bartosz Taudul
b51e3fbbc8 Remove unneeded variable. 2021-02-07 21:08:52 +01:00
Bartosz Taudul
5e48eebf26 Fix type in comparison. 2021-02-07 21:08:24 +01:00
Bartosz Taudul
936f03fa9e Update NEWS. 2021-02-07 21:06:02 +01:00
Bartosz Taudul
9cfc36f92e Preserve valid order of server query acknowledgements. 2021-02-07 20:53:20 +01:00
Bartosz Taudul
9b5cc3352a Fast search for zone tid in GetZoneThreadData(). 2021-02-07 20:27:33 +01:00
Bartosz Taudul
c6c9fec383 Faster search for tid of zone in GetZoneParent(). 2021-02-07 20:27:33 +01:00
Bartosz Taudul
35267abc8e Remove obsolete GetZoneDepth() method. 2021-02-07 19:58:23 +01:00
Bartosz Taudul
02451fecd7 Remove not needed methods from SortedVector. 2021-02-07 19:36:45 +01:00
Bartosz Taudul
18e893752b Use SortedVector for source location zones. 2021-02-07 19:35:53 +01:00
Bartosz Taudul
0100d0beb4 SortedVector has to provide reserve(). 2021-02-07 19:35:23 +01:00
Bartosz Taudul
3323cc9612 Update NEWS. 2021-02-07 19:05:43 +01:00
Bartosz Taudul
99e68715c7 Include SIGABRT in crash handling. 2021-02-07 19:04:48 +01:00
Bartosz Taudul
c220177828 Do postponed work only when needed. 2021-02-07 18:29:29 +01:00
Bartosz Taudul
9bb1d13afa Revert to non-shared mutex for data lock.
The main change here is that the UI will be unresponsive when a trace is being
saved when there's no capture being performed. Note that the UI was always
frozen during saving if the capture was live, due to how starvation is
prevented by the locks.
2021-02-07 18:11:36 +01:00
Bartosz Taudul
417d526581 Use SortedVector for plot data. 2021-02-07 15:52:08 +01:00
Bartosz Taudul
90c873421c Implement main sorting functionality in SortedVector. 2021-02-07 15:50:27 +01:00
Bartosz Taudul
e2db68e5f0 Comment out unneeded (for now) methods in SortedVector. 2021-02-07 15:49:16 +01:00
Bartosz Taudul
dcd76fc369 Add pass-through sorted vector wrapper. 2021-02-07 14:43:05 +01:00
Bartosz Taudul
8732f0e94e Release 0.7.6. 2021-02-06 23:58:46 +01:00
Bartosz Taudul
d6fa6da0ed Add build automation script. 2021-02-06 23:57:14 +01:00
Bartosz Taudul
a35e936401 Update manual. 2021-02-06 23:12:16 +01:00
Bartosz Taudul
3400331de1 Check source file validity against executable time. 2021-02-06 22:59:07 +01:00
Bartosz Taudul
e577220e36 Update NEWS. 2021-02-04 00:48:59 +01:00
Bartosz Taudul
ad2062fb40 Last-resort source code transfer from client to server. 2021-02-04 00:45:00 +01:00
Bartosz Taudul
3376620919 Move server query acknowledgement to a separate function. 2021-02-04 00:03:58 +01:00
Bartosz Taudul
f97223e394 Rename ParamPingback to more generic AckServerQueryNoop. 2021-02-04 00:03:58 +01:00
Bartosz Taudul
253c3ae4c8 Android applications spawn through a common executable.
/proc/self/exe -> /system/bin/app_process64
2021-02-01 15:26:34 +01:00
Bartosz Taudul
53505373c7 Always show full symbol name in ghost zone popups. 2021-01-31 20:49:49 +01:00
Bartosz Taudul
f89fd4ab04 Executable path discovery on BSDs. 2021-01-31 20:27:32 +01:00
Bartosz Taudul
a795c21962 Get process executable path on macos. 2021-01-31 19:34:39 +01:00
Bartosz Taudul
468babe56a Update manual. 2021-01-31 19:15:23 +01:00
Bartosz Taudul
8a68d88242 Update NEWS. 2021-01-31 19:15:23 +01:00
Bartosz Taudul
ab4d7259ea Display GPU context name in options menu. 2021-01-31 19:15:23 +01:00
Bartosz Taudul
f068a1d31f Display GPU context name in thread track labels. 2021-01-31 19:15:23 +01:00
Bartosz Taudul
c4a6f3f980 Save/load GPU context names. 2021-01-31 19:15:23 +01:00
Bartosz Taudul
7bb6114270 Process GPU context name messages. 2021-01-31 19:15:23 +01:00
Bartosz Taudul
cd4114f264 Add GPU name transfer macros. 2021-01-31 19:15:23 +01:00
Bartosz Taudul
7f5810dfd6 Add GPU context name transfer to the protocol. 2021-01-31 18:46:42 +01:00
Bartosz Taudul
dba35cfa21 Remove trailing whitespaces. 2021-01-31 18:09:23 +01:00
Bartosz Taudul
6e46bc343e Update NEWS. 2021-01-31 17:59:15 +01:00
Bartosz Taudul
82a9c3b2c8 Display program build time. 2021-01-31 17:58:33 +01:00
Bartosz Taudul
3ff1692918 Add executable time accessor. 2021-01-31 17:51:55 +01:00
Bartosz Taudul
8d39f91c6e Save/load executable image mtime. 2021-01-31 17:51:16 +01:00
Bartosz Taudul
c92974d920 Send executable mtime in welcome message. 2021-01-31 17:45:31 +01:00
Bartosz Taudul
0ce113a96c Check mtime of profiled executable. 2021-01-31 17:45:31 +01:00
Bartosz Taudul
2890f24c97 Implement getting process executable path. 2021-01-31 17:37:54 +01:00
Bartosz Taudul
6c728f6d23 Cosmetics. 2021-01-31 17:24:41 +01:00
Bartosz Taudul
03e849a9ff Update NEWS. 2021-01-31 17:15:53 +01:00
Bartosz Taudul
8bacc7a91c Update libbacktrace to dedbe13fda. 2021-01-31 15:19:30 +01:00
Bartosz Taudul
a3bfbab6bd Fix timer setup for fallback timer. 2021-01-29 11:20:23 +01:00
Bartosz Taudul
224956abad
Merge pull request #171 from sideeffects/opencl-timing
Improve OpenCL time calibration
2021-01-28 19:03:44 +01:00
Bartosz Taudul
33ca38b581 Add a define for fallback timer usage. 2021-01-28 18:49:17 +01:00
Bartosz Taudul
b58358f81f Cosmetics. 2021-01-28 18:49:12 +01:00
John Lynch
f1a52cffa5 Remove host and device timestamp
members and accessors since they
are no longer needed.
2021-01-28 11:46:36 -06:00
Bartosz Taudul
6b276a1a64 Init rpmalloc thread-local data when sending messages.
There was a possibility of having uninitialized TLS block there, if the first
thing done in a thread was sending a message.
2021-01-27 02:14:23 +01:00
Bartosz Taudul
9892407ff0 Use system getopt in capture utility on unix.
This fixes header clash between getopt.h and unistd.h (required for unlink),
which prevented LTO on macos.
2021-01-27 00:32:38 +01:00
Bartosz Taudul
e3ae2c077f Arm macos uses arm64 as machine name. 2021-01-26 22:54:54 +01:00
Bartosz Taudul
9ae508218e Strip release binaries built with clang. 2021-01-26 22:52:08 +01:00
Bartosz Taudul
57ca6112b8 Enable Link Time Optimization on unix. 2021-01-26 22:43:50 +01:00
Bartosz Taudul
cf2208c3a8 Fix one missed makefile. 2021-01-26 22:27:27 +01:00
Bartosz Taudul
3f495f9cd7 Disable edit-and-continue in ToyPathTracer example. 2021-01-26 20:46:55 +01:00
Bartosz Taudul
c08d591bf3 Use proper capstone include path. 2021-01-26 20:35:57 +01:00
Bartosz Taudul
b0fe29e12f Remove all lingering references to 32-bit win32 builds. 2021-01-26 20:27:19 +01:00
Bartosz Taudul
046638a2b7 Update all sln files to MSVC 2019. 2021-01-26 20:24:47 +01:00
Bartosz Taudul
2b3405b9c7 Fix usage of deprecated stat64 on apple. 2021-01-26 20:09:34 +01:00
Bartosz Taudul
c8ea47782c ARM clang doesn't support -march=native. 2021-01-26 19:46:39 +01:00
Bartosz Taudul
62d6f4127d Don't pass -s parameter to clang. 2021-01-26 19:39:24 +01:00
John Lynch
9f55a5083c Improve OpenCL time calibration
by moving the host time retrieval
immediately after clWaitForEvents,
similar to the Vulkan approach.
2021-01-25 19:09:23 -06:00
Bartosz Taudul
81c91a87fc Search in cache before issuing syscall. 2021-01-26 01:47:00 +01:00
Bartosz Taudul
4a957ea41f Update manual. 2021-01-25 21:09:03 +01:00
Bartosz Taudul
ced17477fc Update manual. 2021-01-23 23:11:40 +01:00
Bartosz Taudul
f4186d51d4 Release 0.7.5. 2021-01-23 15:06:38 +01:00
Bartosz Taudul
a8057edba0 Update NEWS. 2021-01-22 22:30:45 +01:00
Bartosz Taudul
ccf441176b
Merge pull request #168 from jkriegshauser/improve-import
Improve chrome import
2021-01-22 14:57:52 +01:00
Bartosz Taudul
9d66abd679
Merge pull request #169 from sideeffects/opencl_fixes
Fixes for OpenCLCtxScope when not active
2021-01-22 13:01:03 +01:00
John Lynch
e7b3752cab Fixes for OpenCLCtxScope when !m_active.
Both setEvent and the destructor should
return immediately when !m_active, as the
scope is not properly initialized (m_beginQueryId
in particular.)
2021-01-22 01:16:11 -06:00
joshuakr
c96f01956d PR feedback: write the name into the tracy file 2021-01-21 18:33:59 -08:00
joshuakr
db83fc443f Adding a few things to ignore 2021-01-21 18:33:57 -08:00
Bartosz Taudul
20b2be3b77 Update second screenshot. 2021-01-22 02:54:01 +01:00
joshuakr
c5261e42ba Fix for macOS build 2021-01-21 17:41:55 -08:00
Bartosz Taudul
efc856f842 Fix vertical padding of items in CPU data table. 2021-01-22 02:34:01 +01:00
joshuakr
2920f97911 Imported Chrome traces bring over thread names 2021-01-21 17:26:00 -08:00
joshuakr
25a95d99c0 Imported chrome traces show the file name in the title bar 2021-01-21 17:25:53 -08:00
joshuakr
168e511de5 Revert "Fix shutdown hang (resolves #160)"
This reverts commit 315d25a787d88d6a7dbc8243f8150696476c9ae7.
2021-01-21 17:21:43 -08:00
Bartosz Taudul
239a17deb9 Fix typo. 2021-01-22 02:17:12 +01:00
Bartosz Taudul
e33f8e66d5 Set appropriate flags for CPU data table columns. 2021-01-21 23:26:32 +01:00
Bartosz Taudul
dee6395acf Update pdqsort.
978bc36a9b
2021-01-21 23:26:32 +01:00
Bartosz Taudul
0fc6ebc67d Another ImGuiTableColumnFlags_WidthAuto fix. 2021-01-21 23:26:32 +01:00
Bartosz Taudul
9f4efc8474 Update ImGui to 1.80 + docking. 2021-01-21 23:26:32 +01:00
Bartosz Taudul
5fc4eb2efa
Merge pull request #167 from sideeffects/master
Fix call to clRetainEvent inside assert in OpenCLCtxScope
2021-01-21 20:15:02 +01:00
John Lynch
9df369ecc4 Move call to clRetainEvent outside of assert within
OpenCLCtx::collect, ensuring it is still called when
NDEBUG is defined.
2021-01-21 12:27:26 -06:00
John Lynch
6c6c6caef0 In OpenCLCtxScope::SetEvent, the necessary clRetainEvent
call was inside an assert, thus never called if NDEBUG
was defined.  This change asserts only on the return value
of the function, as in other parts of the code.
2021-01-20 19:14:31 -06:00
Bartosz Taudul
2eae80b9dc
Merge pull request #166 from kubouch/fix-manual-typos
Fix description of csvexport manual entry
2021-01-17 15:55:47 +01:00
kubouch
baf6b5c637 Fix description of csvexport manual entry 2021-01-17 16:34:20 +02:00
Bartosz Taudul
e5dbca2d71
Merge pull request #165 from Xenonic/master
D3D12 transient zones
2021-01-16 14:00:17 +01:00
Andrew Depke
384617fba1 Update manual 2021-01-16 02:26:50 -07:00
Andrew Depke
3d75fb4d87 Update NEWS 2021-01-16 02:26:29 -07:00
Andrew Depke
694202ebcf Added transient D3D12 zones, fixed callstacks 2021-01-16 02:20:59 -07:00
Bartosz Taudul
538352d5a8 Update manual. 2021-01-15 22:11:34 +01:00
Bartosz Taudul
ca41db7b75 Update NEWS. 2021-01-15 22:11:34 +01:00
Bartosz Taudul
e5d54011d7 Add transient Vulkan zones. 2021-01-15 22:11:34 +01:00
Bartosz Taudul
483a621a0a Vulkan will now properly send serial callstacks. 2021-01-15 22:11:34 +01:00
Bartosz Taudul
a4764141c6 Support serial callstacks when processing GPU zones. 2021-01-15 22:11:34 +01:00
Bartosz Taudul
90de2d2f73 Support queuing serial items with callstack. 2021-01-15 22:11:34 +01:00
Bartosz Taudul
d4c0d4fbb7 Rename CallstackMemory to CallstackSerial. 2021-01-15 20:49:39 +01:00
Bartosz Taudul
c66b2cb536 Process allocated source location GPU zones. 2021-01-15 20:33:45 +01:00
Bartosz Taudul
d827832d4d Don't operate on short_ptr. 2021-01-15 20:25:07 +01:00
Bartosz Taudul
44020487d2 Keep zone begin implementations together. 2021-01-15 20:20:34 +01:00
Bartosz Taudul
5a8d30ddc3 Add transient OpenGL zones. 2021-01-15 20:13:09 +01:00
Bartosz Taudul
69372c2dcb Explicitly state which default-linked libraries are needed. 2021-01-13 01:42:48 +01:00
Bartosz Taudul
c381eeb5ab Bump year in LICENSE. 2021-01-08 19:34:11 +01:00
Bartosz Taudul
cc5c20db46 Bump ImGui. 2021-01-08 19:33:04 +01:00
joshuakr
315d25a787 Fix shutdown hang (resolves #160) 2021-01-05 13:07:49 -08:00
Bartosz Taudul
3d37c686cf Mark rprealloc as a part of Tracy API. 2020-12-27 14:11:45 +01:00
Bartosz Taudul
a467ef4c2b Expose rpmalloc init/finalize functions. 2020-12-26 14:57:54 +01:00
Bartosz Taudul
1a1df0229d Add missing include. 2020-12-26 14:48:31 +01:00
Bartosz Taudul
dab68b2f21 Manually initialize GUID structs. 2020-12-21 16:13:59 +01:00
Bartosz Taudul
063ad1f1d3 Check return value of EnableTraceEx2(). 2020-12-21 15:41:01 +01:00
Bartosz Taudul
993c631103 Update zstd to 1.4.7. 2020-12-18 15:46:27 +01:00
Bartosz Taudul
8f48d6e580 Add quick-start guide to the manual. 2020-12-16 15:53:04 +01:00
Bartosz Taudul
bffab2bc37 Update NEWS. 2020-12-16 15:35:30 +01:00
Bartosz Taudul
025ab1626b Bind only on IPv4, if restricted to localhost.
This is needed, as disabling the IPV6_V6ONLY socket option doesn't work for
localhost listeners on Windows.
2020-12-16 15:33:05 +01:00
Bartosz Taudul
2049332211 Broadcast to localhost if listening only on localhost. 2020-12-16 15:27:00 +01:00
Bartosz Taudul
6f83044cf6 Broadcast to the given address. 2020-12-16 15:24:20 +01:00
Bartosz Taudul
fd6d510051 Update NEWS. 2020-12-16 15:09:37 +01:00
Bartosz Taudul
6e715cf346 Use tables for callstack sample parents. 2020-12-16 15:05:35 +01:00
Bartosz Taudul
f1d48b1298 Use tables for call stack view. 2020-12-16 15:01:07 +01:00
Bartosz Taudul
325bcc035a Use tables to list memory entries. 2020-12-15 15:43:55 +01:00
Bartosz Taudul
6bb77d55a1 Use tables in CPU data view. 2020-12-09 21:53:36 +01:00
Bartosz Taudul
dc6893f419 Use tables for sampled statistics menu. 2020-12-09 21:36:53 +01:00
Bartosz Taudul
f14c0fe402 Update manual. 2020-12-09 21:22:39 +01:00
Bartosz Taudul
63e0170048 Find zones zone list fixes. 2020-12-09 21:18:40 +01:00
Bartosz Taudul
f1a641a838 Use tables for instrumented zones statistics. 2020-12-09 20:55:00 +01:00
Bartosz Taudul
6300f59183 Use tables in find zone zones list. 2020-12-09 02:18:06 +01:00
Bartosz Taudul
c437ecfcf5 Remove unneeded variable. 2020-12-08 19:55:20 +01:00
Bartosz Taudul
a0bae4aa00 Allow hiding columns in some tables. 2020-12-08 19:55:20 +01:00
Bartosz Taudul
b4860bbe4d Use tables in messages list. 2020-12-08 19:55:20 +01:00
Bartosz Taudul
45078cd99d Remove table row backgrounds. 2020-12-08 19:55:20 +01:00
Bartosz Taudul
18ac6ee548 Use tables for time distribution. 2020-12-08 19:55:19 +01:00
Bartosz Taudul
34683ceb4d Use tables in the failure callstack view. 2020-12-08 19:55:19 +01:00
Bartosz Taudul
a0bf2f5605 ImGui::BeginTable() is conditional. 2020-12-08 19:55:19 +01:00
Bartosz Taudul
9a0e7abefa Use proper identifier. 2020-12-08 19:55:19 +01:00
Bartosz Taudul
c23eb2f7fb Limit table size to 14 elements. 2020-12-08 19:55:19 +01:00
Bartosz Taudul
d962301124 Use tables for message list in zone info window. 2020-12-08 19:55:19 +01:00
Bartosz Taudul
99c4b9ef5f Use tables for wait regions. 2020-12-08 19:55:19 +01:00
Bartosz Taudul
a7cdffa736 Use tables for trace parameters. 2020-12-08 19:55:19 +01:00
Bartosz Taudul
48a3356f43 Update ImGui to master+tables+docking (dd4ca70). 2020-12-08 19:55:19 +01:00
Bartosz Taudul
0325f83e60
Merge pull request #147 from AWoloszyn/fix-free-offset
Fix switch for memory free.
2020-12-08 19:55:00 +01:00
AWoloszyn
064d264445 Fix switch for memory free.
Because of the layout difference between messageFat and
messageColorFat, this was referencing the text member
3-bytes offset from where it should have been.
2020-12-07 22:07:12 -05:00
Bartosz Taudul
9c3dac3ed2 Update NEWS. 2020-11-28 13:26:39 +01:00
Bartosz Taudul
3495a5a678 Print Arm machine code as a 4-byte number would be printed. 2020-11-28 13:24:56 +01:00
Ben Vanik
7dfdad2e02 Adding ZoneColor to set a dynamic color override to an existing zone. 2020-11-27 20:12:24 +01:00
bjacob
dfdf70aea3
Fix shutdown with TRACY_NO_EXIT=1 on Android. (#134) 2020-11-26 20:33:54 +01:00
Bartosz Taudul
0073fd739f Update manual. 2020-11-25 19:29:35 +01:00
Bartosz Taudul
d0acee2a9a Add missing default no-op to switch. 2020-11-23 22:58:40 +01:00
Bartosz Taudul
34e208368d Add missing include. 2020-11-23 22:58:12 +01:00
Bartosz Taudul
de69fc9850 Check if plot data values are finite numbers. 2020-11-23 22:48:55 +01:00
Bartosz Taudul
d8cb536712
Merge pull request #132 from bjacob/inline
Fixes following PR #129
2020-11-23 18:03:46 +01:00
Benoit Jacob
fc8ef12a78 fix condition in LookUpMapping, and some cosmetic fixes 2020-11-23 11:56:08 -05:00
Benoit Jacob
d787636804 remove some useless inline keywords 2020-11-22 09:49:46 -05:00
Bartosz Taudul
ab8e4e3408 Update AUTHORS. 2020-11-21 21:09:00 +01:00
Bartosz Taudul
809ffcc4bb Update NEWS. 2020-11-21 21:07:18 +01:00
bjacob
d05641d70c
Ensure that mappings have read permission before decoding symbols and reading code. (#129) 2020-11-21 21:05:39 +01:00
Bartosz Taudul
9facbe848c
Merge pull request #128 from philix/int_fixes
Fix integer type warnings
2020-11-19 17:17:08 +01:00
Felipe Oliveira Carvalho
c9865c5f95 Fix integer type warnings
This is necessary to compile Tracy-instrumented code in
codebases built with -Werror.
2020-11-19 16:36:01 +01:00
Bartosz Taudul
119e357dbf Improve parsing of kernel tracing data. 2020-11-19 11:37:05 +01:00
Bartosz Taudul
37c9a5807f Fix statistics image name filter clear button. 2020-11-18 01:30:28 +01:00
Bartosz Taudul
1bc7dfe013 Update NEWS. 2020-11-18 01:25:19 +01:00
Bartosz Taudul
53eacd3dc2 Add lost connection popup. 2020-11-18 01:24:22 +01:00
Bartosz Taudul
d98fbd60e5 Update NEWS. 2020-11-18 01:24:22 +01:00
Bartosz Taudul
78fd523a4b Don't print "connected to" after disconnection. 2020-11-18 01:24:22 +01:00
bjacob
3fe4e7c3a7
Fix sampling on Android with default su command. (#123) 2020-11-17 21:11:48 +01:00
Bartosz Taudul
278b58728c Wrap lz4 in tracy namespace, etc. 2020-11-16 18:13:19 +01:00
Bartosz Taudul
bae4c5f8df Update lz4 to 1.9.3, without tracy-specific changes. 2020-11-16 17:46:11 +01:00
Bartosz Taudul
e580dfeed3 Release 0.7.4. 2020-11-15 21:51:34 +01:00
Bartosz Taudul
7159069a74 Update NEWS. 2020-11-15 21:30:57 +01:00
Bartosz Taudul
63e3c236f4 Add Zen 3 to list of uarchs. 2020-11-15 21:29:59 +01:00
Bartosz Taudul
31e20cba68 Add Zen 3 uarch measurements. 2020-11-15 21:23:15 +01:00
Bartosz Taudul
b6ef32cadb Update manual. 2020-11-15 16:28:56 +01:00
Bartosz Taudul
157382f0f4 Update NEWS. 2020-11-15 16:17:26 +01:00
Bartosz Taudul
af4c9b7cdc Draw frame targets. 2020-11-15 16:16:36 +01:00
Bartosz Taudul
8a1d8e4bac Add frame target UI. 2020-11-15 15:46:23 +01:00
Bartosz Taudul
b0e69b2e9f Update manual. 2020-11-15 15:30:05 +01:00
Bartosz Taudul
5365e52888 Update NEWS. 2020-11-15 15:24:00 +01:00
Bartosz Taudul
09203905d6 Support memory pools in the C API. 2020-11-15 15:23:22 +01:00
Bartosz Taudul
1cb326ea15 Update NEWS. 2020-11-14 16:26:45 +01:00
Bartosz Taudul
81dcd2c767 Optional namespace shortening for ghost zones. 2020-11-14 16:23:35 +01:00
Bartosz Taudul
2ac7048248 Support source location dynamic colors for ghost zones. 2020-11-14 16:18:27 +01:00
Bartosz Taudul
9cbb57b193 Update NEWS. 2020-11-13 17:50:45 +01:00
Bartosz Taudul
0bb2c6bd8d Update manual. 2020-11-13 17:45:35 +01:00
Bartosz Taudul
2f77885fd9 Show if an matching microarchitecture is selected. 2020-11-13 17:37:53 +01:00
Bartosz Taudul
dcddf8898b Display memory usage also as a percentage. 2020-11-13 17:22:10 +01:00
Bartosz Taudul
2bf00b5eab Get available physical memory size in viewer. 2020-11-13 17:09:57 +01:00
Bartosz Taudul
0e50c9f6ea Update manual. 2020-11-13 13:13:11 +01:00
Bartosz Taudul
d7059eca63 Prepare for Zen 3.
0xA20F10 is Vermeer.
2020-11-07 00:26:45 +01:00
Bartosz Taudul
30b4eafa22 Add Zen 2 CPU ids.
0x860F81 is Lucienne.
0x890F00 is VanGogh.
2020-11-07 00:26:00 +01:00
Bartosz Taudul
b36e821cc7 Add cascade lake CPU ids. 2020-11-07 00:20:55 +01:00
Bartosz Taudul
612902f20d Update NEWS. 2020-11-07 00:16:39 +01:00
Bartosz Taudul
02c90db2e4 Display op description, if available. 2020-11-07 00:16:10 +01:00
Bartosz Taudul
322cc3bf12 Add missing op description list definition. 2020-11-07 00:15:58 +01:00
Bartosz Taudul
a5fd6662be Add CLX to list of uarchs. 2020-11-07 00:07:20 +01:00
Bartosz Taudul
c08d081f9a Update uops.info data to 05.11.2020. 2020-11-06 23:59:57 +01:00
Bartosz Taudul
da036bf322 Save asm op description. 2020-11-06 23:56:26 +01:00
Bartosz Taudul
c9352ce228 Check for more throughput values. 2020-11-06 23:43:47 +01:00
Bartosz Taudul
fcc0e22c0e Use more recent setup-msbuild action. 2020-11-06 01:29:35 +01:00
Bartosz Taudul
e5967bdc52 Fix context switch + samples offset logic. 2020-11-06 00:20:26 +01:00
Bartosz Taudul
c9f3898c1b Update NEWS. 2020-11-06 00:01:26 +01:00
Bartosz Taudul
e920b5cf64 Allow disabling call stack sampling.
Only on Windows for now.
2020-11-05 23:59:52 +01:00
Bartosz Taudul
4caaa325c2 Allow disabling context switch tracing.
Currently only on Windows.
2020-11-05 23:56:19 +01:00
Bartosz Taudul
a34abe646c Allow disabling vsync capture. 2020-11-05 23:44:28 +01:00
Bartosz Taudul
a48d540854 Cache statistics range-limited data. 2020-11-01 16:24:08 +01:00
Bartosz Taudul
87c3796e84 Fix division by zero if no sampling data is present. 2020-11-01 14:45:26 +01:00
Bartosz Taudul
76e2ae484b Update manual. 2020-10-30 18:30:38 +01:00
Bartosz Taudul
282dd94b6e Update NEWS. 2020-10-30 18:28:39 +01:00
Bartosz Taudul
7791654896 Allow copying callstack to clipboard. 2020-10-30 18:27:52 +01:00
Bartosz Taudul
8b4e03486d Remove trailing whitespace. 2020-10-29 23:06:28 +01:00
Bartosz Taudul
e2515c6a99 Remove pre-C++11 compat macros from concurrentqueue. 2020-10-29 23:05:24 +01:00
Bartosz Taudul
0c48956410 Fix parsing of source files that do not end in newline. 2020-10-28 21:43:03 +01:00
Bartosz Taudul
651cfd5c21 Now apple has to be stupid.
Remove this when they get their shit together with parallel execution.
2020-10-28 21:16:26 +01:00
Bartosz Taudul
dec59e16d2 Cosmetics. 2020-10-28 20:58:38 +01:00
Bartosz Taudul
86a57eee87 Update manual. 2020-10-28 20:54:18 +01:00
Bartosz Taudul
2da30a572b Update NEWS. 2020-10-28 20:06:17 +01:00
Bartosz Taudul
3d2ff4ffd1 Add support for user-provided dbghelp locks. 2020-10-28 20:04:37 +01:00
Bartosz Taudul
7e18540f9c Use proper tracy alloc wrappers in libbacktrace. 2020-10-22 22:26:55 +02:00
Bartosz Taudul
01e5c289b7 Add tracy_realloc() function. 2020-10-22 22:24:32 +02:00
Bartosz Taudul
4369224394 Update manual. 2020-10-21 23:25:05 +02:00
Bartosz Taudul
3976408550 Adapt to non-obsolete ImGuiListClipper interface. 2020-10-18 22:51:59 +02:00
Bartosz Taudul
b2c214595a Bump ImGui to 1.79 + docking. 2020-10-18 22:51:56 +02:00
Bartosz Taudul
cf1526b784 Add about dialog. 2020-10-18 22:51:53 +02:00
Bartosz Taudul
6a443bcd48 Mention pseudo-dynamic string management. 2020-10-18 22:51:49 +02:00
Bartosz Taudul
7e4f857784 Document tracking unstable pointers. 2020-10-07 18:21:04 +02:00
Bartosz Taudul
873ddfb605 Release 0.7.3. 2020-10-06 19:02:42 +02:00
Bartosz Taudul
a790c0e2f8 Update NEWS. 2020-10-06 18:51:07 +02:00
Bartosz Taudul
00c9dd24dc Use last range mode if no frames are available.
If during the first 5 seconds of the trace there are no frames being reported,
the profiler will switch to following last 5 seconds of the trace, instead of
displaying three last frames.
2020-10-06 18:46:36 +02:00
Bartosz Taudul
d75503047c Test whole call stack for non-canonical pointers. 2020-10-06 18:27:14 +02:00
Bartosz Taudul
f364c2cef3 Include OS in User Agent. 2020-10-06 17:31:58 +02:00
Bartosz Taudul
98e3822c88 C arrays are so much fun! 2020-10-06 14:58:42 +02:00
Bartosz Taudul
8adfd45453 Display failure callstack in capture utility. 2020-10-06 14:50:55 +02:00
Bartosz Taudul
c9b64ef5c5 Move list of Tracy stack frames to a separate file. 2020-10-06 14:37:39 +02:00
Bartosz Taudul
3b84324259
Merge pull request #92 from hulakdar/fix-sln
Added freetype references
2020-10-06 01:47:51 +02:00
Bartosz Taudul
e613c458dd Fix vertical alignment. 2020-10-06 01:38:40 +02:00
Bartosz Taudul
5af7f6ea0b Add memory pool selector to zone info window. 2020-10-06 01:32:03 +02:00
Bartosz Taudul
4394d396f5 Build release target by default. 2020-10-03 13:45:11 +02:00
Bartosz Taudul
fc1b03d67d Remove non-canonical pointer at the end of sampled stack. 2020-10-02 22:14:33 +02:00
Bartosz Taudul
07fe1266b0 Fix string iteration condition. 2020-10-02 19:31:42 +02:00
Bartosz Taudul
a2f0f7754d Fix integer types. 2020-10-02 19:30:01 +02:00
Bartosz Taudul
b98f6a138a Silence memset warning. 2020-10-02 18:56:04 +02:00
Bartosz Taudul
b6724bec3a Ports are uint16_t. 2020-10-02 18:51:54 +02:00
Bartosz Taudul
0d82d6fe63 Add missing htons() call. 2020-10-02 18:46:11 +02:00
Bartosz Taudul
4791b63ef8 Use int64_t for time. 2020-10-02 18:37:15 +02:00
Bartosz Taudul
8aae9a1477 Shut the compiler up about unused helper functions. 2020-10-02 18:33:13 +02:00
Bartosz Taudul
df4cd6df7d Update NEWS. 2020-10-02 18:29:55 +02:00
Bartosz Taudul
06a0d6d7e8
Merge pull request #115 from annacrombie/wayland_fix
Make Tracy run natively on Wayland
2020-10-02 11:44:05 +02:00
Stone Tickle
36e13668c0
mention TRACY_USE_WAYLAND in the manual 2020-10-02 11:00:52 +09:00
Stone Tickle
e2c5d37255
make wayland strictly on demand 2020-10-02 10:55:31 +09:00
Stone Tickle
b424bb4881
fix Wayland window transparency
https://github.com/glfw/glfw/issues/1434
2020-10-01 20:07:24 +09:00
Stone Tickle
a4f83c55a6
Add Wayland build option 2020-10-01 20:07:13 +09:00
Bartosz Taudul
a9a09ab094 Update NEWS. 2020-09-30 16:49:56 +02:00
Bartosz Taudul
a5e0336936 Add missing server query space updates to failure handling. 2020-09-30 16:48:59 +02:00
Bartosz Taudul
0d209b80f4 Show call stack in failure dialog. 2020-09-30 16:32:34 +02:00
Bartosz Taudul
9d392d2c90 Process call stack frames during failure dispatch. 2020-09-30 15:57:14 +02:00
Bartosz Taudul
641649143c Make symbol queries optional. 2020-09-30 15:49:29 +02:00
Bartosz Taudul
cecc3783a8 Handle single and second string data in failure dispatch. 2020-09-30 15:46:00 +02:00
Bartosz Taudul
3135191e90 Wait for failure callstack to be received. 2020-09-29 18:40:04 +02:00
Bartosz Taudul
d8e653ecb4 Set memory failure callstack. 2020-09-29 18:40:04 +02:00
Bartosz Taudul
98aaca9597 Default-initialize failure data struct. 2020-09-29 18:40:04 +02:00
Bartosz Taudul
1138307bd1 Use proper macro. 2020-09-29 18:15:24 +02:00
Bartosz Taudul
44aef7660d Don't keep two variables to track one thing. 2020-09-29 17:04:41 +02:00
Bartosz Taudul
d5b6befda2 Handle new callstack ordering on server. 2020-09-29 16:59:28 +02:00
Bartosz Taudul
bd31e3d2d6 Send callstacks before sending events they belong to. 2020-09-29 16:40:19 +02:00
Bartosz Taudul
8eb51aa01d Get LFQ item before capturing callstack.
This is to ensure that thread local structures have been properly
initialized (lock-free queue buffers are thread local), as capturing
callstack involves allocating memory from rpmalloc, which must be
initialized in each thread before allocation.
2020-09-29 15:10:55 +02:00
Bartosz Taudul
d530472045 No need to format string without formatting. 2020-09-27 20:56:37 +02:00
Bartosz Taudul
1d106097e3 Don't require GLFW 3.3. 2020-09-26 12:26:18 +02:00
Bartosz Taudul
e3d690df63 Cosmetics. 2020-09-25 18:10:22 +02:00
Bartosz Taudul
6398fdf29c Update manual. 2020-09-25 18:09:29 +02:00
Bartosz Taudul
4c3dce6712 Preserve separate memory tree state for each pool. 2020-09-25 17:55:43 +02:00
Bartosz Taudul
0fe65eb8a1 Update NEWS. 2020-09-25 17:52:16 +02:00
Bartosz Taudul
ae14e7a879 Expose custom memory pools in the UI. 2020-09-25 17:51:05 +02:00
Bartosz Taudul
d238c97452 Save/load custom memory types. 2020-09-25 16:39:00 +02:00
Bartosz Taudul
ba4315c286 Store memory name in MemData struct. 2020-09-25 16:36:03 +02:00
Bartosz Taudul
97e17a8d49 Support custom names for memory plots. 2020-09-24 01:31:24 +02:00
Bartosz Taudul
5a6c8b4696 Process named memory allocations. 2020-09-24 01:31:24 +02:00
Bartosz Taudul
e99534cad7 Recompress public facing PNG images. 2020-09-24 01:31:24 +02:00
Bartosz Taudul
a4922d482c Update manual. 2020-09-24 01:31:24 +02:00
Bartosz Taudul
5e97b301b1 Update manual. 2020-09-24 01:31:24 +02:00
Bartosz Taudul
24f25751ce Prevent move and copy of ScopedZone. 2020-09-24 01:31:24 +02:00
Bartosz Taudul
9f00bde629 Use 127.0.0.1 instead of localhost in capture.
This is to keep the default address uniform between tools. There was a
case where localhost wasn't resolving properly and a connection couldn't
be established.
2020-09-24 01:31:24 +02:00
Bartosz Taudul
751692eedd Don't track latest trace events if there's no connection. 2020-09-24 01:31:24 +02:00
Bartosz Taudul
d1ea97b474 Prepare for handling multiple memory areas. 2020-09-24 01:31:23 +02:00
Bartosz Taudul
46f0853f1b Process memory name payload transfer. 2020-09-24 01:31:23 +02:00
Bartosz Taudul
a9ce4f6454 Cosmetics. 2020-09-24 01:31:23 +02:00
Bartosz Taudul
4537276e98 Custom allocator test. 2020-09-24 01:31:23 +02:00
Bartosz Taudul
4db092437c Add support for custom allocator tracking to client. 2020-09-24 01:31:23 +02:00
Bartosz Taudul
4f382f75b5 Update manual. 2020-09-22 19:03:01 +02:00
Bartosz Taudul
86e18540a3 Update manual. 2020-09-21 02:08:35 +02:00
Bartosz Taudul
b537c33f6c Update NEWS. 2020-09-21 02:04:55 +02:00
Bartosz Taudul
a668b61320 Allow ignoring custom zone colors. 2020-09-21 02:04:13 +02:00
Bartosz Taudul
1a91acc661 Handle client disappearance broadcasts. 2020-09-20 22:40:38 +02:00
Bartosz Taudul
0a5de933c4 Don't assert on malformed broadcasts, just skip them. 2020-09-20 22:27:49 +02:00
Bartosz Taudul
c1a5ef4108 Reduce broadcast message size by 4 bytes.
Note that this is compatible with previous clients, which will never get
values 0 or 1 in the 32-bit integer that is now split between
broadcastVersion and listenPort.
2020-09-20 22:23:46 +02:00
Bartosz Taudul
593ce74042 Notify servers that client is no longer listening for connections.
This happens in these two cases:
- The client is exiting.
- A connection attempt is performed.

This message type is indicated by negative time value.
2020-09-20 22:20:33 +02:00
Bartosz Taudul
5c826c2723 Send signed active time in broadcast message.
This allows special treatment of negative values.
2020-09-20 22:15:10 +02:00
Bartosz Taudul
f9c1b63a3b Update NEWS. 2020-09-20 22:09:23 +02:00
Bartosz Taudul
6eaf0b06fd Process multiple broadcast messages in a single frame. 2020-09-20 22:08:34 +02:00
Bartosz Taudul
0814812e9b Don't block when polling for broadcast messages. 2020-09-20 22:06:28 +02:00
Bartosz Taudul
59a481451b Update manual. 2020-09-20 20:15:37 +02:00
Bartosz Taudul
fa2a554813 Update NEWS. 2020-09-20 20:12:29 +02:00
Bartosz Taudul
4a0926aa70 Early check if output is writable in capture utility. 2020-09-20 20:11:19 +02:00
Bartosz Taudul
a1916a7c6c Mark Usage() as a noreturn function. 2020-09-20 20:08:39 +02:00
Bartosz Taudul
7da17680ae Prevent overwriting existing files by the capture utility. 2020-09-20 20:04:43 +02:00
Bartosz Taudul
1e34b22a82 There's no QPC on non-windows systems. 2020-09-20 19:47:00 +02:00
Bartosz Taudul
5abd4c8ade Update NEWS. 2020-09-20 14:34:17 +02:00
Bartosz Taudul
4a33dcc1bc Support DPI scaling on Linux. 2020-09-20 14:33:42 +02:00
Bartosz Taudul
24c834bf8c Don't set sample_max_stack with kernel headers < 4.8. 2020-09-15 17:38:35 +02:00
Bartosz Taudul
b0c7a1f288
Merge pull request #108 from voysys/remove-unnecessary-defines
Remove unnecessary defines in tracy_concurrentqueue.h
2020-09-15 12:01:41 +02:00
Niclas Olmenius
607f988d1a Remove unnecessary defines in concurrentqueue
Remove defines related to exceptions in
`tracy_concurrentqueue.h` as they are not used anywhere
2020-09-15 11:41:39 +02:00
Bartosz Taudul
5490948567 Release 0.7.2. 2020-09-14 22:55:41 +02:00
Bartosz Taudul
c1d7778d48 Update NEWS. 2020-09-14 22:53:48 +02:00
Bartosz Taudul
f50c5d8ff4 Use domain name, not IP address for update checks. 2020-09-14 22:36:52 +02:00
Bartosz Taudul
a52888dbd5 Fix typo. 2020-09-12 16:03:08 +02:00
Bartosz Taudul
c782fcc29a Update manual. 2020-09-12 16:01:45 +02:00
Bartosz Taudul
0b297fd80c Update NEWS. 2020-09-12 15:53:25 +02:00
Bartosz Taudul
05f0ffd0ed Add "reconnect" button to connection failure dialogs. 2020-09-12 15:52:21 +02:00
Bartosz Taudul
812f869669 Decouple zoom level from tracking last events. 2020-09-12 15:49:41 +02:00
Bartosz Taudul
b000059430 Add a note about obsoleting bitbucket. 2020-09-12 13:44:38 +02:00
Bartosz Taudul
de8e5eb6e2 Add missing header. 2020-09-12 13:30:47 +02:00
Bartosz Taudul
6f009fa890 Display release notes for new releases. 2020-09-12 13:22:02 +02:00
Bartosz Taudul
80e0941520 Extract HTTP request functionality. 2020-09-12 12:46:00 +02:00
Bartosz Taudul
5e43ad84b9 Update NEWS. 2020-09-10 21:54:28 +02:00
Bartosz Taudul
990ad36ae5 Display update notification. 2020-09-10 21:53:03 +02:00
Bartosz Taudul
f5073e628d Receive up-to-date tracy version. 2020-09-10 21:53:03 +02:00
Bartosz Taudul
e2d69e7981 Implement reading unknown lengths of data from socket. 2020-09-10 21:39:58 +02:00
Bartosz Taudul
72ce3ccf15 Allow issuing blocking connect calls on sockets. 2020-09-10 20:56:24 +02:00
Bartosz Taudul
81dc6c216e Add version printer. 2020-09-10 20:38:22 +02:00
Bartosz Taudul
75ae14cd04 Use in-place merge to sort symbol data. 2020-09-07 01:47:11 +02:00
Bartosz Taudul
813e45198d Cygwin uses BSD sockets API. 2020-09-06 14:11:29 +02:00
Bartosz Taudul
4dae36cb73 Don't use EVENT_FILTER_EVENT_ID, etc with SDK < Win 8.1. 2020-09-06 14:02:18 +02:00
Bartosz Taudul
9e51e3fa85 Remove unused variable. 2020-09-06 14:02:12 +02:00
Bartosz Taudul
1d721e0de8 Update NEWS. 2020-09-06 13:57:20 +02:00
Bartosz Taudul
4b97528604 Streamline "waiting for connection" dialog. 2020-09-06 13:54:22 +02:00
Bartosz Taudul
3e34b3832a Fix https://github.com/ocornut/imgui/issues/3452 2020-09-03 18:19:58 +02:00
Bartosz Taudul
023c96fbc4 Be more explicit about source file view / symbol view split. 2020-09-02 23:43:17 +02:00
Bartosz Taudul
c243ac5c95 Edit and continue is not supported at all. 2020-08-28 23:03:39 +02:00
Bartosz Taudul
f3eabc28e2 Don't handle crashes, if there's no connection. 2020-08-28 17:21:52 +02:00
Bartosz Taudul
118a00d536
Merge pull request #101 from graydon/add-only-ipv4-flag
Add support for TRACY_ONLY_IPV4 macro to exclude listening on IPv6
2020-08-27 21:23:42 +02:00
Graydon Hoare
2ea81a3ef9
Make TRACY_ONLY_IPV4 and TRACY_ONLY_LOCALHOST also settable with runtime env vars. 2020-08-27 11:21:24 -07:00
Graydon Hoare
30a6a5cdd1
Add support for TRACY_ONLY_IPV4 macro to exclude listening on IPv6 2020-08-27 11:21:24 -07:00
Bartosz Taudul
b90d1cca5d Update manual. 2020-08-27 02:17:50 +02:00
Bartosz Taudul
b5f76f2cea Release 0.7.1. 2020-08-24 19:29:42 +02:00
Bartosz Taudul
980dcc4978 Update manual. 2020-08-24 18:47:55 +02:00
Bartosz Taudul
83a295c76d Update manual. 2020-08-21 14:27:43 +02:00
Bartosz Taudul
fe47e05c16 Update NEWS. 2020-08-21 14:23:49 +02:00
Bartosz Taudul
4ac0e7d955 Allow filtering sampling results by image name. 2020-08-21 14:23:23 +02:00
Bartosz Taudul
0f13a02062 Properly terminate symbol inline location data.
Previously there was no end value on which iteration would stop in case of
the last-in-the-process-space symbol, which resulted in out-of-bounds read.

Workaround has been added for versions < 0.7.2, but no version bump has been
performed (still at 0.7.1). Having two terminator values at the end of the
list is harmless.
2020-08-20 18:50:20 +02:00
Bartosz Taudul
944625b94b Update ImGui to 1.78 + docking. 2020-08-20 17:53:14 +02:00
Bartosz Taudul
960c7fb1b9 Don't alias struct names in client and server. 2020-08-20 17:38:29 +02:00
Bartosz Taudul
7cf3b0b004 Workaround issues with sample order. 2020-08-18 21:53:52 +02:00
Bartosz Taudul
411ca81786 Don't operate on reference. 2020-08-18 21:36:09 +02:00
Bartosz Taudul
818d20d273 Don't use image name as a replacement for source file.
Image name is now reported separately.
2020-08-18 20:34:11 +02:00
Bartosz Taudul
9ba7381030 Small speedup for ReadNumber(). 2020-08-18 20:07:15 +02:00
Bartosz Taudul
4d4b6c7ac9 Use memchr() to find newline in memory block. 2020-08-18 19:51:02 +02:00
Bartosz Taudul
48062573b8 Update manual. 2020-08-16 15:52:27 +02:00
Bartosz Taudul
35940f6f3d Update NEWS. 2020-08-16 15:52:27 +02:00
Bartosz Taudul
1536d6dfa9 Add transient zone macros. 2020-08-16 15:52:27 +02:00
Bartosz Taudul
c53a1f1dac Extend ScopedZone to allow allocated srcloc construction. 2020-08-16 15:52:27 +02:00
Bartosz Taudul
ddaa510553
Merge pull request #96 from hulakdar/fix-d3d12
Added define for non-profiling configurations
2020-08-16 12:13:11 +02:00
hulakdar
1ccf853b04 Added define for non-profiling configurations 2020-08-16 10:38:23 +03:00
Bartosz Taudul
8243604943 Mark SourceLocationData constexpr, not const. 2020-08-16 02:32:17 +02:00
Bartosz Taudul
8f720b55ff Update NEWS. 2020-08-16 01:42:09 +02:00
Bartosz Taudul
7e0033743d Update manual. 2020-08-16 01:41:43 +02:00
Bartosz Taudul
5239b706c3 Allow disabling code transfer. 2020-08-16 01:31:54 +02:00
Bartosz Taudul
89786f6e26 Update manual. 2020-08-16 00:07:33 +02:00
Bartosz Taudul
25c751c45a Add NativeWindow.hpp to MSVC project. 2020-08-15 17:15:36 +02:00
Bartosz Taudul
52039e80f2 Add native window retrieval on Linux.
Functionality had to be moved to a separate source file due to namespace
pollution from X11 headers.

Note that this doesn't set proper parent of file dialogs on Linux, as
GTK is broken and requires passing a GtkWindow parent.
2020-08-15 16:53:07 +02:00
Bartosz Taudul
046df82ccc Always set proper numeric locale. 2020-08-15 16:19:36 +02:00
Bartosz Taudul
28af5230d3 Perform OpenGL texture cleanup only on main thread. 2020-08-15 15:02:36 +02:00
Bartosz Taudul
a3d8b5d225 Allow running specific tasks on main thread. 2020-08-15 14:59:16 +02:00
Bartosz Taudul
518ce1e946 No need to store two same pointers. 2020-08-15 13:40:36 +02:00
Bartosz Taudul
28aae73f74 RingBuffer has const size, so use template.
This eliminates division.
2020-08-15 02:43:18 +02:00
Bartosz Taudul
caa1b1a792 Fix initialization list order. 2020-08-15 02:26:35 +02:00
Bartosz Taudul
f828fed015 Remove unused variables. 2020-08-15 02:23:04 +02:00
Bartosz Taudul
be0e3b9cc4 Silence memcpy/memset warnings. 2020-08-15 02:14:29 +02:00
Bartosz Taudul
5243bfe5a0 Add minimal vscode configuration. 2020-08-15 02:10:14 +02:00
Bartosz Taudul
95067dd88e
Merge pull request #94 from mcleary/add-gtk-dependency
Add GTK3 in the list of build requirements on Unix
2020-08-14 15:35:16 +02:00
Thales Sabino
c7707d1455 Update gcc.yml to install libgtk-3-dev 2020-08-14 14:10:39 +01:00
Thales Sabino
6e3f19d0c9 Update build requirement from GTK2 to GTK3 2020-08-14 14:05:00 +01:00
Thales Sabino
ad6c7c8986 Add GTK2.0 in the list of build requirements on Unix 2020-08-14 13:19:27 +01:00
Bartosz Taudul
91e262470e Update manual. 2020-08-14 13:34:57 +02:00
Bartosz Taudul
678548afd7 Update NEWS. 2020-08-14 13:30:12 +02:00
Bartosz Taudul
833653ce40 Display time stamp when hovering mouse over time scale. 2020-08-14 13:28:34 +02:00
Bartosz Taudul
5e559322a0 Properly check if symbol code is available. 2020-08-14 12:38:56 +02:00
Bartosz Taudul
aa72cb6ab9 Update manual. 2020-08-14 00:41:28 +02:00
hulakdar
6f333d15d7 added freetype references 2020-08-13 20:07:35 +03:00
Bartosz Taudul
16eef3f966 Clamp frame image textures to edge. 2020-08-13 18:16:10 +02:00
Bartosz Taudul
321c079205 Fix typo. 2020-08-13 16:56:56 +02:00
Bartosz Taudul
fa7d515165 Display base symbol address in symbol view window. 2020-08-13 16:36:13 +02:00
Bartosz Taudul
27bf6c17ef Update manual. 2020-08-13 16:32:39 +02:00
Bartosz Taudul
b6feb99e98 Show which symbols are available. 2020-08-13 16:24:09 +02:00
Bartosz Taudul
16ad6ee2ac Tune number of ETW kernel buffers. 2020-08-13 15:26:36 +02:00
Bartosz Taudul
6d5717e48b Update manual. 2020-08-13 14:01:32 +02:00
Bartosz Taudul
b6d54281a9 Ignore unknown source lines during ip stats gathering. 2020-08-13 00:34:55 +02:00
Bartosz Taudul
9258e2ced0 Restore TSC usage on Linux. 2020-08-13 01:41:05 +02:00
Bartosz Taudul
c0c9832713 Implement TSC conversion and caps checking in ring buffer. 2020-08-13 01:40:18 +02:00
Bartosz Taudul
5b4fa73e23 Remove obsolete CI script. 2020-08-13 00:44:54 +02:00
Bartosz Taudul
35f939165d Don't sleep in test application's fibonacci thread. 2020-08-12 23:55:49 +02:00
Bartosz Taudul
98fe63b5eb Increase sampling frequency to 10 kHz.
Works fine on bare metal.
2020-08-12 22:18:59 +02:00
Bartosz Taudul
8e9a701277 Fix crash when trying to open unavailable source file. 2020-08-12 19:05:16 +02:00
Bartosz Taudul
ce1c744de9 Update manual. 2020-08-12 18:50:54 +02:00
Bartosz Taudul
f7574c5adc Reduce ring buffer size to workaround sigbus on android. 2020-08-12 18:46:19 +02:00
Bartosz Taudul
195826f991 Update NEWS. 2020-08-12 16:57:46 +02:00
Bartosz Taudul
649994706b Use clock monotonic raw on Linux.
Because Linux kernel interfaces are fucking stupid.
2020-08-12 16:49:30 +02:00
Bartosz Taudul
d48b3187b1 Call stack sampling using perf events. 2020-08-12 16:49:30 +02:00
Bartosz Taudul
c16200ac02 Add ring buffer for perf events. 2020-08-12 14:06:19 +02:00
Bartosz Taudul
90ed18222a Use proper allocator. 2020-08-12 01:30:22 +02:00
Bartosz Taudul
b1b7be0a46 Adjust kernel tracing threads priorities. 2020-08-12 01:27:59 +02:00
Bartosz Taudul
1f4bfb68a0 Increase Linux sys trace per-cpu buffer size to 4 MB. 2020-08-12 01:19:10 +02:00
Bartosz Taudul
6db581ff4e Suppress warning. 2020-08-11 23:25:23 +02:00
Bartosz Taudul
9455c92712 Handle broken inet_ntop on old Windows SDKs. 2020-08-11 22:37:46 +02:00
Bartosz Taudul
ea9475dfdf Add Tracy's name to window title. 2020-08-11 21:07:28 +02:00
Bartosz Taudul
0aa77c9176 Update manual. 2020-08-11 21:07:28 +02:00
Bartosz Taudul
8cfc614047 Include time range limits in symbol view functions list. 2020-08-11 21:07:23 +02:00
Bartosz Taudul
46163a1989 Implement asm ip stats counter. 2020-08-11 21:07:23 +02:00
Bartosz Taudul
7aa8e408df Remove unused variable. 2020-08-11 16:02:07 +02:00
Bartosz Taudul
5974d00ccf Update manual. 2020-08-11 15:53:58 +02:00
Bartosz Taudul
34fa99c7ee Restrict sample statistics percentages to time range limit. 2020-08-11 15:50:54 +02:00
Bartosz Taudul
b9a810827d Make instrumented statistics percentages relative to time range. 2020-08-11 15:38:55 +02:00
Bartosz Taudul
5559cb0fde Update manual. 2020-08-11 13:49:46 +02:00
Bartosz Taudul
6d98740b39 Update manual. 2020-08-10 19:17:16 +02:00
Bartosz Taudul
e9255e5a0b Update NEWS. 2020-08-10 19:04:02 +02:00
Bartosz Taudul
6feb017cbe Also display statistics time range if symbol view is open. 2020-08-10 19:03:32 +02:00
Bartosz Taudul
b9b39f1957 Allow checking if source view is symbol view. 2020-08-10 19:03:23 +02:00
Bartosz Taudul
5dd7c7e402 Add time range limiting to symbol view. 2020-08-10 18:58:33 +02:00
Bartosz Taudul
7a4ecc5417 Store instruction pointers in per-symbol sample data. 2020-08-10 14:52:51 +02:00
Bartosz Taudul
85f54499fe Add range limit UI to symbol view. 2020-08-10 12:11:07 +02:00
Bartosz Taudul
900fbe5df8
Merge pull request #85 from kaiscode/fix-import
Fix timestamp calculation in chrome tracing importer
2020-08-10 12:05:03 +02:00
Bartosz Taudul
339ed7cc4d Fix tooltip stroboscope. 2020-08-09 21:40:06 +02:00
Bartosz Taudul
06ac6f4f24 Build per-symbol samples list during live capture. 2020-08-09 21:04:03 +02:00
Bartosz Taudul
3be0a3f628 Vector is not empty here. 2020-08-09 20:46:44 +02:00
Bartosz Taudul
1650d371e6 Actually set self time option, if required. 2020-08-07 19:43:31 +02:00
Bartosz Taudul
d6aa814de5 Use time limited data for inline stats. 2020-08-07 19:42:18 +02:00
Bartosz Taudul
d151aff237 Allow time limiting sampled call stacks statistics. 2020-08-07 19:26:19 +02:00
Bartosz Taudul
b418c98e63 Add symbol samples accessor. 2020-08-07 19:14:21 +02:00
Bartosz Taudul
aa8b60a824 Calculate per-symbol sample time list.
This is for loaded traces. Real time capture will be implemented later.
2020-08-07 19:05:27 +02:00
Bartosz Taudul
87e7cba289 Disable samples limit range until background job is done. 2020-08-07 14:54:00 +02:00
Bartosz Taudul
54651f9f6d
Merge pull request #86 from simonvanbernem/master
Making find- and stat-zones stripes interleave always by changing DrawStripedRect
2020-08-07 13:21:29 +02:00
Simon van Bernem
d06617b2a5 Fixed variable name 2020-08-07 10:55:00 +02:00
Simon van Bernem
4e1ed15237 More matching code-style 2020-08-07 10:45:52 +02:00
Simon van Bernem
ab85fba7e0 Matching the braketing style 2020-08-07 10:42:36 +02:00
Simon van Bernem
903b7badc0 next try 2020-08-07 10:39:22 +02:00
Simon van Bernem
e14bb56db1 matching spacing to remove change from original 2020-08-07 10:38:38 +02:00
Simon van Bernem
b826c14e4d reverted an unnecessary change 2020-08-07 10:37:19 +02:00
Simon van Bernem
3dd80c5288 DrawStripedRect can now draw screen-space stripes
Added two parameters to DrawStripedRect: fix_stripes_in_screen_space aligns the stripes to screen space. This leads to the stripes of any stripe rect being drawn aligning. Also added inverted, which flips the empty and filled part of the striped rect. This is used to make statRange and findZone stripes interleave, when they overlap.
2020-08-07 10:24:13 +02:00
Kais
83bc1466cf Fix timestamp calculation in chrome tracing importer 2020-08-06 19:42:03 -07:00
Bartosz Taudul
550e05d149 Fix time range limits created by reverse-mouse-drag. 2020-08-07 00:24:22 +02:00
Bartosz Taudul
e18e9411f3 Update manual. 2020-08-06 18:47:59 +02:00
Bartosz Taudul
d002841fb8 Update NEWS. 2020-08-06 17:27:09 +02:00
Bartosz Taudul
983aba7a0b Self time is forced for range limit in sampling stats. 2020-08-06 17:22:47 +02:00
Bartosz Taudul
0a0d04fff6 Add time range limits to instrumentation statistics. 2020-08-06 15:22:10 +02:00
Bartosz Taudul
b68423fc1a Fix copy pasta. 2020-08-06 15:22:10 +02:00
Bartosz Taudul
71440cc6ee Use custom data structure for temporary stats data. 2020-08-06 15:22:10 +02:00
Bartosz Taudul
251e8f1fe2 Fix vertical panning. 2020-08-05 17:20:19 +02:00
Bartosz Taudul
f07eebebf7 ETW threads are time critical. 2020-08-05 15:34:39 +02:00
Bartosz Taudul
fee89412ed Update manual. 2020-08-04 17:45:35 +02:00
Bartosz Taudul
73981d4ef3 TracyCSetThreadName() should be always available. 2020-08-04 17:39:36 +02:00
Bartosz Taudul
c4cf690e39 Display annotation extent on annotations list. 2020-08-04 17:31:33 +02:00
Bartosz Taudul
05c60259b6 Display exact time for annotation begin, end. 2020-08-04 17:26:00 +02:00
Bartosz Taudul
22e86af4ab Remove redundant tooltip. 2020-08-04 17:24:59 +02:00
Bartosz Taudul
a5c16a39ba Make annotations resizable. 2020-08-04 17:23:12 +02:00
Bartosz Taudul
f589fba274 Use Range for annotation extent. 2020-08-04 17:14:58 +02:00
Bartosz Taudul
2acc1d9670 Move Range, RangeSlim out of View. 2020-08-04 17:09:17 +02:00
Bartosz Taudul
68e452802b Allow performing range copies from one to another. 2020-08-04 17:06:24 +02:00
Bartosz Taudul
85e8a6a81c Add icons to range limits window entries. 2020-08-04 17:06:24 +02:00
Bartosz Taudul
67e86d2b27 Add context menus to ghost zones. 2020-08-04 17:06:24 +02:00
Bartosz Taudul
bd51add4f1 Display zone range popup area. 2020-08-04 17:06:24 +02:00
Bartosz Taudul
321fa06a3d Merge adding annotations and setting range limits. 2020-08-04 16:40:35 +02:00
Bartosz Taudul
79fc917483 Hook-up statistics time range logic. 2020-08-04 14:31:53 +02:00
Bartosz Taudul
7fe1560ca5 Change find zone limit range color to green. 2020-08-04 14:23:37 +02:00
Bartosz Taudul
1e526cfc09 Extract range entry drawing. 2020-08-04 14:20:35 +02:00
Bartosz Taudul
9449f3ef89 Add time range limit UI to statistics menu. 2020-08-04 14:15:28 +02:00
Bartosz Taudul
a23f58cc8f Add spacing in find zone menu. 2020-08-04 14:13:12 +02:00
Bartosz Taudul
ed01a3e4e0 Extract common filtering UI logic. 2020-08-04 14:09:59 +02:00
Bartosz Taudul
21589a238b Reduce size of statistics menu controls. 2020-08-04 14:06:32 +02:00
Bartosz Taudul
2a61c0a45f
Merge pull request #83 from voysys/add-set-thread-name-to-c-api
Add set thread name to C API
2020-08-04 11:54:56 +02:00
Niclas Olmenius
826affb0b5 add set thread to c api 2020-08-04 11:51:48 +02:00
Bartosz Taudul
2f94b44a6c Move filter UI to a separate line in statistics menu. 2020-08-03 17:08:47 +02:00
Bartosz Taudul
9b1573d803 Add limits button to find zone menu. 2020-08-03 16:07:38 +02:00
Bartosz Taudul
02aae23a98 Move limits button to tools submenu. 2020-08-03 16:07:28 +02:00
Bartosz Taudul
498781b5bf Clear potential click after mouse button is released. 2020-08-01 13:01:04 +02:00
Bartosz Taudul
734b0c25d9 Fix typo. 2020-08-01 12:55:49 +02:00
Bartosz Taudul
7d34350bf3 Drag delta (accumulated) shouldn't be consumed. 2020-08-01 12:36:52 +02:00
Bartosz Taudul
b33445c073 Open context menus without ctrl key. 2020-08-01 12:35:30 +02:00
Bartosz Taudul
b4021d7d79 Add mouse click vs drag logic. 2020-08-01 12:35:15 +02:00
Bartosz Taudul
4da8385300 Range overlay resize has priority over other mouse interactions. 2020-08-01 12:11:06 +02:00
Bartosz Taudul
22651eccc5 Implement consumption of mouse events. 2020-08-01 12:10:59 +02:00
Bartosz Taudul
6d0d12ce78 Remove unneeded parameter. 2020-08-01 12:03:11 +02:00
Bartosz Taudul
6836014caa Capture ImGui mouse state. 2020-08-01 12:02:11 +02:00
Bartosz Taudul
39197b9ff8 Use mouse wrappers. 2020-08-01 11:53:11 +02:00
Bartosz Taudul
733b9c4048 Add wrapper for ImGui mouse handling. 2020-08-01 11:49:43 +02:00
Bartosz Taudul
90e01a4888
Merge pull request #82 from jimblandy/ignore-so
Have git ignore Unix shared libraries.
2020-07-31 20:54:12 +02:00
Jim Blandy
c75b940816 Have git ignore Unix shared libraries. 2020-07-31 11:52:25 -07:00
Bartosz Taudul
1f2990f709
Merge pull request #81 from jimblandy/makefile-refactor
Factor out Unix build logic into shared files.
2020-07-31 20:26:54 +02:00
Jim Blandy
7bc8c6283a Factor out Unix build logic into shared files. 2020-07-31 11:08:36 -07:00
Bartosz Taudul
9d25f7fb71
Merge pull request #79 from jimblandy/build-fedora
Build fixes for Fedora
2020-07-31 18:53:10 +02:00
Jim Blandy
652582b119 Factor out makefile TBB detection, apply to all tools. 2020-07-31 09:14:12 -07:00
Bartosz Taudul
dbcc908dee Fix initialization. 2020-07-31 18:10:03 +02:00
Bartosz Taudul
19246a027f Allow limiting find zone time range to zone extent. 2020-07-31 18:01:07 +02:00
Bartosz Taudul
efc9c7c58f Add color key for find zone time range. 2020-07-31 17:57:54 +02:00
Bartosz Taudul
65e00eb2d4 Show time limit overlay if range window is open. 2020-07-31 17:54:46 +02:00
Bartosz Taudul
2bce9319d0 Allow focusing to find zone time range. 2020-07-31 17:51:47 +02:00
Bartosz Taudul
1215eb4de5 Allow limiting find zone time range to a frame. 2020-07-31 17:50:12 +02:00
Bartosz Taudul
8091207d26 Add time limit ranges window. 2020-07-31 16:37:47 +02:00
Bartosz Taudul
9633617810 Don't change time range limit when enabling it. 2020-07-31 16:19:35 +02:00
Jim Blandy
a12bf2d753 Fancier TBB (Threaded Building Blocks) detection.
Update documentation to mention that it's needed.
2020-07-30 18:24:42 -07:00
Bartosz Taudul
2682ae1af0 Add new apple devices. 2020-07-31 02:42:22 +02:00
Bartosz Taudul
a1ce31a226 Add some more ARM cpu ids. 2020-07-31 02:34:25 +02:00
Bartosz Taudul
be2ffb2023 Compile ARM CPU decoding functions only if used. 2020-07-31 01:51:31 +02:00
Bartosz Taudul
b696f1b466 GetHex() is only used on ARM linux. 2020-07-31 01:46:16 +02:00
Bartosz Taudul
6866d8f429 Update stb_image to 2.26. 2020-07-31 01:42:57 +02:00
Bartosz Taudul
2be3f1766f Use constexpr instead of enum. 2020-07-31 00:58:59 +02:00
Bartosz Taudul
d9cbc2d030
Merge pull request #80 from jimblandy/doc-size
Manual: Clarify meaning of `size` argument in strings.
2020-07-31 00:41:02 +02:00
Jim Blandy
d33fc26450 Manual: Clarify meaning of size argument in strings. 2020-07-30 15:31:52 -07:00
Bartosz Taudul
1cf6b630d2 Update manual. 2020-07-30 02:04:37 +02:00
Bartosz Taudul
0d2914bbe8 Display thumbnail of current frame image in connection popup. 2020-07-30 01:58:08 +02:00
Bartosz Taudul
f367b16dc0 Add missing operator. 2020-07-29 19:13:10 +02:00
Bartosz Taudul
7f90a0a84e Proper test for hovering mouse over the timeline. 2020-07-29 19:03:54 +02:00
Bartosz Taudul
e406ce5aab Fix typo. 2020-07-29 19:00:37 +02:00
Bartosz Taudul
5aff4b0f50 Set proper mouse cursor on range boundaries. 2020-07-29 18:54:10 +02:00
Bartosz Taudul
ab46a7a3a7 Update NEWS. 2020-07-29 18:50:35 +02:00
Bartosz Taudul
58428e7ede Dynamically adapt find zone results to range limit. 2020-07-29 18:48:49 +02:00
Bartosz Taudul
c1bf853310 Drag range boundary to change its span. 2020-07-29 18:42:53 +02:00
Bartosz Taudul
2f5f2e5b1d Add range boundary highlight. 2020-07-29 18:42:52 +02:00
Bartosz Taudul
ff5daf9df7 Proper handling of mouse over timeline view.
This fixes:
- Dead zones between header, frame sets and the rest of timeline
  display.
- One-frame frame set position lag when panning the view with mouse over
  zones region of timeline.
2020-07-29 17:52:51 +02:00
Bartosz Taudul
f37a324a9e Add annotation removal button hint. 2020-07-29 17:07:40 +02:00
Bartosz Taudul
29fe5f211f Warn when range limiting is enabled. 2020-07-29 15:45:50 +02:00
Bartosz Taudul
3e3f8aaabf Enable linear filtering for frame images. 2020-07-29 13:31:26 +02:00
Bartosz Taudul
25ee7f945b Draw limit region with striped rect. 2020-07-29 13:26:47 +02:00
Bartosz Taudul
d8728be689 Striped rect drawing. 2020-07-29 13:18:23 +02:00
Bartosz Taudul
fd5ccc16d6 Extract find zone range data to a separate struct. 2020-07-28 15:12:45 +02:00
Bartosz Taudul
7e6a41e647 No need for lean alloc srcloc zone begin messages. 2020-07-26 14:35:04 +02:00
Bartosz Taudul
062bb3044f No need for lean callstack sample message. 2020-07-26 14:28:13 +02:00
Bartosz Taudul
4252cac654 No need for lean callstack alloc message. 2020-07-26 14:25:32 +02:00
Bartosz Taudul
18713de70c No need for lean frame image message. 2020-07-26 14:23:04 +02:00
Bartosz Taudul
b76726c597 No need for lean callstack, callstack memory messages. 2020-07-26 14:23:03 +02:00
Bartosz Taudul
14a15bf152 Order of lock events is now always well-defined. 2020-07-26 13:54:40 +02:00
Bartosz Taudul
3e3aa80fa7 Completely serialize lock events. 2020-07-26 13:46:05 +02:00
Bartosz Taudul
b7af9a0860 Reduce frame images frame index to 32 bit. 2020-07-26 13:46:05 +02:00
Bartosz Taudul
ab468d8c57
Merge pull request #77 from kubouch/fix-opencl-macros
Fix args in OpenCL macros when !TRACY_ENABLE
2020-07-26 11:54:00 +02:00
Jakub Žádník
1ab1050c46 Fix args in OpenCL macros when !TRACY_ENABLE 2020-07-26 15:42:37 +03:00
Bartosz Taudul
03f46d7228 Custom string data is no longer needed. 2020-07-26 01:47:49 +02:00
Bartosz Taudul
c0b73c248f Add second single string transfer. 2020-07-26 01:47:49 +02:00
Bartosz Taudul
a7d2ab4d4f Send single string for lock name. 2020-07-26 01:47:49 +02:00
Bartosz Taudul
e91950f006 Send single string for messages. 2020-07-26 01:35:52 +02:00
Bartosz Taudul
5553761c02 Send single string for zone text and name. 2020-07-26 01:35:52 +02:00
Bartosz Taudul
309a151610 Symbol length no longer has to be packed. 2020-07-26 01:35:52 +02:00
Bartosz Taudul
88685440b6 Send single string for callstack frame. 2020-07-26 01:35:52 +02:00
Bartosz Taudul
61e3acde06 Send single string for callstack frame size. 2020-07-26 01:35:52 +02:00
Bartosz Taudul
e3dfa96055 Extract single string idx retrieval. 2020-07-26 01:35:52 +02:00
Bartosz Taudul
06ca4e2d16 Send single string for symbol information. 2020-07-26 01:35:52 +02:00
Bartosz Taudul
14b180cd16 Send single string for code information. 2020-07-26 01:35:51 +02:00
Bartosz Taudul
81d5a8db5e Implement transport of single string data.
In most cases only one string is sent per message and no pointer
tracking is needed.

This is only plumbing work, no changes to messages have been made yet.
2020-07-26 01:35:51 +02:00
Bartosz Taudul
7afdef3cdb Fix OpenGL example. 2020-07-25 18:17:34 +02:00
Bartosz Taudul
47ef56b995 Add csvexport to MSVC CI artifacts. 2020-07-24 21:37:03 +02:00
Bartosz Taudul
02e7893c75 Preserve messages size. 2020-07-21 20:58:58 +02:00
Bartosz Taudul
9d01fa86ab Preserve zone text, zone name string length. 2020-07-21 20:58:58 +02:00
Bartosz Taudul
986a2a79da Use proper size for spaceNeeded. 2020-07-21 20:58:58 +02:00
Bartosz Taudul
5d748f3568 Don't calculate known strings length. 2020-07-21 20:58:58 +02:00
Bartosz Taudul
e4fbf60668 Add SendString() with length parameter. 2020-07-21 20:58:58 +02:00
Bartosz Taudul
346e5a426f Mask out alpha channel on SSE and AVX2 paths. 2020-07-20 13:58:35 +02:00
Bartosz Taudul
6fe3736a23 When selecting function in symbol view, go to function location. 2020-07-19 23:43:52 +02:00
Bartosz Taudul
402bfd3ba4 Properly cleanup View. 2020-07-19 14:50:09 +02:00
Bartosz Taudul
aa2757526a Join loading thread on exit. 2020-07-19 14:39:50 +02:00
Bartosz Taudul
7b00812fa7 Add missing rpmalloc include. 2020-07-19 13:04:51 +02:00
Bartosz Taudul
6deffca23f Update NEWS. 2020-07-19 13:01:14 +02:00
Bartosz Taudul
2bef3629b7
Merge pull request #74 from avoroshilov/manual-lifetime
Manual lifetime management for Multi-DLL
2020-07-19 12:06:11 +02:00
Andrey Voroshilov
175ec3e3d8 Moving ThreadExitHandler to a commonly accessible space, adding thread handler usage to SysTrace worker threads 2020-07-18 18:24:49 -07:00
Andrey Voroshilov
416259fdb7 Adding clean run for the TRACY_MANUAL_LIFETIME testing target 2020-07-18 18:20:49 -07:00
Bartosz Taudul
29c249b33b Update manual. 2020-07-17 22:40:45 +02:00
Bartosz Taudul
6f47d837a4 Update NEWS. 2020-07-17 22:17:42 +02:00
Bartosz Taudul
0704ab8f79 Clear frame image back references when removing fi data. 2020-07-17 22:16:47 +02:00
Bartosz Taudul
cc63b6492f Allow stripping data from captures. 2020-07-17 22:06:15 +02:00
Bartosz Taudul
08c70cd6fe Use getopt in the update utility. 2020-07-17 21:47:51 +02:00
Bartosz Taudul
08172556fc Add note about GPU zone scope to the manual. 2020-07-17 13:13:54 +02:00
Bartosz Taudul
9ce46fdf2d Update manual. 2020-07-16 11:31:39 +02:00
Bartosz Taudul
d815b79db0 Add TracyIsConnected macro. 2020-07-16 11:31:39 +02:00
Bartosz Taudul
b8df7a1302 Expose m_isConnected in non-on-demand builds. 2020-07-16 11:22:06 +02:00
Bartosz Taudul
d614dbeda3 Show image name next to symbol name. 2020-07-14 17:23:04 +02:00
Andrey Voroshilov
47683d3b90 Added TRACY_MANUAL_LIFETIME test compile 2020-07-13 08:13:42 -07:00
Andrey Voroshilov
cbfb19816b Merge remote-tracking branch 'tracy/master' into manual-lifetime
# Conflicts:
#	AUTHORS
2020-07-13 01:49:11 -07:00
Andrey Voroshilov
bd5d965023 Updating manual and AUTHORS 2020-07-13 01:41:25 -07:00
Bartosz Taudul
1da51918b6 Append new messages to visible message list. 2020-07-13 02:03:00 +02:00
Andrey Voroshilov
4c397ebe1e Fixing some of the copy-paste errors 2020-07-12 10:12:50 -07:00
Andrey Voroshilov
3ae84647c4 Moving GetProfiler back to the original place 2020-07-12 10:10:09 -07:00
Andrey Voroshilov
a758de2f03 Moving GetProfiler back to the original place 2020-07-12 10:06:09 -07:00
Andrey Voroshilov
6b790d778d Replacing removing spinlock that is not needed anymore, making TRACY_MANUAL_LIFETIME a sub-option of TRACY_DELAYED_INIT, and addressing feedback 2020-07-12 10:04:07 -07:00
Bartosz Taudul
420bdd5854 Don't recalculate message list every frame. 2020-07-12 15:26:05 +02:00
Bartosz Taudul
29ac0169aa Use clipper to display messages list. 2020-07-12 15:13:03 +02:00
Bartosz Taudul
333e10c724 Move message line drawing to a separate function. 2020-07-12 15:07:43 +02:00
Bartosz Taudul
f2d6c79742 Don't wrap messages. 2020-07-12 15:00:56 +02:00
Bartosz Taudul
953df69b77 Build a list of messages to display. 2020-07-12 14:54:22 +02:00
Bartosz Taudul
125658a3eb Update manual. 2020-07-12 00:22:11 +02:00
Bartosz Taudul
863f37e1bc Remove dedicated "go to frame" button. 2020-07-12 00:18:44 +02:00
Bartosz Taudul
a7a36c08cb Fix frame number formatting. 2020-07-12 00:04:05 +02:00
Bartosz Taudul
0400967909 Update NEWS. 2020-07-11 16:28:20 +02:00
Bartosz Taudul
7b98d50e27
Merge pull request #66 from kubouch/csv-export
CSV export of zone statistics from .tracy file
2020-07-11 16:27:42 +02:00
kubouch
b8f9b24223 Add CI entries for csvexport 2020-07-11 15:56:48 +03:00
kubouch
be34e5076c Add Windows build for csvexport
Copy-pasted files from capture utility and adapted for csvexport
2020-07-11 15:48:08 +03:00
Bartosz Taudul
a72fde03f4 Update manual. 2020-07-11 14:13:15 +02:00
Bartosz Taudul
39debea990 Middle-click on time span sets the view range to entire capture. 2020-07-11 14:11:13 +02:00
kubouch
1f6d18efcd Fix getopt include for Windows build of capture 2020-07-11 15:10:47 +03:00
Bartosz Taudul
0f9597aee8 Display frame number, if there's space for it. 2020-07-11 14:05:08 +02:00
kubouch
d04de344fe Add AUTHORS entry for csvexport 2020-07-11 12:26:02 +03:00
kubouch
254fc9fc7a Add manual entry for csvexport 2020-07-11 12:26:01 +03:00
kubouch
38cf1b8a70 Switch from cxxopts to getopt for csvexport 2020-07-11 12:26:01 +03:00
kubouch
276e40ab2a Move getopt to root 2020-07-11 12:26:01 +03:00
kubouch
1fd1d3bd6b Add CSV export of basic zone statistics 2020-07-11 12:26:01 +03:00
Bartosz Taudul
0977952bde Update manual. 2020-07-09 00:21:21 +02:00
Bartosz Taudul
04bc3e47c5 Update NEWS. 2020-07-09 00:19:26 +02:00
Bartosz Taudul
587fd3a0bd
Merge pull request #70 from Xenonic/master
Implemented GPU synchronization for Direct3D 12
2020-07-09 00:18:12 +02:00
Andrew Depke
239e77db68 Updated manual 2020-07-08 16:10:19 -06:00
Andrew Depke
a75781beaf Fixed missing calibration flag 2020-07-08 16:04:12 -06:00
Andrew Depke
c768068ee7 Implemented GPU synchronization protocol 2020-07-08 15:42:42 -06:00
Andrey Voroshilov
4d505f507b Fixed rogue TAB indentation 2020-07-08 03:52:00 -07:00
Andrey Voroshilov
199dc46e7d Fixing crash on exit due to RP malloc not being deinitialized 2020-07-08 03:50:25 -07:00
Andrey Voroshilov
71ca0683d6 Fixing preprocessor formatting 2020-07-08 03:48:37 -07:00
Bartosz Taudul
660f2cec7f Update manual. 2020-07-07 21:40:56 +02:00
Bartosz Taudul
9bcf7a9214 Update NEWS. 2020-07-07 21:25:35 +02:00
Bartosz Taudul
e48b5611c5 Save GPU context calibration state. 2020-07-07 21:25:35 +02:00
Bartosz Taudul
a3c51f0e7e Don't show drift adjustment for calibrated GPU contexts. 2020-07-07 21:25:35 +02:00
Bartosz Taudul
21f4981f38 Process GPU calibration on server. 2020-07-07 21:25:35 +02:00
Bartosz Taudul
1b6bc1b69a Send Vulkan GPU calibration messages. 2020-07-07 21:25:35 +02:00
Bartosz Taudul
c91c6be763 Vulkan calibration function. 2020-07-07 21:25:35 +02:00
Bartosz Taudul
f6d320ebdc Detect time domains available for calibration. 2020-07-07 21:25:35 +02:00
Bartosz Taudul
dc91affdc5 Allow creating calibrated VK context. 2020-07-07 21:25:35 +02:00
Bartosz Taudul
5e5bf928a5 Add QPC frequency query to API. 2020-07-07 21:25:35 +02:00
Andrey Voroshilov
6a72560989 Fixing functions case to match the source capitalization rules 2020-07-07 03:12:02 -07:00
Andrey Voroshilov
da5e58682f Adding manual lifetime management to aid multi-DLL usecase 2020-07-07 00:39:09 -07:00
Bartosz Taudul
1013ec8db7 Drop accuracy bits from GPU context. 2020-07-07 01:21:36 +02:00
Bartosz Taudul
384e2e3fa1 Reduce memory requirements of allocated call stacks. 2020-07-05 17:33:29 +02:00
Bartosz Taudul
f718761905 Reduce allocated source location size by 2 bytes. 2020-07-05 17:11:15 +02:00
Bartosz Taudul
a15964b2dc Clarify manual language. 2020-07-05 12:15:41 +02:00
Bartosz Taudul
6fe90e136f Bump xxh3 to fix AVX512 problems. 2020-07-05 11:29:06 +02:00
Bartosz Taudul
08cd115db6 Update manual. 2020-07-04 12:46:27 +02:00
Bartosz Taudul
31aec8bea8 Update NEWS. 2020-07-04 12:36:37 +02:00
Bartosz Taudul
925bf7e638 Implement grouping zones by zone name. 2020-07-04 12:36:04 +02:00
Bartosz Taudul
1975c1897d Update manual. 2020-07-04 12:03:00 +02:00
Bartosz Taudul
605050f8e9 Update NEWS. 2020-07-04 12:00:02 +02:00
Bartosz Taudul
435fb4bb4f Add copy-to-clipboard buttons to zone info windows. 2020-07-04 11:59:25 +02:00
Bartosz Taudul
1bfd59c595 Add a wrapper function for drawing clipboard button. 2020-07-04 11:56:56 +02:00
Bartosz Taudul
4179e85029 Add missing parameters. 2020-07-02 17:17:01 +02:00
Bartosz Taudul
4881f7aa54 Bump ImGui to ~1.77. 2020-06-30 18:48:47 +02:00
Bartosz Taudul
7eb179b701 Update NEWS. 2020-06-30 00:54:35 +02:00
Bartosz Taudul
763f5aafdd Attach pending frame images only to the main frame set. 2020-06-30 00:53:26 +02:00
Bartosz Taudul
afbd6b8786 Fix frame histogram when changing frame set in trace info window. 2020-06-27 21:51:50 +02:00
Bartosz Taudul
78028deec6 Use modern distro.
Apparently "latest" is too hard to comprehend by some people, as it
points to 18.04 right now.
2020-06-27 20:37:59 +02:00
Bartosz Taudul
64bcf2893f Update manual. 2020-06-27 20:04:50 +02:00
Bartosz Taudul
d0b81c7c0b Update NEWS. 2020-06-27 19:57:02 +02:00
Bartosz Taudul
0da6342a86 Trace vsyncs. 2020-06-27 19:56:23 +02:00
Bartosz Taudul
1fff99ebb0 Fix memory leak. 2020-06-27 17:43:08 +02:00
Bartosz Taudul
c7d94a66b0 Bump xxh3 to 0.7.4. 2020-06-27 17:01:31 +02:00
Bartosz Taudul
e9788cc04c Bump robin_hood to 3.7.0. 2020-06-26 00:51:03 +02:00
Bartosz Taudul
97a5345f41 Include import-chrome in CI. 2020-06-24 02:08:03 +02:00
Bartosz Taudul
37ea159646 Update manual. 2020-06-24 01:54:51 +02:00
Bartosz Taudul
6bee23b056 Update AUTHORS. 2020-06-24 01:35:41 +02:00
Bartosz Taudul
c815259481 Update NEWS. 2020-06-24 01:34:43 +02:00
Bartosz Taudul
4bbeb51e34 Add secure alloc/free macros. 2020-06-24 01:33:26 +02:00
Bartosz Taudul
530e464347 Add checker for profiler availability. 2020-06-24 01:32:57 +02:00
Bartosz Taudul
cf8620b956 Cosmetics. 2020-06-24 01:14:55 +02:00
Bartosz Taudul
493d433330
Merge pull request #60 from nagisa/nagisa/dont-sigsegv-file
Check for null FILE handles in ReportTopology
2020-06-21 20:06:22 +02:00
Simonas Kazlauskas
b0d67064b5 Check for null FILE handles in ReportTopology
On Linux `/sys` is not guaranteed to exist. When it doesn't, tracy
would crash with a SIGSEGV due to a nullptr dereference. Not actually
sure how well tracy clients will handle the case where this information
is missing, though.
2020-06-21 20:14:05 +03:00
Bartosz Taudul
0fff0ac754
Merge pull request #58 from ethercrow/import-chrome-metrics
Import chrome metrics
2020-06-21 14:39:52 +02:00
Dmitry Ivanov
cfb11ff8c1 Check if plot data contains the earliest timestamp of the whole profile 2020-06-21 13:57:37 +02:00
Dmitry Ivanov
9fa80c2cc8 Import chrome metrics 2020-06-21 13:45:41 +02:00
Bartosz Taudul
5c12c575b2
Merge pull request #57 from travisdoor/master
Disable MSVC warnings for integrated client.
2020-06-20 23:05:43 +02:00
Martin Dorazil
7f2bc0d177 Disable MSVC warnings for integrated client. 2020-06-20 22:51:56 +02:00
Bartosz Taudul
b353eb753b
Merge pull request #56 from nagisa/nagisa/fix-macos-build
Fix build on macos
2020-06-20 19:57:09 +02:00
Bartosz Taudul
bdf2729845
Merge pull request #55 from nagisa/nagisa/tracy-sized-functions
`___tracy_alloc_*` take pointer-size pairs
2020-06-20 19:45:33 +02:00
Simonas Kazlauskas
b03da81afa Fix build on macos
It was broken by a110b420111ce02825fffaec29d08b5cc7b2168a.

In addition, adjust the CI definition to test builds on macOS.
2020-06-20 20:44:55 +03:00
Simonas Kazlauskas
29886435b4 ___tracy_alloc_* take pointer-size pairs
This enables better bindings in languages that do not have 0-terminated
strings for source/function name. It does not introduce any additional
overhead in languages that do use 0-terminated strings, either, but it
_is_ a breaking API change.

Fixes https://github.com/wolfpld/tracy/issues/53
2020-06-20 20:35:42 +03:00
Bartosz Taudul
d8466c5839 Fix typo. 2020-06-20 18:50:05 +02:00
Bartosz Taudul
f7727f3aa4 Workaround broken connect implementation. 2020-06-20 18:35:21 +02:00
Bartosz Taudul
5ccd62ced8
Merge pull request #52 from nagisa/nagisa/tracy-init-thread
Add ___tracy_init_thread function
2020-06-20 16:45:56 +02:00
Simonas Kazlauskas
6d74f4e8ff Extract manual changes into a separate section
The functions in the extracted section are mostly intended to be used
with bindings, so it made sense to give them their dedicated and
appropriately named section.
2020-06-20 17:32:35 +03:00
Bartosz Taudul
561664187a Update NEWS. 2020-06-20 15:30:31 +02:00
Bartosz Taudul
d1e17de7c2 Allow import of plots. 2020-06-20 15:30:06 +02:00
Simonas Kazlauskas
a110b42011 Add ___tracy_init_thread function
This function needs to be called for each non-main thread before calling
the `___tracy_alloc_` functions.

Alternative way to achieve this could be initializing the allocator
transparently in the `___tracy_alloc_*` calls.
2020-06-20 04:22:32 +03:00
Bartosz Taudul
25c7245566 Revert "Use pkg-config to link with TBB, but silence errors."
This reverts commit b4d6833231fea194f2d2912d29c8f2ca452f7178.

pkg-config setup for TBB is debian-specific.
2020-06-19 20:07:06 +02:00
Bartosz Taudul
5610bd0f8b Add information on how to build utilities. 2020-06-19 17:35:24 +02:00
Bartosz Taudul
2b5e45cd9b Fix edge case in directory structure creation. 2020-06-19 17:17:26 +02:00
Bartosz Taudul
b4d6833231 Use pkg-config to link with TBB, but silence errors. 2020-06-19 02:17:10 +02:00
Bartosz Taudul
11e1671048 Use proper string formatting. 2020-06-18 01:32:53 +02:00
Bartosz Taudul
a8c752e2ab Update NEWS. 2020-06-17 18:28:23 +02:00
Bartosz Taudul
b0d71b648f Allow listing cached source files. 2020-06-17 18:26:23 +02:00
Bartosz Taudul
c507507233 Fix gcc/clang. 2020-06-16 20:14:59 +02:00
Bartosz Taudul
47dfddedfd Use tzcnt instead of bsf. 2020-06-16 18:19:05 +02:00
Bartosz Taudul
7a6141389c Replace floating point condition with a bool. 2020-06-16 01:46:26 +02:00
Bartosz Taudul
dd05c8f524 Fix fixup of ghost zones end times. 2020-06-15 17:41:00 +02:00
Bartosz Taudul
71359c46c1 Drop support for loading pre-0.6.0 traces. 2020-06-14 15:52:52 +02:00
Bartosz Taudul
634b0933d1 Update manual. 2020-06-12 11:41:12 +02:00
Bartosz Taudul
9c1dd6d498 Make manual zone scope management more prominent. 2020-06-12 11:29:53 +02:00
Bartosz Taudul
21ddd0a820 Postpone initialization of hashmaps. 2020-06-12 11:26:44 +02:00
514 changed files with 317884 additions and 250459 deletions

View File

@ -1,27 +0,0 @@
version: '{build}'
platform:
- x64
image:
- Visual Studio 2019
- Ubuntu1804
install:
- cmd: cd c:\tools\vcpkg
- cmd: git pull
- cmd: bootstrap-vcpkg.bat
- cmd: vcpkg install freetype glfw3 capstone[core,arm,arm64,x86] --triplet x64-windows-static
- cmd: vcpkg integrate install
- cmd: cd %APPVEYOR_BUILD_FOLDER%
build_script:
- cmd: msbuild .\update\build\win32\update.vcxproj
- cmd: msbuild .\profiler\build\win32\Tracy.vcxproj
- cmd: msbuild .\capture\build\win32\capture.vcxproj
- cmd: msbuild .\library\win32\TracyProfiler.vcxproj /property:Configuration=Release
- sh: sudo apt-get update && sudo apt-get -y install libglfw3-dev libgtk2.0-dev libcapstone-dev
- sh: make -C update/build/unix debug release
- sh: make -C profiler/build/unix debug release
- sh: make -C capture/build/unix debug release
- sh: make -C library/unix debug release
- sh: make -C test
- sh: make -C test clean
- sh: make -C test TRACYFLAGS=-DTRACY_ON_DEMAND
test: off

18
.clang-format Normal file
View File

@ -0,0 +1,18 @@
# Empirical format config, based on observed style guide
# Use this only as an help to fit the surrounding code style - don't reformat whole files at once
---
BasedOnStyle: LLVM
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeBraces: Allman
BreakConstructorInitializers: BeforeComma
BreakStringLiterals: false
ColumnLimit: 120
FixNamespaceComments: false
IndentPPDirectives: AfterHash
IndentWidth: 4
PointerAlignment: Left
SpaceBeforeParens: Never
SpacesInParentheses: true
TabWidth: 4

61
.clang-tidy Normal file
View File

@ -0,0 +1,61 @@
---
Checks:
'
clang-diagnostic-*,
clang-analyzer-*,
bugprone-*,
google-*,
misc-*,
modernize-*,
performance-*,
readability-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-narrowing-conversions,
-bugprone-reserved-identifier,
-google-readability-braces-around-statements,
-google-readability-casting,
-google-readability-function-size,
-google-readability-todo,
-google-readability-namespace-comments,
-misc-confusable-identifiers,
-misc-no-recursion,
-modernize-avoid-c-arrays,
-modernize-deprecated-headers,
-modernize-use-default-member-init,
-modernize-use-trailing-return-type,
-performance-no-int-to-ptr,
-readability-braces-around-statements,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-qualified-auto,
-readability-uppercase-literal-suffix
'
WarningsAsErrors: ''
HeaderFilterRegex: ''
FormatStyle: none
CheckOptions:
llvm-else-after-return.WarnOnConditionVariables: 'false'
modernize-loop-convert.MinConfidence: reasonable
modernize-replace-auto-ptr.IncludeStyle: llvm
modernize-pass-by-value.IncludeStyle: llvm
google-readability-namespace-comments.ShortNamespaceLines: '10'
google-readability-namespace-comments.SpacesBeforeComments: '2'
cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: 'true'
google-readability-braces-around-statements.ShortStatementLines: '1'
cert-err33-c.CheckedFunctions: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;'
modernize-loop-convert.MaxCopySize: '16'
cert-dcl16-c.NewSuffixes: 'L;LL;LU;LLU'
cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField: 'false'
cert-str34-c.DiagnoseSignedUnsignedCharComparisons: 'false'
modernize-use-nullptr.NullMacros: 'NULL'
llvm-qualified-auto.AddConstToQualified: 'false'
modernize-loop-convert.NamingStyle: CamelCase
llvm-else-after-return.WarnOnUnfixable: 'false'
google-readability-function-size.StatementThreshold: '800'
...

BIN
.github/sponsor.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

83
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,83 @@
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
jobs:
build:
strategy:
matrix:
os: [ windows-latest, macos-15 ]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
- uses: actions/checkout@v4
- if: startsWith(matrix.os, 'windows')
uses: microsoft/setup-msbuild@v2
- if: startsWith(matrix.os, 'windows')
uses: actions/setup-python@v2
with:
python-version: '3.x'
- if: startsWith(matrix.os, 'windows')
run: pip install meson ninja
- if: startsWith(matrix.os, 'macos')
name: Install macos dependencies
run: brew install pkg-config glfw meson
- name: Trust git repo
run: git config --global --add safe.directory '*'
- name: Profiler GUI
run: |
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
cmake --build profiler/build --parallel --config Release
- name: Update utility
run: |
cmake -B update/build -S update -DCMAKE_BUILD_TYPE=Release
cmake --build update/build --parallel --config Release
- name: Capture utility
run: |
cmake -B capture/build -S capture -DCMAKE_BUILD_TYPE=Release
cmake --build capture/build --parallel --config Release
- name: Csvexport utility
run: |
cmake -B csvexport/build -S csvexport -DCMAKE_BUILD_TYPE=Release
cmake --build csvexport/build --parallel --config Release
- name: Import utilities
run: |
cmake -B import/build -S import -DCMAKE_BUILD_TYPE=Release
cmake --build import/build --parallel --config Release
- if: ${{ !startsWith(matrix.os, 'windows') }}
name: Library
run: meson setup -Dprefix=$GITHUB_WORKSPACE/bin/lib build && meson compile -C build && meson install -C build
- if: ${{ !startsWith(matrix.os, 'windows') }}
name: Find Artifacts
id: find_artifacts
run: |
mkdir -p bin
cp profiler/build/tracy-profiler bin
cp update/build/tracy-update bin
cp capture/build/tracy-capture bin
cp csvexport/build/tracy-csvexport bin
cp import/build/tracy-import-chrome bin
cp import/build/tracy-import-fuchsia bin
- if: startsWith(matrix.os, 'windows')
name: Find Artifacts
id: find_artifacts_windows
run: |
mkdir bin
copy profiler\build\Release\tracy-profiler.exe bin
copy update\build\Release\tracy-update.exe bin
copy capture\build\Release\tracy-capture.exe bin
copy csvexport\build\Release\tracy-csvexport.exe bin
copy import\build\Release\tracy-import-chrome.exe bin
copy import\build\Release\tracy-import-fuchsia.exe bin
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: bin

63
.github/workflows/emscripten.yml vendored Normal file
View File

@ -0,0 +1,63 @@
name: emscripten
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
jobs:
build:
runs-on: ubuntu-latest
container: archlinux:base-devel
steps:
- name: Install dependencies
run: pacman -Syu --noconfirm && pacman -S --noconfirm --needed cmake git unzip python ninja zstd
- name: Setup emscripten
uses: mymindstorm/setup-emsdk@v14
with:
version: 3.1.67
- name: Trust git repo
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- name: Profiler GUI
run: |
cmake -G Ninja -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=MinSizeRel -DGIT_REV=${{ github.sha }} -DCMAKE_TOOLCHAIN_FILE=${{env.EMSDK}}/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake
cmake --build profiler/build --parallel
- name: Compress artifacts
run: |
zstd -18 profiler/build/tracy-profiler.js profiler/build/tracy-profiler.wasm
gzip -9 profiler/build/tracy-profiler.js profiler/build/tracy-profiler.wasm
- name: Find Artifacts
id: find_artifacts
run: |
mkdir -p bin
cp profiler/build/index.html bin
cp profiler/build/favicon.svg bin
cp profiler/build/tracy-profiler.data bin
cp profiler/build/tracy-profiler.js.gz bin
cp profiler/build/tracy-profiler.js.zst bin
cp profiler/build/tracy-profiler.wasm.gz bin
cp profiler/build/tracy-profiler.wasm.zst bin
- uses: actions/upload-artifact@v4
with:
name: emscripten
path: bin
deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/download-artifact@v4
- uses: wlixcc/SFTP-Deploy-Action@v1.2.4
with:
username: ${{ secrets.USERNAME }}
server: ${{ secrets.SERVER }}
port: ${{ secrets.PORT }}
ssh_private_key: ${{ secrets.PRIVATE_KEY }}
local_path: './emscripten/*'
remote_path: ${{ secrets.REMOTE_PATH }}
sftp_only: true

View File

@ -1,30 +0,0 @@
name: gcc
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install libraries
run: sudo apt-get update && sudo apt-get -y install libglfw3-dev libgtk2.0-dev libcapstone-dev
- name: Profiler GUI
run: make -C profiler/build/unix debug release
- name: Update utility
run: make -C update/build/unix debug release
- name: Capture utility
run: make -C capture/build/unix debug release
- name: Library
run: make -C library/unix debug release
- name: Test application
run: |
make -C test
make -C test clean
make -C test TRACYFLAGS=-DTRACY_ON_DEMAND

View File

@ -12,17 +12,16 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Fix stupidity - name: Fix stupidity
run: | run: |
cp AUTHORS AUTHORS.
cp LICENSE LICENSE. cp LICENSE LICENSE.
- name: Compile LaTeX - name: Compile LaTeX
uses: xu-cheng/latex-action@v2 uses: xu-cheng/latex-action@v3
with: with:
working_directory: manual working_directory: manual
root_file: tracy.tex root_file: tracy.tex
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v4
with: with:
name: manual name: manual
path: manual/tracy.pdf path: manual/tracy.pdf

80
.github/workflows/linux.yml vendored Normal file
View File

@ -0,0 +1,80 @@
name: linux
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
jobs:
build:
runs-on: ubuntu-latest
container: archlinux:base-devel
steps:
- name: Install dependencies
run: pacman -Syu --noconfirm && pacman -S --noconfirm --needed freetype2 debuginfod wayland dbus libxkbcommon libglvnd meson cmake git wayland-protocols nodejs
- name: Trust git repo
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v4
- name: Profiler GUI
run: |
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
cmake --build profiler/build --parallel
- name: Update utility
run: |
cmake -B update/build -S update -DCMAKE_BUILD_TYPE=Release
cmake --build update/build --parallel
- name: Capture utility
run: |
cmake -B capture/build -S capture -DCMAKE_BUILD_TYPE=Release
cmake --build capture/build --parallel
- name: Csvexport utility
run: |
cmake -B csvexport/build -S csvexport -DCMAKE_BUILD_TYPE=Release
cmake --build csvexport/build --parallel
- name: Import utilities
run: |
cmake -B import/build -S import -DCMAKE_BUILD_TYPE=Release
cmake --build import/build --parallel
- name: Library
run: meson setup -Dprefix=$GITHUB_WORKSPACE/bin/lib build && meson compile -C build && meson install -C build
- name: Test application
run: |
# test compilation with different flags
# we clean the build folder to reset cached variables between runs
cmake -B test/build -S test -DCMAKE_BUILD_TYPE=Release
cmake --build test/build --parallel
rm -rf test/build
# same with TRACY_ON_DEMAND
cmake -B test/build -S test -DCMAKE_BUILD_TYPE=Release -DTRACY_ON_DEMAND=ON .
cmake --build test/build --parallel
rm -rf test/build
# same with TRACY_DELAYED_INIT TRACY_MANUAL_LIFETIME
cmake -B test/build -S test -DCMAKE_BUILD_TYPE=Release -DTRACY_DELAYED_INIT=ON -DTRACY_MANUAL_LIFETIME=ON .
cmake --build test/build --parallel
rm -rf test/build
# same with TRACY_DEMANGLE
cmake -B test/build -S test -DCMAKE_BUILD_TYPE=Release -DTRACY_DEMANGLE=ON .
cmake --build test/build --parallel
rm -rf test/build
- name: Find Artifacts
id: find_artifacts
run: |
mkdir -p bin
cp profiler/build/tracy-profiler bin
cp update/build/tracy-update bin
cp capture/build/tracy-capture bin
cp csvexport/build/tracy-csvexport bin
cp import/build/tracy-import-chrome bin
cp import/build/tracy-import-fuchsia bin
strip bin/tracy-*
- uses: actions/upload-artifact@v4
with:
name: arch-linux
path: bin

View File

@ -1,47 +0,0 @@
name: MSVC
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- uses: microsoft/setup-msbuild@v1.0.0
- name: Integrate vcpkg
run: vcpkg integrate install
- name: Build vcpkg libraries
run: vcpkg install freetype glfw3 capstone[arm,arm64,x86] --triplet x64-windows-static
- name: Profiler GUI Debug
run: msbuild .\profiler\build\win32\Tracy.vcxproj /property:Configuration=Debug /property:Platform=x64
- name: Profiler GUI Release
run: msbuild .\profiler\build\win32\Tracy.vcxproj /property:Configuration=Release /property:Platform=x64
- name: Update utility Debug
run: msbuild .\update\build\win32\update.vcxproj /property:Configuration=Debug /property:Platform=x64
- name: Update utility Release
run: msbuild .\update\build\win32\update.vcxproj /property:Configuration=Release /property:Platform=x64
- name: Capture utility Debug
run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Debug /property:Platform=x64
- name: Capture utility Release
run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Release /property:Platform=x64
- name: Library
run: msbuild .\library\win32\TracyProfiler.vcxproj /property:Configuration=Release /property:Platform=x64
- name: Package binaries
run: |
mkdir bin
mkdir bin\dev
copy profiler\build\win32\x64\Release\Tracy.exe bin
copy update\build\win32\x64\Release\update.exe bin
copy capture\build\win32\x64\Release\capture.exe bin
copy library\win32\x64\Release\TracyProfiler.dll bin\dev
copy library\win32\x64\Release\TracyProfiler.lib bin\dev
7z a Tracy.7z bin
- uses: actions/upload-artifact@v2
with:
path: Tracy.7z

25
.gitignore vendored
View File

@ -1,13 +1,12 @@
.vs .vs
*.opendb _build
*.db _compiler
*.vcxproj.user tools/*
x64
Release
Debug
*.d *.d
*.o *.o
*.so
*.swp *.swp
*.obj
imgui.ini imgui.ini
test/tracy_test test/tracy_test
test/tracy_test.exe test/tracy_test.exe
@ -20,10 +19,18 @@ manual/t*.synctex.gz
manual/t*.toc manual/t*.toc
manual/t*.bbl manual/t*.bbl
manual/t*.blg manual/t*.blg
manual/t*.fdb_latexmk
manual/t*.fls
profiler/build/win32/packages profiler/build/win32/packages
profiler/build/win32/Tracy.aps profiler/build/win32/Tracy.aps
# include the vcpkg install script but not the files it produces
vcpkg/*
!vcpkg/install_vcpkg_dependencies.bat
.deps/ .deps/
.dirstamp .dirstamp
/_*/**
/**/__pycache__/**
extra/vswhere.exe
extra/tracy-build
.cache
compile_commands.json
profiler/build/wasm/Tracy-release.*
profiler/build/wasm/Tracy-debug.*
profiler/build/wasm/embed.tracy

2
.mailmap Normal file
View File

@ -0,0 +1,2 @@
<wolf@nereid.pl> <wolf.pld@gmail.com>
<wolf@nereid.pl> <bartosz.taudul@game-lion.com>

7
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,7 @@
{
"recommendations": [
"llvm-vs-code-extensions.vscode-clangd",
"vadimcn.vscode-lldb",
"ms-vscode.cmake-tools"
]
}

13
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "lldb",
"request": "launch",
"program": "${command:cmake.launchTargetPath}",
"args": [],
"cwd": "${workspaceFolder}"
}
]
}

20
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,20 @@
{
"cmake.configureOnOpen": true,
"cmake.sourceDirectory": [
"${workspaceFolder}/profiler",
"${workspaceFolder}/capture",
"${workspaceFolder}/csvexport",
"${workspaceFolder}/import",
"${workspaceFolder}/update",
"${workspaceFolder}/test",
"${workspaceFolder}",
],
"cmake.buildDirectory": "${sourceDirectory}/build",
"cmake.autoSelectActiveFolder": false,
"cmake.options.advanced": {
"folder": { "statusBarVisibility": "visible" },
"variant": { "statusBarVisibility": "compact" }
},
"cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json",
"lldb.launch.initCommands": ["command script import ${workspaceRoot}/extra/natvis.py"],
}

11
AUTHORS
View File

@ -1,11 +0,0 @@
Bartosz Taudul <wolf.pld@gmail.com>
Kamil Klimek <kamil.klimek@sharkbits.com> (initial find zone implementation)
Bartosz Szreder <zgredder@gmail.com> (view/worker split)
Arvid Gerstmann <dev@arvid-g.de> (compatibility fixes)
Rokas Kupstys <rokups@zoho.com> (compatibility fixes, initial CI work, MingW support)
Till Rathmann <till.rathmann@gmx.de> (DLL support)
Sherief Farouk <sherief.personal@gmail.com> (compatibility fixes)
Dedmen Miller <dedmen@dedmen.de> (find zone bug fixes, improvements)
Michał Cichoń <michcic@gmail.com> (OSX call stack decoding backport)
Thales Sabino <thales@codeplay.com> (OpenCL support)
Andrew Depke <andrewdepke@gmail.com> (Direct3D 12 support)

271
CMakeLists.txt Normal file
View File

@ -0,0 +1,271 @@
cmake_minimum_required(VERSION 3.10)
# Run version helper script
include(cmake/version.cmake)
project(Tracy LANGUAGES CXX VERSION ${TRACY_VERSION_STRING})
file(GENERATE OUTPUT .gitignore CONTENT "*")
if(${BUILD_SHARED_LIBS})
set(DEFAULT_STATIC OFF)
else()
set(DEFAULT_STATIC ON)
endif()
option(TRACY_STATIC "Whether to build Tracy as a static library" ${DEFAULT_STATIC})
option(TRACY_Fortran "Build Fortran bindings" OFF)
option(TRACY_LTO "Enable Link-Time optimization" OFF)
if(TRACY_Fortran)
enable_language(Fortran)
set(CMAKE_Fortran_VERSION 2003)
endif()
if(TRACY_LTO OR CMAKE_INTERPROCEDURAL_OPTIMIZATION)
include(CheckIPOSupported)
check_ipo_supported(RESULT LTO_SUPPORTED)
if(NOT LTO_SUPPORTED)
message(WARNING "LTO is not supported!")
endif()
else()
set(LTO_SUPPORTED OFF)
endif()
find_package(Threads REQUIRED)
set(TRACY_PUBLIC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/public)
if(LTO_SUPPORTED)
set(TRACY_VISIBILITY "OBJECT")
elseif(TRACY_STATIC)
set(TRACY_VISIBILITY "STATIC")
else()
set(TRACY_VISIBILITY "SHARED")
endif()
add_library(TracyClient ${TRACY_VISIBILITY} "${TRACY_PUBLIC_DIR}/TracyClient.cpp")
target_compile_features(TracyClient PUBLIC cxx_std_11)
set_target_properties(TracyClient PROPERTIES INTERPROCEDURAL_OPTIMIZATION ${LTO_SUPPORTED})
target_include_directories(TracyClient SYSTEM PUBLIC
$<BUILD_INTERFACE:${TRACY_PUBLIC_DIR}>
$<INSTALL_INTERFACE:include>)
target_link_libraries(
TracyClient
PUBLIC
Threads::Threads
${CMAKE_DL_LIBS}
)
if(TRACY_Fortran)
add_library(TracyClientF90 ${TRACY_VISIBILITY} "${TRACY_PUBLIC_DIR}/TracyClient.F90")
target_include_directories(TracyClientF90 PUBLIC
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}>
$<INSTALL_INTERFACE:include>)
target_link_libraries(
TracyClientF90
PUBLIC
TracyClient
)
set_target_properties(TracyClientF90 PROPERTIES Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR}
INTERPROCEDURAL_OPTIMIZATION ${LTO_SUPPORTED})
endif()
# Public dependency on some libraries required when using Mingw
if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang")
target_link_libraries(TracyClient PUBLIC ws2_32 dbghelp)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
find_library(EXECINFO_LIBRARY NAMES execinfo REQUIRED)
target_link_libraries(TracyClient PUBLIC ${EXECINFO_LIBRARY})
endif()
if(TRACY_LIBUNWIND_BACKTRACE)
include(FindPkgConfig)
pkg_check_modules(unwind REQUIRED libunwind)
target_include_directories(TracyClient INTERFACE ${unwind_INCLUDE_DIRS})
target_link_libraries(TracyClient INTERFACE ${unwind_LINK_LIBRARIES})
endif()
if(TRACY_DEBUGINFOD)
include(FindPkgConfig)
pkg_check_modules(debuginfod REQUIRED libdebuginfod)
target_include_directories(TracyClient INTERFACE ${debuginfod_INCLUDE_DIRS})
target_link_libraries(TracyClient INTERFACE ${debuginfod_LINK_LIBRARIES})
endif()
add_library(Tracy::TracyClient ALIAS TracyClient)
if(TRACY_Fortran)
add_library(Tracy::TracyClient_Fortran ALIAS TracyClientF90)
endif()
macro(set_option option help value)
option(${option} ${help} ${value})
if(${option})
message(STATUS "${option}: ON")
target_compile_definitions(TracyClient PUBLIC ${option})
else()
message(STATUS "${option}: OFF")
endif()
endmacro()
set_option(TRACY_ENABLE "Enable profiling" ON)
set_option(TRACY_ON_DEMAND "On-demand profiling" OFF)
set_option(TRACY_CALLSTACK "Enforce callstack collection for tracy regions" OFF)
set_option(TRACY_NO_CALLSTACK "Disable all callstack related functionality" OFF)
set_option(TRACY_NO_CALLSTACK_INLINES "Disables the inline functions in callstacks" OFF)
set_option(TRACY_ONLY_LOCALHOST "Only listen on the localhost interface" OFF)
set_option(TRACY_NO_BROADCAST "Disable client discovery by broadcast to local network" OFF)
set_option(TRACY_ONLY_IPV4 "Tracy will only accept connections on IPv4 addresses (disable IPv6)" OFF)
set_option(TRACY_NO_CODE_TRANSFER "Disable collection of source code" OFF)
set_option(TRACY_NO_CONTEXT_SWITCH "Disable capture of context switches" OFF)
set_option(TRACY_NO_EXIT "Client executable does not exit until all profile data is sent to server" OFF)
set_option(TRACY_NO_SAMPLING "Disable call stack sampling" OFF)
set_option(TRACY_NO_VERIFY "Disable zone validation for C API" OFF)
set_option(TRACY_NO_VSYNC_CAPTURE "Disable capture of hardware Vsync events" OFF)
set_option(TRACY_NO_FRAME_IMAGE "Disable the frame image support and its thread" OFF)
set_option(TRACY_NO_SYSTEM_TRACING "Disable systrace sampling" OFF)
set_option(TRACY_PATCHABLE_NOPSLEDS "Enable nopsleds for efficient patching by system-level tools (e.g. rr)" OFF)
set_option(TRACY_DELAYED_INIT "Enable delayed initialization of the library (init on first call)" OFF)
set_option(TRACY_MANUAL_LIFETIME "Enable the manual lifetime management of the profile" OFF)
set_option(TRACY_FIBERS "Enable fibers support" OFF)
set_option(TRACY_NO_CRASH_HANDLER "Disable crash handling" OFF)
set_option(TRACY_TIMER_FALLBACK "Use lower resolution timers" OFF)
set_option(TRACY_LIBUNWIND_BACKTRACE "Use libunwind backtracing where supported" OFF)
set_option(TRACY_SYMBOL_OFFLINE_RESOLVE "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution" OFF)
set_option(TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation" OFF)
set_option(TRACY_DEBUGINFOD "Enable debuginfod support" OFF)
# advanced
set_option(TRACY_VERBOSE "[advanced] Verbose output from the profiler" OFF)
mark_as_advanced(TRACY_VERBOSE)
set_option(TRACY_DEMANGLE "[advanced] Don't use default demangling function - You'll need to provide your own" OFF)
mark_as_advanced(TRACY_DEMANGLE)
# handle incompatible combinations
if(TRACY_MANUAL_LIFETIME AND NOT TRACY_DELAYED_INIT)
message(FATAL_ERROR "TRACY_MANUAL_LIFETIME can not be activated with disabled TRACY_DELAYED_INIT")
endif()
if(NOT TRACY_STATIC)
target_compile_definitions(TracyClient PRIVATE TRACY_EXPORTS)
target_compile_definitions(TracyClient PUBLIC TRACY_IMPORTS)
endif()
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
set_target_properties(TracyClient PROPERTIES VERSION ${PROJECT_VERSION})
if(TRACY_Fortran)
set_target_properties(TracyClientF90 PROPERTIES VERSION ${PROJECT_VERSION})
endif()
set(tracy_includes
${TRACY_PUBLIC_DIR}/tracy/TracyC.h
${TRACY_PUBLIC_DIR}/tracy/Tracy.hpp
${TRACY_PUBLIC_DIR}/tracy/TracyD3D11.hpp
${TRACY_PUBLIC_DIR}/tracy/TracyD3D12.hpp
${TRACY_PUBLIC_DIR}/tracy/TracyLua.hpp
${TRACY_PUBLIC_DIR}/tracy/TracyOpenCL.hpp
${TRACY_PUBLIC_DIR}/tracy/TracyOpenGL.hpp
${TRACY_PUBLIC_DIR}/tracy/TracyVulkan.hpp)
set(client_includes
${TRACY_PUBLIC_DIR}/client/tracy_concurrentqueue.h
${TRACY_PUBLIC_DIR}/client/tracy_rpmalloc.hpp
${TRACY_PUBLIC_DIR}/client/tracy_SPSCQueue.h
${TRACY_PUBLIC_DIR}/client/TracyKCore.hpp
${TRACY_PUBLIC_DIR}/client/TracyArmCpuTable.hpp
${TRACY_PUBLIC_DIR}/client/TracyCallstack.h
${TRACY_PUBLIC_DIR}/client/TracyCallstack.hpp
${TRACY_PUBLIC_DIR}/client/TracyCpuid.hpp
${TRACY_PUBLIC_DIR}/client/TracyDebug.hpp
${TRACY_PUBLIC_DIR}/client/TracyDxt1.hpp
${TRACY_PUBLIC_DIR}/client/TracyFastVector.hpp
${TRACY_PUBLIC_DIR}/client/TracyLock.hpp
${TRACY_PUBLIC_DIR}/client/TracyProfiler.hpp
${TRACY_PUBLIC_DIR}/client/TracyRingBuffer.hpp
${TRACY_PUBLIC_DIR}/client/TracyScoped.hpp
${TRACY_PUBLIC_DIR}/client/TracyStringHelpers.hpp
${TRACY_PUBLIC_DIR}/client/TracySysPower.hpp
${TRACY_PUBLIC_DIR}/client/TracySysTime.hpp
${TRACY_PUBLIC_DIR}/client/TracySysTrace.hpp
${TRACY_PUBLIC_DIR}/client/TracyThread.hpp)
set(common_includes
${TRACY_PUBLIC_DIR}/common/tracy_lz4.hpp
${TRACY_PUBLIC_DIR}/common/tracy_lz4hc.hpp
${TRACY_PUBLIC_DIR}/common/TracyAlign.hpp
${TRACY_PUBLIC_DIR}/common/TracyAlloc.hpp
${TRACY_PUBLIC_DIR}/common/TracyApi.h
${TRACY_PUBLIC_DIR}/common/TracyColor.hpp
${TRACY_PUBLIC_DIR}/common/TracyForceInline.hpp
${TRACY_PUBLIC_DIR}/common/TracyMutex.hpp
${TRACY_PUBLIC_DIR}/common/TracyProtocol.hpp
${TRACY_PUBLIC_DIR}/common/TracyQueue.hpp
${TRACY_PUBLIC_DIR}/common/TracySocket.hpp
${TRACY_PUBLIC_DIR}/common/TracyStackFrames.hpp
${TRACY_PUBLIC_DIR}/common/TracySystem.hpp
${TRACY_PUBLIC_DIR}/common/TracyUwp.hpp
${TRACY_PUBLIC_DIR}/common/TracyYield.hpp)
install(TARGETS TracyClient
EXPORT TracyConfig
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib)
if(TRACY_Fortran)
install(TARGETS TracyClientF90
EXPORT TracyConfig
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT lib)
endif()
# Export targets to build tree root
export(TARGETS TracyClient
NAMESPACE Tracy::
FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake)
if(TRACY_Fortran)
export(TARGETS TracyClientF90
NAMESPACE Tracy::
APPEND
FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake)
endif()
install(FILES ${tracy_includes}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/tracy)
install(FILES ${client_includes}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/client)
install(FILES ${common_includes}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/common)
if(TRACY_Fortran)
if(${CMAKE_Fortran_COMPILER_ID} MATCHES "Cray")
install(FILES ${PROJECT_BINARY_DIR}/TRACY.mod
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy)
else()
install(FILES ${PROJECT_BINARY_DIR}/tracy.mod
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy)
endif()
endif()
install(EXPORT TracyConfig
NAMESPACE Tracy::
FILE TracyTargets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
option(TRACY_CLIENT_PYTHON "Whether to build Tracy python client library" OFF)
if(TRACY_CLIENT_PYTHON)
if(TRACY_STATIC)
message(FATAL_ERROR "Python-bindings require a shared client library")
endif()
add_subdirectory(python)
endif()

6
Config.cmake.in Normal file
View File

@ -0,0 +1,6 @@
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
find_dependency(Threads REQUIRED)
include("${CMAKE_CURRENT_LIST_DIR}/TracyTargets.cmake")

View File

@ -1,7 +1,7 @@
Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the
3-clause BSD license. 3-clause BSD license.
Copyright (c) 2017-2020, Bartosz Taudul <wolf.pld@gmail.com> Copyright (c) 2017-2025, Bartosz Taudul <wolf@nereid.pl>
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

748
NEWS
View File

@ -2,9 +2,740 @@ Note: There is no guarantee that version mismatched client and server will
be able to talk with each other. Network protocol breakages won't be listed be able to talk with each other. Network protocol breakages won't be listed
here. here.
Note: Release numbers are nothing more than numbers. There are some vx.xx.x (xxxx-xx-xx)
"missing" versions due to trace file changes during development. This is not --------------------
a mistake.
- Enabled workaround for MSVC runtime library SNAFU, which manifested with
the profiler executables crashing at startup inside mutex code.
- CPU topology data now includes CPU die information.
- Clients running under Wine will now report that in the trace info.
- Added flame graph.
- The Git ref information for the build is now included in the about dialog.
- Added support for clipboard copy and paste on Wayland.
- The welcome dialog client address entry field will now trim the entered
address, so that stray spaces at the start and the end are removed. This
should reduce the amount of user precision required when copy pasting the
address from somewhere else.
- Metal GPU profiling is now available.
- Profiling zones can now optionally inherit their parent color.
- It is no longer needed to have up-to-date copy of wayland-protocols
installed. CMake will download the required version from GitHub.
- Added option to show the top inline in symbol statistics list in stead of
the symbol name.
- Parallel sorting is now performed with PPQSort (which removes potential
dependency on TBB).
- Added CMake option TRACY_DEBUGINFOD to enable use of libdebuginfod to
retrieve symbols on Linux clients.
- Added a "custom" label as an option to select for GPU context type.
- Symbol code retrieval is now protected against reading no longer available
memory.
- Clicking on a symbol in the symbol statistics list will now open a popup
with two options. This change intends to make the useful but quite hidden
disassembly view more discoverable.
- "View symbol" shows the symbol code disassembly. It was previously
available by right-click on the source file name.
- "Sample entry stacks" shows the list window that was previously
opened when the symbol entry was clicked.
- Plots are now extended to the end of the trace, instead of ending at the
last data point.
- Added TracyMemoryDiscard macros to mark that all allocations made in a
certain memory pool were freed. This enables better support for arena
allocators.
- It is now possible to fine-tune horizontal and vertical mouse wheel scroll
sensitivity.
- Added p75 and p90 percentiles in the Find zone window.
- Zone info window will now display (approximate) wall-clock time of when
the zone appeared, in addition to the previously displayed time from the
start of the program.
- Zone values passed via ZoneValue macro will be now also displayed in hex.
- The csvexport utility can now export plots.
- Fortran integration is now available.
v0.11.1 (2024-08-22)
--------------------
- Utilities import-chrome and import-fuchsia now live together in the import
directory.
- Added TRACY_VERBOSE to available CMake options.
- It is now possible to set TRACY_SAMPLING_HZ via a environment variable.
- Thread group hints can be now used to group threads together in the
profiler UI.
- Limit Lua file names to 255 characters, as the source string can contain
the whole script, if loaded with loadstring().
v0.11.0 (2024-07-16)
--------------------
- Support for pre-0.9 traces has been dropped.
- The old server-side build system has been replaced by CMake. The client
integration is not affected. Refer to the manual for details.
- Most importantly, a known version of the capstone library is now
downloaded from GitHub. You will need to have git installed for this
to work (there is a CMake option to use the capstone installed on the
system, as was done previously).
- Various Meson fixes.
- Proper way of loading Vulkan calibrated timestamps extension.
- Fixed C API support for GPU tracing when on demand mode is enabled.
- Added a way to resynchronize CPU and GPU timestamps.
- Using calibrated contexts should always be preferred.
- Each synchronization event requires a sync of CPU and GPU, which is
something you always want to avoid.
- This is not exposed as an easy-to-use API available through the GPU
wrappers.
- Added TracyIsStarted macro to check if the profiler has been started.
Using this functionality only makes sense in the manual lifetime mode,
and will always return true in any other mode of operation.
- Added basic QNX support.
- Zmmword is now recognized as an assemble size directive.
- Libunwind can be used for call stack capture on Linux if you build with
the TRACY_LIBUNWIND_BACKTRACE define.
- Preloading symbols for all modules on Windows, which is always performed
on program init, and which can be quite slow, may now be omitted through
the TRACY_NO_DBGHELP_INIT_LOAD define. In this mode, symbols will be
loaded as needed.
- Validation of discontinuous frames has been disabled in on-demand mode.
It's quite likely to connect in the middle of a discontinuous frame,
which resulted in frame end event for a frame that hasn't been started.
- Symbols can be now resolved offline on Windows and Linux.
- Enabled with the TRACY_SYMBOL_OFFLINE_RESOLVE define or env variable.
- The update utility has two additional options:
- -r, which enables resolving symbol and patching stack frames in the
trace.
- -p, which you can use to modify the paths used for symbol resolution.
- Some functionality will be missing if this mode is used. For example,
symbol statistics are unavailable.
- Resolving symbol names on Linux will now use image cache to reduce the
number of dladdr() calls.
- Compiling with the TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT define will
enable support for run-time updating of known elf ranges in libbacktrace
on Linux. Previously, shared objects dlopened() after libbacktrace init
would not be visible during symbol resolution.
- Zone group count in the Find zone window is now explicitly displayed.
- Instrumentation statistics now display in how many threads each source
location has appeared in.
- Added import tool for fuchsia traces.
- https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format
- Added checks for overflow of source locations.
- As a reminder, Tracy only allows to have 64K unique source locations,
split in half between static and dynamic locations.
- Runtime checks are active during capture and will stop a trace that
goes beyond the limit.
- Load-time checks will stop any broken trace file from loading.
- Opening the source code view that has no associated address in code
(i.e., from the list of instrumented zones, or from the find zone
window) will now search the list of symbols for a function name match.
- In many cases this will result in displaying the full disassembly view
where previously you would only see the source code.
- Matching is performed by string comparisons, which in rare cases may
result in showing false data.
- Press ctrl key while opening source view to keep the old behavior.
- If more than one matching symbol is found (e.g., if two classes have
methods with the same name, or if a template is instantiated in multiple
places in code), it is not possible to tell which of the code locations
the source location corresponds to and only the source code will be
displayed.
- Added TracyNoop macro, which inserts a reference to Tracy's object file
into your application. Use it if you want to use Tracy in sampling mode,
without any manual instrumentation (so no references of your own exist)
and link Tracy as a static library. Linkers will only include library code
if code references it, and this doesn't work as intended with Tracy, as it
ignores global constructors that have side effects.
- ZoneText and ZoneName macros now have a printf-like variant, denoted with
a 'F' postfix.
- The 'tracy_shared_libs' Meson option was removed. Use interface provided
by Meson to set the library type instead.
- Dropped the 'tracy_' prefix from Meson options. The `tracy_enable` option
remains as it was, as it can be inherited from parent projects.
- Fixed display of active / inactive allocations in memory call tree.
- Instrumentation statistics can be now sorted by source location.
- Added option to hide external code frames in call stack view.
- There's now a copy to clipboard button in the statistics view. It copies
the visible rows of either the instrumentation or GPU statistics view to
a CSV string matching a subset of the csvexport format.
- Source file contents can be copied to the clipboard.
- Added key binding for immediate reconnect: Ctrl+Shift+Alt+R.
- Lock markup is now available through the C API.
- Symbol statistics window now allows aggregation of inlined functions in
symbols.
- Cost measurements of inlined functions in the symbol statistics window
can be now relative to the base symbol instead of total program run time.
- ScopedZone and AllocSourceLocation now accept color parameter. Impact on
existing code should be minimal.
- AllocSourceLocation has a new parameter with a default value.
- __tracy_alloc_srcloc and __tracy_alloc_srcloc_name break the existing
API. This can be easily fixed by setting the last parameter to zero.
- To build the profiler GUI with Wayland you now need wayland-scanner and
wayland-protocols to be installed. A reasonably recent release of the
protocols is required, which, as always, is not available on Ubuntu.
Seriously, stop trying to build modern software with that broken distro.
- Fractional DPI scaling is now properly supported on Wayland.
- Added Python bindings.
- The per-line sampling statistics are now also displayed as a percentage
of total program run time.
- The out-of-focus render frame rate reduction can be now disabled in
global settings.
- It is now possible to load source files that are newer than the trace.
The default setting is still to reject such files.
- Memory limit for a capture can be now set, both in the GUI profiler and
in the capture utility.
- Thread list can be now sorted alphabetically.
- It is now possible to adjust plot height.
- Trace comparison statistics were expanded and made more clear.
- Implemented retrieval of kernel symbol code on Linux.
- Added support for multiple compression streams in trace files. This
effectively parallelizes both load and save operations.
- The default save setup is now set to Zstd level 3 with 4 compression
streams. This gives both faster compression time and smaller file size.
- New users will be now eased into the profiler with a set of tutorial
achievements.
- You can now set the timeline options default values in global settings.
- Added a check for program memory being available before symbol retrieval
on Windows.
v0.10.0 (2023-10-16)
--------------------
- Missed frames region of on-demand captures will be now ignored when
calculating trace time span, zone percentages, etc.
- Due to technicalities information about locks, frame statistics in trace
information window and csvexport utility still include the missed frames
time.
- When source location dynamic zone coloring mode is enabled, collapsed
zones will be now gray-colored. Previously such regions falled back to
showing thread colors, which may have been confusing to users.
- Vulkan contexts can now use VK_EXT_host_query_reset extension.
- System power usage is now reported on x86 Linux.
- Program name displayed in broadcast messages can be now changed with the
TracySetProgramName() macro.
- Zone error markers (red regions and error bars) have been removed for
consistency with how all other profiling events are displayed.
- It is now possible to export messages in the csvexport utility.
- Major overhaul of how timeline items are processed in GUI.
- The process of figuring out what needs to be drawn on the timeline has
been heavily parallelized.
- The impact is especially visible with traces containing large amounts
of data. The framerate improvement in such cases can be ~30x.
- Consequently, the profiler GUI will now produce multi-core spikes when
rendering frames. This may have impact on the profiled application's
performance, if both the application and the profiler GUI are running
on the same machine. If this is a problem, you may consider the capture
utility instead, which is not affected by these changes. Alternatively,
you may disable parallelization in the options menu.
- Most of the timeline item logic has been written from scratch, which
may have taken care of some elusive bugs.
- Added global configuration settings dialog. You can find it in the
profiler's about menu (the wrench icon in the welcome dialog).
- List of found zones in the Find zone menu can be filtered by user text.
- Fixed div-by-zero in cvsexport utility when there was only one zone of
a kind.
- Fixed compatibility problems with FreeBSD.
- Added support for dynamically loaded Vulkan symbols.
- Trace description or filename is now displayed on the window title bar.
- The csvexport utility will now export thread id data.
- Improved compatibility with MSVC projects not defining NOMINMAX.
- Improved compatibility with Linux setups targeting musl as libc.
- Thread safety of Vulkan instrumentation has been reviewed.
- D3D11 and D3D12 instrumentation was rewritten.
- Added support for efficient profiling when running under rr, the record-
replaying debugger. This is enabled with TRACY_PATCHABLE_NOPSLEDS define.
- History of viewed symbols is now preserved and you can go back to
previously displayed entries.
v0.9.1 (2023-02-26)
-------------------
- Support for pre-0.8 traces has been dropped.
- Profiled programs will ignore dlclose() calls.
- Added warning when the profiler interface is run with privilege elevation.
Advice is given to instead run the client with admin rights.
- Switched to official ZEN4 uarch data.
- Handle cases when thread name is set, but not through Tracy facilities.
- Allow customization of source location data through the following macros:
- TracyFunction - defaults to __FUNCTION__
- TracyFile - defaults to __FILE__
- TracyLine - defaults to __LINE__
- Tracy on Linux now targets and requires Wayland by default.
- Please don't ask about window decorations on Gnome. Current behavior is
the intended behavior. Gnome does not want windows to have decorations,
and Tracy respects this choice. If you find this problematic, use a
desktop environment that actually listens to its users.
- Pass LEGACY=1 parameter to make, if you want to instead rely on the GLFW
library, like before.
- Other platforms still use GLFW.
- Compare traces menu can now display source code differences between two
traces.
- Assembly listings saved to files have been improved.
- Listings are now annotated with source line information.
- To improve compatibility with external tools comments are now prefixed
with '#' instead of ';'.
- Histogram tooltip will now also show left/right counts.
- Tracy now actively manages timeline vertical scroll offset in order to keep
the thread under the mouse cursor in the same place on screen.
- Removed support for AT&T assembly syntax.
- Tracy will not display notification if the file selector can't be used.
Possible reasons for failure include lack of xdg-desktop-portal.
- Using the TRACY_NO_CRASH_HANDLER define will disable handling of
application crashes by the profiler.
- Tracy will now query jump and call target addresses. This enables discovery
of target function names, even if such function has no samples and is not
present in any call stack.
v0.9.0 (2022-10-26)
-------------------
- Attention! All the header and source files used for integrating Tracy with
applications were moved to the public/ directory. This will break your
integration!
- To fix this, update the source and include directories lists to point to
the new location.
- Tracy include files directly referenced by the client were moved to
tracy/ subdirectory, to facilitate setups which previously had Tracy
checkout parent directory in the include paths list (i.e. when you
included "tracy/Tracy.hpp").
- Previously, if you have included the Tracy checkout directory in your
project include directories list (i.e. you could include "Tracy.hpp"),
this could result in third-party library conflicts, e.g. with ImGui.
Such scenarios are no longer the case.
- Tracy macros now require to be terminated with a semicolon.
- The undocumented ___tracy_demangle() function API has been changed. Please
refer to the source code for further instructions.
- The parameter callback and its registration macro have been extended to
include user data pointer. You will need to update your code accordingly.
- Plots visualization has been improved.
- Each plot now has its own color, which can also be defined by the user.
- The area below the plot is now optionally filled with a color.
- Plots can now also be configured to be staircase instead of smooth. This
new setting is appropriate for many inputs where only discrete values
make sense, e.g. the memory allocation plot.
- The API for TracyPlotConfig() macro has been changed. Please refer to
the manual to see how you can fix this.
- Some text labels in the user interface are now more easy to read.
- The profiler will now instruct the user in the UI on what can be done, if
the send queue is slow to process (typically due to symbol resolution).
- If a client with an incompatible protocol is discovered, Tracy will now
try to show which versions can be used to handle the connection.
- Messages list in zone info window can now show messages exclusive to the
zone, filtering out the messages emitted from child zones.
- Added capture of vertical synchronization timings on Linux.
- The range of frame bar colors in the frames overview on top of the screen
can be now controlled with the "Target FPS" entry box in the options menu.
- The "Draw frame targets" option does not need to be selected.
- Previously the hardcoded FPS target thresholds were: 30, 60, 144 FPS.
- Currently the FPS target threshold is: half of target, target, twice the
target.
- Reworked the way zone names are shortened.
- Previously shortening supported only namespace removal, in a way that
didn't consider function parameters or template arguments.
- Shortening to one-letter namespace chains is no longer available.
- The new shortening rules first perform normalization of the function name.
- The function const qualifier is removed.
- Common return types are removed.
- All function parameters and all template arguments are removed.
- The next steps consist of repeated removal of namespaces, starting with
the most outermost one.
- While the old process was all or nothing, the new implementation by
default will dynamically adjust to the space available, trying to show
the most context possible.
- It is also possible to completely disable shortening, or require that it
is always performed in full.
- Function name normalization is enabled by default, even if there is space
to show full function name. This can be changed in options.
- Previously shortening was only applied to the zone names displayed on the
timeline. Currently this process will also apply to all other places in
the UI where function names are displayed. However, in these cases the
function names will only be normalized.
- Full function names are still available as tooltips, or in fine print if
the normalized name is already displayed in a tooltip.
- This functionality is disabled if zone name shortening is disabled.
- Added context menu for timeline labels. Currently the only option is to hide
the selected thread, plot, etc.
- You can now provide custom source file contents through a profiler callback.
- Exposed Tracy version to client applications (available through the
common/TracyVersion.hpp header file).
- D3D12 instrumentation is now thread-safe.
- Timeline can be now navigated with WASD keys.
- Symbol file paths are now normalized on libbacktrace systems. For example,
instead of "/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../
include/c++/12.2.0/bits/std_mutex.h" Tracy will now report such file as
"/usr/include/c++/12.2.0/bits/std_mutex.h".
- The import-chrome utility interprets Instant (`i`/`I`) events where the
`name` field contains the word `frame` as a frame event. The `name` is the
frame set name.
- Frame data won't be displayed if there was no frame instrumentation in the
profiling session.
- Note that some automated functionality (e.g. vertical synchronization
capture) may automatically generate frame data, which will force frames to
be displayed.
- Tracy threads will now be collapsed by default on the timeline.
- Clicking on a local thread in the CPU data view will make the thread visible
and uncollapsed on the timeline.
- Assembly view is now in color.
- The profiler UI will no longer unnecessarily redraw the screen if nothing
was changed. This should have a profound impact on power usage.
- Added microarchitecture data for Zen 4.
- Implemented optional propagation of inline cost down the local call stack.
- This feature may be useful when trying to get a general outlook of the
cost at the top-level function in the symbol.
- It is possible to get nonsense data when this is enabled, for example
total cost exceeding 100%. This is by design.
- Assembly line costs are not affected.
- Available clients now also broadcast their PID.
- Reversed mouse button assignments for jumping to source / assembly line in
symbol view. The left mouse button will now focus the target line.
- Assembly lines tooltip will now display local call stack of inline functions
(within the symbol).
- Right-clicking the source location entry in assembly line will show the
local call stack, along with source code preview of each entry and ability
to navigate to any selected inline function.
- The profiler UI will now indicate that it needs attention if the window is
not focused and something interesting happens. For example when a connection
is established, or when a saved trace finishes loading, etc. How the
attention request is indicated depends on the operating system.
- Clicking on the red microarchitecture icon in the symbol view assembly pane
will switch the selected microarchitecture to one the profiled application
was running on.
- Removed option to display instruction latencies in a graphical form. Latency
data is still available in instruction tooltip.
v0.8.2 (2022-06-28)
-------------------
- Added support for debuginfod debug information services. Note that
since this depends on proper system configuration, vendors providing
the debug information, and network retrieval, it is disabled by
default. To enable, compile the profiled application with the
TRACY_DEBUGINFOD define and link with libdebuginfod.
- When Tracy server-side utilities are build with MSVC, the required
libraries will be now automatically retrieved and built with vcpkg.
- Added microarchitecture data for: Bonnell, Airmont, Goldmont, Goldmont
Plus, Tremont.
- Recognize additional CPUIDs of Zen 3, Alder Lake, Ice Lake
microarchitectures.
- Assembly line width will be now extended, if needed. Previously the line
width was calculated for the initial layout and changing amount of
displayed data (especially listing the read/written registers) didn't
affect this, which may have made some lines partially unreadable.
- Added ability to filter call stacks in memory tab by inactive allocations.
Filtering by inactive allocations helps to pinpoint wasteful allocations
in the program.
- Plot graph will no longer display min/max values interpolated for
animation, but rather true values.
- The CPU topology tree structure was replaced by a CPU schematic showing
the same thing in a more concise way.
v0.8.1 (2022-04-21)
-------------------
- Support for pre-0.7 traces has been dropped.
- Update utility can now scan for source files missing in the trace cache,
if the '-c' parameter is given. Found files will be added to the cache.
- Added high-priority queue for fast queries to bypass slow symbol queries.
- Fixed Android documentation to show how to enable context switch tracing.
- Workaround MSVC 2015 stupidity which prevented compilation as C++11.
- Added support for showing branch cost data for CPUs that don't report
branch retirement events (but do report branch misses).
- The right-click context menu available for jump arrows in the symbol view
window will now additionally display jump context, i.e. jump sources and
jump target source code fragments.
- Added freedesktop.org compliant desktop entry and MIME type definition.
- The call stack column in list of messages will now be only displayed when
at least one message on the list has call stack data.
- File dialogs on Unix will be now native to the desktop environment you are
using. Note that this relies on xdg-desktop-portal and dbus.
v0.8.0 (2022-03-28)
-------------------
- Support for Cygwin has been dropped. It was not working for a very long
time and nobody had complained about it.
- Mingw is deprecated due to lack of interest.
- Added TRACY_NO_CALLSTACK_INLINES macro to disable inline functions
resolution in call stacks on Windows.
- Improved function matching algorithm in compare traces view.
- Added CMake integration.
- Reworked rpmalloc initialization.
- Fixed display of messages with newlines on messages list.
- Excluded some uninteresting wrapper functions from call stacks (for
example SIMD pass-through intrinsics to the compiler built-ins).
- Adjusted coloring of instruction hotness in symbol view.
- Properly handle rare cases when sampling on Linux is momentary not able to
resolve time stamps.
- Added Rocket Lake microarchitectural data.
- Updated CPU identifier lists.
- Implemented GPU timer overflow handling heuristics.
- Assembly instructions are now assigned to inline symbols.
- You can not only see the assembly source file and line, but also the
originating function.
- If symbol view is restricted to a single inline function, all assembly
instructions not in this context will be dimmed out.
- Likewise, the navigation in assembly code will be limited just to the
inline context, if a single function is selected.
- Kernel call stacks will be now properly captured and displayed in the
profiler. Kernel functions are marked with the red color.
- The CPU hardware performance counters can be now sampled on Linux.
- Three inferred statistics are displayed for lines in both source and
assembly code in the symbol view window:
- Instructions executed per cycle.
- Branch miss rate.
- Cache miss rate.
- Instruction cost estimation method is no longer tied to software call
stack sampling.
- The image name filter entry field is now providing a list of available
images.
- Reentrant function calls may be now excluded from calculations in the
statistics view.
- Crash handler is now properly removed during profiler destruction.
- Repeatedly right-clicking on the same source line in the symbol view
window will now cycle through assembly blocks associated with this source
line.
- Vulkan headers must be now explicitly included before including
TracyVulkan.hpp.
- The capture utility may now limit capture time to a specified number of
seconds.
- Fixed message thread assignment in the import-chrome utility.
- Sampling data can be now also found in the find zone menu.
- Instrumentation failures may now display their context, e.g. the zone text
that was to be set.
- A warning is now displayed when sampling data is out-of-order.
- Average value for plots can be now viewed.
- Moved symbol resolution to a separate thread. Profiling will no longer be
stuck when there is a large number of symbols to resolve. This not only
improves user experience, but also prevents buildup of data (and memory
consumption) on the client side.
- Android device name will be now reported.
- Added support for capturing fibers.
- Fibers require additional processing, which has to be enabled by adding
the TRACY_FIBERS define on the client side.
- Client code requires additional instrumentation using the new macros
TracyFiberEnter and TracyFiberLeave (or the corresponding C API
variants).
- Fibers are represented in traces as separate threads, and are
distinguished by green color. Faux context switch regions are used to
indicate when a fiber is being run by the worker thread.
- Continuous frame marks no longer need to be issued from a single thread.
- Context switch call stacks are now captured on Windows and Linux.
- Hovering the context switch wait region will now display wait stack,
which may provide additional insight into why the switch happened.
- Wait stacks inspection can be performed in a new view.
- Stacks can be limited to certain threads and to a selected time range.
- Stacks are presented either as a sorted list, or as a bottom-up and
top-down trees.
- Entry call stacks can be now also viewed as a bottom-up and top-down
trees.
- Updated project build files to MSVC 2022.
- Call stack tooltips now also show the executable image name.
- Playback frames can be now changed by interacting with the frame image
slider using the mouse wheel.
- Signal used to handle crashes on Linux can be now redefined.
- Various DPI scaling improvements.
- User interface can be now scaled in run time.
- Symbol code retrieval now also supports kernel on Windows.
- Added low-level C API interface for GPU zones.
- Symbol child calls can be now listed.
- Replaced "restrict time" in memory window with a proper time range limit.
- Added Alder Lake microarchitectural data.
- Added GPU zone statistics.
- Universal Windows Platform support.
- All call stack related functionality can be now disabled with the
TRACY_NO_CALLSTACK macro.
- Added ability to add full-view annotations from the annotations list
window.
v0.7.8 (2021-05-19)
-------------------
- Updated Zen 3 and added Tiger Lake microarchitectural data.
- Manually disconnecting from the server will no longer display erroneous
warning message.
- Added ability to display sample time spent in child function calls.
- Fixed issue which may have prevented sampling on ARM64.
- Added TRACY_NO_FRAME_IMAGE macro to disable frame image compression
thread.
- Ctrl and shift keys will now modify mouse wheel zoom speed.
- Improved user experience in the symbol view window.
- Added support for Direct3D 11 instrumentation.
- Vulkan contexts can be now calibrated on Linux.
- Support loading zstd-compressed chrome traces.
- Chrome traces with multiple PID entries (and possibly conflicting TIDs)
can be now imported.
- Added support for custom source location tag ("loc") in chrome traces.
- Sampling frequency can be now controlled using TRACY_SAMPLING_HZ macro.
- Trace compression can be now selected when saving a trace.
- If a trace cannot be saved, a failure dialog will be displayed.
- Run-time memory usage of frame images can be reduced by calculating
a compression dictionary. This can be only performed when a trace is saved
or through the update utility.
v0.7.7 (2021-04-01)
-------------------
- Linux crash handler will now also catch SIGABRT.
- Fixed invalid name assignment to source files discovered client-side.
- Added ability to check if a zone is active (which may be used to avoid
preparing zone text, etc., as it wouldn't be used anyway).
- Improved sorting behavior of internal vectors.
- Some data will now be always properly displayed during live capture.
This was not particularly visible before, as it mainly concerns edge
cases.
- Sorting is performed only as needed.
- In case of plots the performance during live capture may be decreased,
as these were sorted with at least 0.25 second intervals before. Now
the sorting is performed every frame.
- Some other data, which previously was not sorted, is sorted now.
- In headless capture mode sorting will be only performed when the trace
is saved to disk.
- Fixed some typos in macros.
- Fixed handling of non-ANSI file names on Windows. You can now name your
traces 'ęśąćż.tracy' and it should work as intended. This is supported on
Windows 10 release 1903 and newer.
- Fixed sending GPU context name in on-demand mode.
- Fixed color channel order in ZoneColor() macro.
- Handle failure state when a memory pointer allocation is reported twice,
without an intermediate free.
- Renamed "call stack parents" to "entry call stacks".
- Display number of entry call stacks in assembly line sample count tooltip.
- Added tooltips with preview of source code in various places in the UI.
v0.7.6 (2021-02-06)
-------------------
- Various fixes in build scripts.
- Fixed a faulty rpmalloc initialization path when the first thing the
thread did was sending a message with call stack.
- Added fallback timer define for various virtualized environments, which
may not be able to access the hardware timer registers. This will result
in usage of timer provided by the standard library, with reduced
resolution.
- Further OpenCL improvements.
- Updated libbacktrace.
- Adds Mach-O 64-bit FAT support.
- Fixes memory corruption when processing Mach-O data.
- Fixes missing matching entries during binary search.
- Adds support for MiniDebugInfo.
- Adds fallback to ELF symbol table if no debug info is available.
- Various other fixes.
- Store build time of profiled program in captures.
- GPU contexts can be now named.
- Implemented client -> server source code transfer.
v0.7.5 (2021-01-23)
-------------------
- More robust handling of system tracing on Android.
- Added warning dialog when the connection is lost before all needed data
can be retrieved.
- Fixed handling of NaN plot entries (by skipping them).
- Dynamic zone colors are now supported through the ZoneColor() macro.
- Fixed Arm machine code printout to match the one printed by objdump.
- Fixed client memory corruption when using colored messages.
- Switched to the next-gen ImGui table UI.
- Table columns can have their order rearranged, can be hidden, can be
sorted both in ascending and descending order (where appropriate).
- Table columns state is now preserved between runs.
- Various fixes related to restricting listening to localhost.
- Improved compatibility of ETW tracing with non-MSVC compilers.
- Fixed Vulkan call stack transfer.
- Added support for transient GPU zones (OpenGL, Vulkan, Direct3D 12).
- OpenCL fixes for assert-less builds and non-active zones.
- Added support for thread names and title bar description in traces
imported from chrome tracing format.
v0.7.4 (2020-11-15)
-------------------
- Added support for user-provided locks to keep dbghelp calls thread-safe.
- Call stacks can be now copied to clipboard.
- Allow more control over which automated captures are performed.
- Added textual descriptions for some assembly instructions.
- Profiler memory usage is now also displayed as a percentage of available
physical memory.
- Microarchitecture mismatch is now clearly displayed in the source view
window.
- Added Zen 3 and Cascade Lake microarchitectural data.
- Ghost zones are now supporting all zone coloring modes and namespace
shortening.
- Extend C API to support memory pools.
- Frame rate targets can be now visually represented on the timeline view.
v0.7.3 (2020-10-06)
-------------------
- Properly support DPI scaling on Linux (requires GLFW 3.3).
- Added early checks for output file validity in the capture utility.
- Improvements to presence broadcast handling.
- Custom zone colors can be optionally ignored.
- Added support for tracking multiple memory pools.
- Memory free failure dialog can now show call stack pointing to the failure
location.
- Added support for Wayland on Linux.
- If during the first 5 seconds of the trace there are no frames being
reported, the profiler will switch to following last 5 seconds of the
trace, instead of displaying three last frames.
v0.7.2 (2020-09-14)
-------------------
- Note: the bitbucket repository is obsolete and will soon stop receiving
updates. Migrate to https://github.com/wolfpld/tracy, if you haven't
already.
- The "waiting for connection" dialog no longer has "cancel" button. To
abort connection attempt just use the "close window" button.
- Added update notification.
- The most recent traced events can be now viewed regardless of timeline
zoom level.
- Fixed going-to-line in source view (again).
- Crash handling on client is now not performed, if there is no active
connection.
- Added ability to listen only on IPv4 interfaces.
v0.7.1 (2020-08-24)
-------------------
- Dropped support for pre-v0.6 traces.
- Fixed regression on non-AVX2 CPUs.
- Fixed incorrect calculation of some ghost zones.
- Added list of cached source files.
- Added import of plot data.
- Secure versions of alloc/free macros.
- Automated tracing of vertical synchronization on Windows.
- Fixed attachment of postponed frame images.
- Source location data can be now copied to clipboard from zone info window.
- Zones in find zones menu can be now grouped by zone name.
- Vulkan and D3D12 GPU contexts can be now calibrated.
- Added CSV export utility.
- "Go to frame" popup no longer has a dedicated button. To show it, click on
the frame counter.
- Added macro for checking if profiler is connected.
- Implemented optional data removal from traces in the update utility.
- Allow manual management of profiler lifetime.
- Adjusted priority of ETW threads to time critical.
- Annotations can be now freely adjusted on the timeline.
- Limiting time range for find zone functionality has been significantly
improved.
- Added time range limits for statistics and symbol view.
- Implemented call stack sampling on Linux (including Android).
- Exact time from start of profiling session can be now viewed by hovering
the mouse over the time scale.
- Code transfer can be now compiled-out.
- Added support for zone markup in unloadable modules.
- Added image name filter to sampling statistics results window.
v0.7 (2020-06-11) v0.7 (2020-06-11)
----------------- -----------------
@ -67,6 +798,7 @@ update utility to convert your old traces now!
- OpenCL profiling. - OpenCL profiling.
- Direct3D 12 profiling. - Direct3D 12 profiling.
v0.6.3 (2020-02-13) v0.6.3 (2020-02-13)
------------------- -------------------
@ -87,6 +819,7 @@ v0.6.3 (2020-02-13)
- Frame images are now internally compressed using Zstd (instead of LZ4). - Frame images are now internally compressed using Zstd (instead of LZ4).
- Fix display of continuous frame set tooltips. - Fix display of continuous frame set tooltips.
v0.6.2 (2019-12-30) v0.6.2 (2019-12-30)
------------------- -------------------
@ -101,6 +834,7 @@ v0.6.2 (2019-12-30)
- Highlight hovered zone from find zone menu zone list on the histogram. - Highlight hovered zone from find zone menu zone list on the histogram.
- Allow copying user data directory location to the clipboard. - Allow copying user data directory location to the clipboard.
v0.6.1 (2019-11-28) v0.6.1 (2019-11-28)
------------------- -------------------
@ -112,6 +846,7 @@ v0.6.1 (2019-11-28)
- Client parameters may be now set from the server. - Client parameters may be now set from the server.
- Minor UI fixes. - Minor UI fixes.
v0.6 (2019-11-17) v0.6 (2019-11-17)
----------------- -----------------
@ -171,6 +906,7 @@ update utility to convert your old traces now!
- Implemented configuration of plots. - Implemented configuration of plots.
- Messages can now collect call stacks. - Messages can now collect call stacks.
v0.5 (2019-08-10) v0.5 (2019-08-10)
----------------- -----------------
@ -258,6 +994,7 @@ update utility to convert your old traces now!
- GPU drift value can be now automatically measured. - GPU drift value can be now automatically measured.
- Connection window is now a popup hidden under a dedicated button. - Connection window is now a popup hidden under a dedicated button.
v0.4.1 (2018-12-30) v0.4.1 (2018-12-30)
------------------- -------------------
@ -285,6 +1022,7 @@ v0.4.1 (2018-12-30)
- Pressing enter key after entering client address in the welcome dialog - Pressing enter key after entering client address in the welcome dialog
will now automatically begin connection process. will now automatically begin connection process.
v0.4 (2018-10-09) v0.4 (2018-10-09)
----------------- -----------------
@ -416,8 +1154,8 @@ v0.4 (2018-10-09)
- The capture utility will now display time span of the ongoing capture. - The capture utility will now display time span of the ongoing capture.
v0.3.3 (2018-07-03) v0.3 (2018-07-03)
------------------- -----------------
- Breaking change: the format of trace files has changed. - Breaking change: the format of trace files has changed.
- Previous tracy version will crash when trying to open new traces. - Previous tracy version will crash when trying to open new traces.

View File

@ -4,19 +4,25 @@
### A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications. ### A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.
Tracy supports profiling CPU (C, C++11, Lua), GPU (OpenGL, Vulkan, OpenCL, Direct3D 12), memory, locks, context switches, per-frame screenshots and more. Tracy supports profiling CPU (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](https://github.com/nagisa/rust_tracy_client), [Zig](https://github.com/tealsnow/zig-tracy), [C#](https://github.com/clibequilibrium/Tracy-CSharp), [OCaml](https://github.com/imandra-ai/ocaml-tracy), [Odin](https://github.com/oskarnp/odin-tracy), etc.), GPU (All major graphic APIs: OpenGL, Vulkan, Direct3D 11/12, Metal, OpenCL.), memory allocations, locks, context switches, automatically attribute screenshots to captured frames, and much more.
For usage **and build process** instructions, consult the user manual [at the following address](https://github.com/wolfpld/tracy/releases). - [Documentation](https://github.com/wolfpld/tracy/releases/latest/download/tracy.pdf) for usage and build process instructions
- [Releases](https://github.com/wolfpld/tracy/releases) containing the documentation (`tracy.pdf`) and compiled Windows x64 binaries (`Tracy-<version>.7z`) as assets
- [Changelog](NEWS)
- [Interactive demo](https://tracy.nereid.pl/)
![](doc/profiler.png) ![](doc/profiler.png)
![](doc/profiler2.png) ![](doc/profiler2.png)
[Changelog](NEWS) ![](doc/profiler3.png)
[An Introduction to Tracy Profiler in C++ - Marcos Slomp - CppCon 2023](https://youtu.be/ghXk3Bk5F2U?t=37)
[Introduction to Tracy Profiler v0.2](https://www.youtube.com/watch?v=fB5B46lbapc) [Introduction to Tracy Profiler v0.2](https://www.youtube.com/watch?v=fB5B46lbapc)
[New features in Tracy Profiler v0.3](https://www.youtube.com/watch?v=3SXpDpDh2Uo) [New features in Tracy Profiler v0.3](https://www.youtube.com/watch?v=3SXpDpDh2Uo)
[New features in Tracy Profiler v0.4](https://www.youtube.com/watch?v=eAkgkaO8B9o) [New features in Tracy Profiler v0.4](https://www.youtube.com/watch?v=eAkgkaO8B9o)
[New features in Tracy Profiler v0.5](https://www.youtube.com/watch?v=P6E7qLMmzTQ) [New features in Tracy Profiler v0.5](https://www.youtube.com/watch?v=P6E7qLMmzTQ)
[New features in Tracy Profiler v0.6](https://www.youtube.com/watch?v=uJkrFgriuOo) [New features in Tracy Profiler v0.6](https://www.youtube.com/watch?v=uJkrFgriuOo)
[New features in Tracy Profiler v0.7](https://www.youtube.com/watch?v=_hU7vw00MZ4) [New features in Tracy Profiler v0.7](https://www.youtube.com/watch?v=_hU7vw00MZ4)
[New features in Tracy Profiler v0.8](https://www.youtube.com/watch?v=30wpRpHTTag)

7
TODO
View File

@ -1,7 +0,0 @@
"Would be nice to have" list for 1.0 release:
=============================================
* Pack queue items tightly in the queues.
* Use level-of-detail system for plots.
* Use per-thread lock data structures.
* Use DTrace for BSD/OSX context switch capture.

187
Tracy.hpp
View File

@ -1,187 +0,0 @@
#ifndef __TRACY_HPP__
#define __TRACY_HPP__
#include "common/TracyColor.hpp"
#include "common/TracySystem.hpp"
#ifndef TRACY_ENABLE
#define ZoneNamed(x,y)
#define ZoneNamedN(x,y,z)
#define ZoneNamedC(x,y,z)
#define ZoneNamedNC(x,y,z,w)
#define ZoneScoped
#define ZoneScopedN(x)
#define ZoneScopedC(x)
#define ZoneScopedNC(x,y)
#define ZoneText(x,y)
#define ZoneTextV(x,y,z)
#define ZoneName(x,y)
#define ZoneNameV(x,y,z)
#define ZoneValue(x)
#define ZoneValueV(x,y)
#define FrameMark
#define FrameMarkNamed(x)
#define FrameMarkStart(x)
#define FrameMarkEnd(x)
#define FrameImage(x,y,z,w,a)
#define TracyLockable( type, varname ) type varname;
#define TracyLockableN( type, varname, desc ) type varname;
#define TracySharedLockable( type, varname ) type varname;
#define TracySharedLockableN( type, varname, desc ) type varname;
#define LockableBase( type ) type
#define SharedLockableBase( type ) type
#define LockMark(x) (void)x;
#define LockableName(x,y,z);
#define TracyPlot(x,y)
#define TracyPlotConfig(x,y)
#define TracyMessage(x,y)
#define TracyMessageL(x)
#define TracyMessageC(x,y,z)
#define TracyMessageLC(x,y)
#define TracyAppInfo(x,y)
#define TracyAlloc(x,y)
#define TracyFree(x)
#define ZoneNamedS(x,y,z)
#define ZoneNamedNS(x,y,z,w)
#define ZoneNamedCS(x,y,z,w)
#define ZoneNamedNCS(x,y,z,w,a)
#define ZoneScopedS(x)
#define ZoneScopedNS(x,y)
#define ZoneScopedCS(x,y)
#define ZoneScopedNCS(x,y,z)
#define TracyAllocS(x,y,z)
#define TracyFreeS(x,y)
#define TracyMessageS(x,y,z)
#define TracyMessageLS(x,y)
#define TracyMessageCS(x,y,z,w)
#define TracyMessageLCS(x,y,z)
#define TracyParameterRegister(x)
#define TracyParameterSetup(x,y,z,w)
#else
#include "client/TracyLock.hpp"
#include "client/TracyProfiler.hpp"
#include "client/TracyScoped.hpp"
#if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
# define ZoneNamed( varname, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { nullptr, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
# define ZoneNamedN( varname, name, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
# define ZoneNamedC( varname, color, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { nullptr, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
# define ZoneNamedNC( varname, name, color, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
#else
# define ZoneNamed( varname, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { nullptr, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), active );
# define ZoneNamedN( varname, name, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), active );
# define ZoneNamedC( varname, color, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { nullptr, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), active );
# define ZoneNamedNC( varname, name, color, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), active );
#endif
#define ZoneScoped ZoneNamed( ___tracy_scoped_zone, true )
#define ZoneScopedN( name ) ZoneNamedN( ___tracy_scoped_zone, name, true )
#define ZoneScopedC( color ) ZoneNamedC( ___tracy_scoped_zone, color, true )
#define ZoneScopedNC( name, color ) ZoneNamedNC( ___tracy_scoped_zone, name, color, true )
#define ZoneText( txt, size ) ___tracy_scoped_zone.Text( txt, size );
#define ZoneTextV( varname, txt, size ) varname.Text( txt, size );
#define ZoneName( txt, size ) ___tracy_scoped_zone.Name( txt, size );
#define ZoneNameV( varname, txt, size ) varname.Name( txt, size );
#define ZoneValue( value ) ___tracy_scoped_zone.Value( value );
#define ZoneValueV( varname, value ) varname.Value( value );
#define FrameMark tracy::Profiler::SendFrameMark( nullptr );
#define FrameMarkNamed( name ) tracy::Profiler::SendFrameMark( name );
#define FrameMarkStart( name ) tracy::Profiler::SendFrameMark( name, tracy::QueueType::FrameMarkMsgStart );
#define FrameMarkEnd( name ) tracy::Profiler::SendFrameMark( name, tracy::QueueType::FrameMarkMsgEnd );
#define FrameImage( image, width, height, offset, flip ) tracy::Profiler::SendFrameImage( image, width, height, offset, flip );
#define TracyLockable( type, varname ) tracy::Lockable<type> varname { [] () -> const tracy::SourceLocationData* { static const tracy::SourceLocationData srcloc { nullptr, #type " " #varname, __FILE__, __LINE__, 0 }; return &srcloc; }() };
#define TracyLockableN( type, varname, desc ) tracy::Lockable<type> varname { [] () -> const tracy::SourceLocationData* { static const tracy::SourceLocationData srcloc { nullptr, desc, __FILE__, __LINE__, 0 }; return &srcloc; }() };
#define TracySharedLockable( type, varname ) tracy::SharedLockable<type> varname { [] () -> const tracy::SourceLocationData* { static const tracy::SourceLocationData srcloc { nullptr, #type " " #varname, __FILE__, __LINE__, 0 }; return &srcloc; }() };
#define TracySharedLockableN( type, varname, desc ) tracy::SharedLockable<type> varname { [] () -> const tracy::SourceLocationData* { static const tracy::SourceLocationData srcloc { nullptr, desc, __FILE__, __LINE__, 0 }; return &srcloc; }() };
#define LockableBase( type ) tracy::Lockable<type>
#define SharedLockableBase( type ) tracy::SharedLockable<type>
#define LockMark( varname ) static const tracy::SourceLocationData __tracy_lock_location_##varname { nullptr, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; varname.Mark( &__tracy_lock_location_##varname );
#define LockableName( varname, txt, size ) varname.CustomName( txt, size );
#define TracyPlot( name, val ) tracy::Profiler::PlotData( name, val );
#define TracyPlotConfig( name, type ) tracy::Profiler::ConfigurePlot( name, type );
#define TracyAppInfo( txt, size ) tracy::Profiler::MessageAppInfo( txt, size );
#if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
# define TracyMessage( txt, size ) tracy::Profiler::Message( txt, size, TRACY_CALLSTACK );
# define TracyMessageL( txt ) tracy::Profiler::Message( txt, TRACY_CALLSTACK );
# define TracyMessageC( txt, size, color ) tracy::Profiler::MessageColor( txt, size, color, TRACY_CALLSTACK );
# define TracyMessageLC( txt, color ) tracy::Profiler::MessageColor( txt, color, TRACY_CALLSTACK );
# define TracyAlloc( ptr, size ) tracy::Profiler::MemAllocCallstack( ptr, size, TRACY_CALLSTACK );
# define TracyFree( ptr ) tracy::Profiler::MemFreeCallstack( ptr, TRACY_CALLSTACK );
#else
# define TracyMessage( txt, size ) tracy::Profiler::Message( txt, size, 0 );
# define TracyMessageL( txt ) tracy::Profiler::Message( txt, 0 );
# define TracyMessageC( txt, size, color ) tracy::Profiler::MessageColor( txt, size, color, 0 );
# define TracyMessageLC( txt, color ) tracy::Profiler::MessageColor( txt, color, 0 );
# define TracyAlloc( ptr, size ) tracy::Profiler::MemAlloc( ptr, size );
# define TracyFree( ptr ) tracy::Profiler::MemFree( ptr );
#endif
#ifdef TRACY_HAS_CALLSTACK
# define ZoneNamedS( varname, depth, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { nullptr, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
# define ZoneNamedNS( varname, name, depth, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
# define ZoneNamedCS( varname, color, depth, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { nullptr, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
# define ZoneNamedNCS( varname, name, color, depth, active ) static const tracy::SourceLocationData TracyConcat(__tracy_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::ScopedZone varname( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
# define ZoneScopedS( depth ) ZoneNamedS( ___tracy_scoped_zone, depth, true )
# define ZoneScopedNS( name, depth ) ZoneNamedNS( ___tracy_scoped_zone, name, 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 TracyAllocS( ptr, size, depth ) tracy::Profiler::MemAllocCallstack( ptr, size, depth );
# define TracyFreeS( ptr, depth ) tracy::Profiler::MemFreeCallstack( ptr, depth );
# define TracyMessageS( txt, size, depth ) tracy::Profiler::Message( txt, size, depth );
# define TracyMessageLS( txt, depth ) tracy::Profiler::Message( txt, depth );
# define TracyMessageCS( txt, size, color, depth ) tracy::Profiler::MessageColor( txt, size, color, depth );
# define TracyMessageLCS( txt, color, depth ) tracy::Profiler::MessageColor( txt, color, depth );
#else
# define ZoneNamedS( varname, depth, active ) ZoneNamed( varname, active )
# define ZoneNamedNS( varname, name, depth, active ) ZoneNamedN( varname, name, active )
# define ZoneNamedCS( varname, color, depth, active ) ZoneNamedC( varname, color, active )
# define ZoneNamedNCS( varname, name, color, depth, active ) ZoneNamedNC( varname, name, color, active )
# define ZoneScopedS( depth ) ZoneScoped
# define ZoneScopedNS( name, depth ) ZoneScopedN( name )
# define ZoneScopedCS( color, depth ) ZoneScopedC( color )
# define ZoneScopedNCS( name, color, depth ) ZoneScopedNC( name, color )
# define TracyAllocS( ptr, size, depth ) TracyAlloc( ptr, size )
# define TracyFreeS( ptr, depth ) TracyFree( ptr )
# define TracyMessageS( txt, size, depth ) TracyMessage( txt, size )
# define TracyMessageLS( txt, depth ) TracyMessageL( txt )
# define TracyMessageCS( txt, size, color, depth ) TracyMessageC( txt, size, color )
# define TracyMessageLCS( txt, color, depth ) TracyMessageLC( txt, color )
#endif
#define TracyParameterRegister( cb ) tracy::Profiler::ParameterRegister( cb );
#define TracyParameterSetup( idx, name, isBool, val ) tracy::Profiler::ParameterSetup( idx, name, isBool, val );
#endif
#endif

197
TracyC.h
View File

@ -1,197 +0,0 @@
#ifndef __TRACYC_HPP__
#define __TRACYC_HPP__
#include <stddef.h>
#include <stdint.h>
#include "client/TracyCallstack.h"
#include "common/TracyApi.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef TRACY_ENABLE
typedef const void* TracyCZoneCtx;
#define TracyCZone(c,x)
#define TracyCZoneN(c,x,y)
#define TracyCZoneC(c,x,y)
#define TracyCZoneNC(c,x,y,z)
#define TracyCZoneEnd(c)
#define TracyCZoneText(c,x,y)
#define TracyCZoneName(c,x,y)
#define TracyCZoneValue(c,x)
#define TracyCAlloc(x,y)
#define TracyCFree(x)
#define TracyCFrameMark
#define TracyCFrameMarkNamed(x)
#define TracyCFrameMarkStart(x)
#define TracyCFrameMarkEnd(x)
#define TracyCFrameImage(x,y,z,w,a)
#define TracyCPlot(x,y)
#define TracyCMessage(x,y)
#define TracyCMessageL(x)
#define TracyCMessageC(x,y,z)
#define TracyCMessageLC(x,y)
#define TracyCAppInfo(x,y)
#define TracyCZoneS(x,y,z)
#define TracyCZoneNS(x,y,z,w)
#define TracyCZoneCS(x,y,z,w)
#define TracyCZoneNCS(x,y,z,w,a)
#define TracyCAllocS(x,y,z)
#define TracyCFreeS(x,y)
#define TracyCMessageS(x,y,z)
#define TracyCMessageLS(x,y)
#define TracyCMessageCS(x,y,z,w)
#define TracyCMessageLCS(x,y,z)
#else
#ifndef TracyConcat
# define TracyConcat(x,y) TracyConcatIndirect(x,y)
#endif
#ifndef TracyConcatIndirect
# define TracyConcatIndirect(x,y) x##y
#endif
struct ___tracy_source_location_data
{
const char* name;
const char* function;
const char* file;
uint32_t line;
uint32_t color;
};
struct ___tracy_c_zone_context
{
uint32_t id;
int active;
};
// Some containers don't support storing const types.
// This struct, as visible to user, is immutable, so treat it as if const was declared here.
typedef /*const*/ struct ___tracy_c_zone_context TracyCZoneCtx;
TRACY_API uint64_t ___tracy_alloc_srcloc( uint32_t line, const char* source, const char* function );
TRACY_API uint64_t ___tracy_alloc_srcloc_name( uint32_t line, const char* source, const char* function, const char* name, size_t nameSz );
TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin( const struct ___tracy_source_location_data* srcloc, int active );
TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_callstack( const struct ___tracy_source_location_data* srcloc, int depth, int active );
TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_alloc( uint64_t srcloc, int active );
TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_alloc_callstack( uint64_t srcloc, int depth, int active );
TRACY_API void ___tracy_emit_zone_end( TracyCZoneCtx ctx );
TRACY_API void ___tracy_emit_zone_text( TracyCZoneCtx ctx, const char* txt, size_t size );
TRACY_API void ___tracy_emit_zone_name( TracyCZoneCtx ctx, const char* txt, size_t size );
TRACY_API void ___tracy_emit_zone_value( TracyCZoneCtx ctx, uint64_t value );
#if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
# define TracyCZone( ctx, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
# define TracyCZoneN( ctx, name, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
# define TracyCZoneC( ctx, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
# define TracyCZoneNC( ctx, name, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), TRACY_CALLSTACK, active );
#else
# define TracyCZone( ctx, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
# define TracyCZoneN( ctx, name, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
# define TracyCZoneC( ctx, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
# define TracyCZoneNC( ctx, name, color, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin( &TracyConcat(__tracy_source_location,__LINE__), active );
#endif
#define TracyCZoneEnd( ctx ) ___tracy_emit_zone_end( ctx );
#define TracyCZoneText( ctx, txt, size ) ___tracy_emit_zone_text( ctx, txt, size );
#define TracyCZoneName( ctx, txt, size ) ___tracy_emit_zone_name( ctx, txt, size );
#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_callstack( const void* ptr, size_t size, int depth );
TRACY_API void ___tracy_emit_memory_free( const void* ptr );
TRACY_API void ___tracy_emit_memory_free_callstack( const void* ptr, int depth );
TRACY_API void ___tracy_emit_message( const char* txt, size_t size, int callstack );
TRACY_API void ___tracy_emit_messageL( const char* txt, int callstack );
TRACY_API void ___tracy_emit_messageC( const char* txt, size_t size, uint32_t color, int callstack );
TRACY_API void ___tracy_emit_messageLC( const char* txt, uint32_t color, int callstack );
#if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
# define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc_callstack( ptr, size, TRACY_CALLSTACK )
# define TracyCFree( ptr ) ___tracy_emit_memory_free_callstack( ptr, TRACY_CALLSTACK )
# define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, TRACY_CALLSTACK );
# define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, TRACY_CALLSTACK );
# define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, TRACY_CALLSTACK );
# define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color, TRACY_CALLSTACK );
#else
# define TracyCAlloc( ptr, size ) ___tracy_emit_memory_alloc( ptr, size );
# define TracyCFree( ptr ) ___tracy_emit_memory_free( ptr );
# define TracyCMessage( txt, size ) ___tracy_emit_message( txt, size, 0 );
# define TracyCMessageL( txt ) ___tracy_emit_messageL( txt, 0 );
# define TracyCMessageC( txt, size, color ) ___tracy_emit_messageC( txt, size, color, 0 );
# define TracyCMessageLC( txt, color ) ___tracy_emit_messageLC( txt, color, 0 );
#endif
TRACY_API void ___tracy_emit_frame_mark( const char* name );
TRACY_API void ___tracy_emit_frame_mark_start( const char* name );
TRACY_API void ___tracy_emit_frame_mark_end( const char* name );
TRACY_API void ___tracy_emit_frame_image( const void* image, uint16_t w, uint16_t h, uint8_t offset, int flip );
#define TracyCFrameMark ___tracy_emit_frame_mark( 0 );
#define TracyCFrameMarkNamed( name ) ___tracy_emit_frame_mark( name );
#define TracyCFrameMarkStart( name ) ___tracy_emit_frame_mark_start( name );
#define TracyCFrameMarkEnd( name ) ___tracy_emit_frame_mark_end( name );
#define TracyCFrameImage( image, width, height, offset, flip ) ___tracy_emit_frame_image( image, width, height, offset, flip );
TRACY_API void ___tracy_emit_plot( const char* name, double val );
TRACY_API void ___tracy_emit_message_appinfo( const char* txt, size_t size );
#define TracyCPlot( name, val ) ___tracy_emit_plot( name, val );
#define TracyCAppInfo( txt, color ) ___tracy_emit_message_appinfo( txt, color );
#ifdef TRACY_HAS_CALLSTACK
# define TracyCZoneS( ctx, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
# define TracyCZoneNS( ctx, name, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
# define TracyCZoneCS( ctx, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { NULL, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
# define TracyCZoneNCS( ctx, name, color, depth, active ) static const struct ___tracy_source_location_data TracyConcat(__tracy_source_location,__LINE__) = { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; TracyCZoneCtx ctx = ___tracy_emit_zone_begin_callstack( &TracyConcat(__tracy_source_location,__LINE__), depth, active );
# define TracyCAllocS( ptr, size, depth ) ___tracy_emit_memory_alloc_callstack( ptr, size, depth )
# define TracyCFreeS( ptr, depth ) ___tracy_emit_memory_free_callstack( ptr, depth )
# define TracyCMessageS( txt, size, depth ) ___tracy_emit_message( txt, size, depth );
# define TracyCMessageLS( txt, depth ) ___tracy_emit_messageL( txt, depth );
# define TracyCMessageCS( txt, size, color, depth ) ___tracy_emit_messageC( txt, size, color, depth );
# define TracyCMessageLCS( txt, color, depth ) ___tracy_emit_messageLC( txt, color, depth );
#else
# define TracyCZoneS( ctx, depth, active ) TracyCZone( ctx, active )
# define TracyCZoneNS( ctx, name, depth, active ) TracyCZoneN( ctx, name, active )
# define TracyCZoneCS( ctx, color, depth, active ) TracyCZoneC( ctx, color, active )
# define TracyCZoneNCS( ctx, name, color, depth, active ) TracyCZoneNC( ctx, name, color, active )
# define TracyCAllocS( ptr, size, depth ) TracyCAlloc( ptr, size )
# define TracyCFreeS( ptr, depth ) TracyCFree( ptr )
# define TracyCMessageS( txt, size, depth ) TracyCMessage( txt, size )
# define TracyCMessageLS( txt, depth ) TracyCMessageL( txt )
# define TracyCMessageCS( txt, size, color, depth ) TracyCMessageC( txt, size, color )
# define TracyCMessageLCS( txt, color, depth ) TracyCMessageLC( txt, color )
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,47 +0,0 @@
//
// Tracy profiler
// ----------------
//
// For fast integration, compile and
// link with this source file (and none
// other) in your executable (or in the
// main DLL / shared object on multi-DLL
// projects).
//
// Define TRACY_ENABLE to enable profiler.
#include "common/TracySystem.cpp"
#ifdef TRACY_ENABLE
#include "common/tracy_lz4.cpp"
#include "client/TracyProfiler.cpp"
#include "client/TracyCallstack.cpp"
#include "client/TracySysTime.cpp"
#include "client/TracySysTrace.cpp"
#include "common/TracySocket.cpp"
#include "client/tracy_rpmalloc.cpp"
#include "client/TracyDxt1.cpp"
#if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6
# include "libbacktrace/alloc.cpp"
# include "libbacktrace/dwarf.cpp"
# include "libbacktrace/fileline.cpp"
# include "libbacktrace/mmapio.cpp"
# include "libbacktrace/posix.cpp"
# include "libbacktrace/sort.cpp"
# include "libbacktrace/state.cpp"
# if TRACY_HAS_CALLSTACK == 4
# include "libbacktrace/macho.cpp"
# else
# include "libbacktrace/elf.cpp"
# endif
#endif
#ifdef _MSC_VER
# pragma comment(lib, "ws2_32.lib")
# pragma comment(lib, "dbghelp.lib")
#endif
#endif

View File

@ -1,351 +0,0 @@
#ifndef __TRACYD3D12_HPP__
#define __TRACYD3D12_HPP__
#ifndef TRACY_ENABLE
#define TracyD3D12Context(device, queue) nullptr
#define TracyD3D12Destroy(ctx)
#define TracyD3D12NamedZone(ctx, varname, cmdList, name, active)
#define TracyD3D12NamedZoneC(ctx, varname, cmdList, name, color, active)
#define TracyD3D12Zone(ctx, cmdList, name)
#define TracyD3D12ZoneC(ctx, cmdList, name, color)
#define TracyD3D12Collect(ctx)
namespace tracy
{
class D3D12ZoneScope {};
}
using TracyD3D12Ctx = void*;
#else
#include "Tracy.hpp"
#include "client/TracyProfiler.hpp"
#include <cstdlib>
#include <cassert>
#include <d3d12.h>
#include <dxgi.h>
#include <wrl/client.h>
#include <queue>
namespace tracy
{
struct D3D12QueryPayload
{
uint32_t m_queryIdStart = 0;
uint32_t m_queryCount = 0;
};
// Command queue context.
class D3D12QueueCtx
{
friend class D3D12ZoneScope;
static constexpr uint32_t MaxQueries = 64 * 1024; // Queries are begin and end markers, so we can store half as many total time durations. Must be even!
bool m_initialized = false;
ID3D12Device* m_device;
ID3D12CommandQueue* m_queue;
uint8_t m_context;
Microsoft::WRL::ComPtr<ID3D12QueryHeap> m_queryHeap;
Microsoft::WRL::ComPtr<ID3D12Resource> m_readbackBuffer;
// In-progress payload.
uint32_t m_queryLimit = MaxQueries;
uint32_t m_queryCounter = 0;
uint32_t m_previousQueryCounter = 0;
uint32_t m_activePayload = 0;
Microsoft::WRL::ComPtr<ID3D12Fence> m_payloadFence;
std::queue<D3D12QueryPayload> m_payloadQueue;
public:
D3D12QueueCtx(ID3D12Device* device, ID3D12CommandQueue* queue)
: m_device(device)
, m_queue(queue)
, m_context(GetGpuCtxCounter().fetch_add(1, std::memory_order_relaxed))
{
// Verify we support timestamp queries on this queue.
if (queue->GetDesc().Type == D3D12_COMMAND_LIST_TYPE_COPY)
{
D3D12_FEATURE_DATA_D3D12_OPTIONS3 featureData{};
if (FAILED(device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS3, &featureData, sizeof(featureData))))
{
assert(false && "Platform does not support profiling of copy queues.");
}
}
uint64_t timestampFrequency;
if (FAILED(queue->GetTimestampFrequency(&timestampFrequency)))
{
assert(false && "Failed to get timestamp frequency.");
}
uint64_t cpuTimestamp;
uint64_t gpuTimestamp;
if (FAILED(queue->GetClockCalibration(&gpuTimestamp, &cpuTimestamp)))
{
assert(false && "Failed to get queue clock calibration.");
}
cpuTimestamp = Profiler::GetTime();
D3D12_QUERY_HEAP_DESC heapDesc{};
heapDesc.Type = queue->GetDesc().Type == D3D12_COMMAND_LIST_TYPE_COPY ? D3D12_QUERY_HEAP_TYPE_COPY_QUEUE_TIMESTAMP : D3D12_QUERY_HEAP_TYPE_TIMESTAMP;
heapDesc.Count = m_queryLimit;
heapDesc.NodeMask = 0; // #TODO: Support multiple adapters.
while (FAILED(device->CreateQueryHeap(&heapDesc, IID_PPV_ARGS(&m_queryHeap))))
{
m_queryLimit /= 2;
heapDesc.Count = m_queryLimit;
}
// Create a readback buffer, which will be used as a destination for the query data.
D3D12_RESOURCE_DESC readbackBufferDesc{};
readbackBufferDesc.Alignment = 0;
readbackBufferDesc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
readbackBufferDesc.Width = m_queryLimit * sizeof(uint64_t);
readbackBufferDesc.Height = 1;
readbackBufferDesc.DepthOrArraySize = 1;
readbackBufferDesc.Format = DXGI_FORMAT_UNKNOWN;
readbackBufferDesc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR; // Buffers are always row major.
readbackBufferDesc.MipLevels = 1;
readbackBufferDesc.SampleDesc.Count = 1;
readbackBufferDesc.SampleDesc.Quality = 0;
readbackBufferDesc.Flags = D3D12_RESOURCE_FLAG_NONE;
D3D12_HEAP_PROPERTIES readbackHeapProps{};
readbackHeapProps.Type = D3D12_HEAP_TYPE_READBACK;
readbackHeapProps.CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
readbackHeapProps.MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
readbackHeapProps.CreationNodeMask = 0;
readbackHeapProps.VisibleNodeMask = 0; // #TODO: Support multiple adapters.
if (FAILED(device->CreateCommittedResource(&readbackHeapProps, D3D12_HEAP_FLAG_NONE, &readbackBufferDesc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, IID_PPV_ARGS(&m_readbackBuffer))))
{
assert(false && "Failed to create query readback buffer.");
}
if (FAILED(device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(&m_payloadFence))))
{
assert(false && "Failed to create payload fence.");
}
auto* item = Profiler::QueueSerial();
MemWrite(&item->hdr.type, QueueType::GpuNewContext);
MemWrite(&item->gpuNewContext.cpuTime, cpuTimestamp);
MemWrite(&item->gpuNewContext.gpuTime, gpuTimestamp);
memset(&item->gpuNewContext.thread, 0, sizeof(item->gpuNewContext.thread));
MemWrite(&item->gpuNewContext.period, 1E+09f / static_cast<float>(timestampFrequency));
MemWrite(&item->gpuNewContext.context, m_context);
MemWrite(&item->gpuNewContext.accuracyBits, uint8_t{ 0 });
MemWrite(&item->gpuNewContext.type, GpuContextType::Direct3D12);
#ifdef TRACY_ON_DEMAND
GetProfiler().DeferItem(*item);
#endif
Profiler::QueueSerialFinish();
m_initialized = true;
}
void NewFrame()
{
m_payloadQueue.emplace(D3D12QueryPayload{ m_previousQueryCounter, m_queryCounter });
m_previousQueryCounter += m_queryCounter;
m_queryCounter = 0;
if (m_previousQueryCounter >= m_queryLimit)
{
m_previousQueryCounter -= m_queryLimit;
}
m_queue->Signal(m_payloadFence.Get(), ++m_activePayload);
}
void Collect()
{
ZoneScopedC(Color::Red4);
#ifdef TRACY_ON_DEMAND
if (!GetProfiler().IsConnected())
{
m_queryCounter = 0;
return;
}
#endif
// Find out what payloads are available.
const auto newestReadyPayload = m_payloadFence->GetCompletedValue();
const auto payloadCount = m_payloadQueue.size() - (m_activePayload - newestReadyPayload);
if (!payloadCount)
{
return; // No payloads are available yet, exit out.
}
D3D12_RANGE mapRange{ 0, m_queryLimit * sizeof(uint64_t) };
// Map the readback buffer so we can fetch the query data from the GPU.
void* readbackBufferMapping = nullptr;
if (FAILED(m_readbackBuffer->Map(0, &mapRange, &readbackBufferMapping)))
{
assert(false && "Failed to map readback buffer.");
}
auto* timestampData = static_cast<uint64_t*>(readbackBufferMapping);
for (uint32_t i = 0; i < payloadCount; ++i)
{
const auto& payload = m_payloadQueue.front();
for (uint32_t j = 0; j < payload.m_queryCount; ++j)
{
const auto counter = (payload.m_queryIdStart + j) % m_queryLimit;
const auto timestamp = timestampData[counter];
const auto queryId = counter;
auto* item = Profiler::QueueSerial();
MemWrite(&item->hdr.type, QueueType::GpuTime);
MemWrite(&item->gpuTime.gpuTime, timestamp);
MemWrite(&item->gpuTime.queryId, static_cast<uint16_t>(queryId));
MemWrite(&item->gpuTime.context, m_context);
Profiler::QueueSerialFinish();
}
m_payloadQueue.pop();
}
m_readbackBuffer->Unmap(0, nullptr);
}
private:
tracy_force_inline uint32_t NextQueryId()
{
assert(m_queryCounter < m_queryLimit && "Submitted too many GPU queries! Consider increasing MaxQueries.");
const uint32_t id = (m_previousQueryCounter + m_queryCounter) % m_queryLimit;
m_queryCounter += 2; // Allocate space for a begin and end query.
return id;
}
tracy_force_inline uint8_t GetId() const
{
return m_context;
}
};
class D3D12ZoneScope
{
const bool m_active;
D3D12QueueCtx* m_ctx = nullptr;
ID3D12GraphicsCommandList* m_cmdList = nullptr;
uint32_t m_queryId = 0; // Used for tracking in nested zones.
public:
tracy_force_inline D3D12ZoneScope(D3D12QueueCtx* ctx, ID3D12GraphicsCommandList* cmdList, const SourceLocationData* srcLocation, bool active)
#ifdef TRACY_ON_DEMAND
: m_active(active && GetProfiler().IsConnected())
#else
: m_active(active)
#endif
{
if (!m_active) return;
m_ctx = ctx;
m_cmdList = cmdList;
m_queryId = ctx->NextQueryId();
cmdList->EndQuery(ctx->m_queryHeap.Get(), D3D12_QUERY_TYPE_TIMESTAMP, m_queryId);
auto* item = Profiler::QueueSerial();
#if defined(TRACY_HAS_CALLSTACK) && defined(TRACY_CALLSTACK)
MemWrite(&item->hdr.type, QueueType::GpuZoneBeginCallstackSerial);
#else
MemWrite(&item->hdr.type, QueueType::GpuZoneBeginSerial);
#endif
MemWrite(&item->gpuZoneBegin.cpuTime, Profiler::GetTime());
MemWrite(&item->gpuZoneBegin.srcloc, reinterpret_cast<uint64_t>(srcLocation));
MemWrite(&item->gpuZoneBegin.thread, GetThreadHandle());
MemWrite(&item->gpuZoneBegin.queryId, static_cast<uint16_t>(m_queryId));
MemWrite(&item->gpuZoneBegin.context, ctx->GetId());
Profiler::QueueSerialFinish();
#if defined(TRACY_HAS_CALLSTACK) && defined(TRACY_CALLSTACK)
GetProfiler().SendCallstack(TRACY_CALLSTACK);
#endif
}
tracy_force_inline ~D3D12ZoneScope()
{
if (!m_active) return;
const auto queryId = m_queryId + 1; // Our end query slot is immediately after the begin slot.
m_cmdList->EndQuery(m_ctx->m_queryHeap.Get(), D3D12_QUERY_TYPE_TIMESTAMP, queryId);
auto* item = Profiler::QueueSerial();
MemWrite(&item->hdr.type, QueueType::GpuZoneEndSerial);
MemWrite(&item->gpuZoneEnd.cpuTime, Profiler::GetTime());
MemWrite(&item->gpuZoneEnd.thread, GetThreadHandle());
MemWrite(&item->gpuZoneEnd.queryId, static_cast<uint16_t>(queryId));
MemWrite(&item->gpuZoneEnd.context, m_ctx->GetId());
Profiler::QueueSerialFinish();
m_cmdList->ResolveQueryData(m_ctx->m_queryHeap.Get(), D3D12_QUERY_TYPE_TIMESTAMP, m_queryId, 2, m_ctx->m_readbackBuffer.Get(), m_queryId * sizeof(uint64_t));
}
};
static inline D3D12QueueCtx* CreateD3D12Context(ID3D12Device* device, ID3D12CommandQueue* queue)
{
InitRPMallocThread();
auto* ctx = static_cast<D3D12QueueCtx*>(tracy_malloc(sizeof(D3D12QueueCtx)));
new (ctx) D3D12QueueCtx{ device, queue };
return ctx;
}
static inline void DestroyD3D12Context(D3D12QueueCtx* ctx)
{
ctx->~D3D12QueueCtx();
tracy_free(ctx);
}
}
using TracyD3D12Ctx = tracy::D3D12QueueCtx*;
#define TracyD3D12Context(device, queue) tracy::CreateD3D12Context(device, queue);
#define TracyD3D12Destroy(ctx) tracy::DestroyD3D12Context(ctx);
#define TracyD3D12NewFrame(ctx) ctx->NewFrame();
#define TracyD3D12NamedZone(ctx, varname, cmdList, name, active) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location, __LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::D3D12ZoneScope varname{ ctx, cmdList, &TracyConcat(__tracy_gpu_source_location, __LINE__), active };
#define TracyD3D12NamedZoneC(ctx, varname, cmdList, name, color, active) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location, __LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::D3D12ZoneScope varname{ ctx, cmdList, &TracyConcat(__tracy_gpu_source_location, __LINE__), active };
#define TracyD3D12Zone(ctx, cmdList, name) TracyD3D12NamedZone(ctx, ___tracy_gpu_zone, cmdList, name, true)
#define TracyD3D12ZoneC(ctx, cmdList, name, color) TracyD3D12NamedZoneC(ctx, ___tracy_gpu_zone, cmdList, name, color, true)
#define TracyD3D12Collect(ctx) ctx->Collect();
#endif
#endif

View File

@ -1,333 +0,0 @@
#ifndef __TRACYOPENCL_HPP__
#define __TRACYOPENCL_HPP__
#if !defined TRACY_ENABLE
#define TracyCLContext(x, y) nullptr
#define TracyCLDestroy(x)
#define TracyCLNamedZone(c, x, y, z, w)
#define TracyCLNamedZoneC(c, x, y, z, w, a)
#define TracyCLZone(c, x, y)
#define TracyCLZoneC(c, x, y, z)
#define TracyCLCollect(c)
#define TracyCLNamedZoneS(c, x, y, z, w, a)
#define TracyCLNamedZoneCS(c, x, y, z, w, v, a)
#define TracyCLZoneS(c, x, y, z)
#define TracyCLZoneCS(c, x, y, z, w)
namespace tracy
{
class OpenCLCtxScope {};
}
using TracyCLCtx = void*;
#else
#include <CL/cl.h>
#include <atomic>
#include <cassert>
#include "Tracy.hpp"
#include "client/TracyCallstack.hpp"
#include "client/TracyProfiler.hpp"
#include "common/TracyAlloc.hpp"
namespace tracy {
enum class EventPhase : uint8_t
{
Begin,
End
};
struct EventInfo
{
cl_event event;
EventPhase phase;
};
class OpenCLCtx
{
public:
enum { QueryCount = 64 * 1024 };
OpenCLCtx(cl_context context, cl_device_id device)
: m_contextId(GetGpuCtxCounter().fetch_add(1, std::memory_order_relaxed))
, m_head(0)
, m_tail(0)
{
assert(m_contextId != 255);
m_hostStartTime = Profiler::GetTime();
m_deviceStartTime = GetDeviceTimestamp(context, device);
auto item = Profiler::QueueSerial();
MemWrite(&item->hdr.type, QueueType::GpuNewContext);
MemWrite(&item->gpuNewContext.cpuTime, m_hostStartTime);
MemWrite(&item->gpuNewContext.gpuTime, m_hostStartTime);
memset(&item->gpuNewContext.thread, 0, sizeof(item->gpuNewContext.thread));
MemWrite(&item->gpuNewContext.period, 1.0f);
MemWrite(&item->gpuNewContext.type, GpuContextType::OpenCL);
MemWrite(&item->gpuNewContext.context, (uint8_t) m_contextId);
MemWrite(&item->gpuNewContext.accuracyBits, (uint8_t)0);
#ifdef TRACY_ON_DEMAND
GetProfiler().DeferItem(*item);
#endif
Profiler::QueueSerialFinish();
}
void Collect()
{
ZoneScopedC(Color::Red4);
if (m_tail == m_head) return;
#ifdef TRACY_ON_DEMAND
if (!GetProfiler().IsConnected())
{
m_head = m_tail = 0;
}
#endif
while (m_tail != m_head)
{
EventInfo eventInfo = m_query[m_tail];
cl_event event = eventInfo.event;
cl_int eventStatus;
cl_int err = clGetEventInfo(event, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &eventStatus, nullptr);
assert(err == CL_SUCCESS);
if (eventStatus != CL_COMPLETE) return;
cl_int eventInfoQuery = (eventInfo.phase == EventPhase::Begin)
? CL_PROFILING_COMMAND_START
: CL_PROFILING_COMMAND_END;
cl_ulong eventTimeStamp = 0;
err = clGetEventProfilingInfo(event, eventInfoQuery, sizeof(cl_ulong), &eventTimeStamp, nullptr);
assert(err == CL_SUCCESS);
assert(eventTimeStamp != 0);
auto item = Profiler::QueueSerial();
MemWrite(&item->hdr.type, QueueType::GpuTime);
MemWrite(&item->gpuTime.gpuTime, TimestampOffset(eventTimeStamp));
MemWrite(&item->gpuTime.queryId, (uint16_t)m_tail);
MemWrite(&item->gpuTime.context, m_contextId);
Profiler::QueueSerialFinish();
if (eventInfo.phase == EventPhase::End)
{
// Done with the event, so release it
assert(clReleaseEvent(event) == CL_SUCCESS);
}
m_tail = (m_tail + 1) % QueryCount;
}
}
tracy_force_inline uint8_t GetId() const
{
return m_contextId;
}
tracy_force_inline unsigned int NextQueryId(EventInfo eventInfo)
{
const auto id = m_head;
m_head = (m_head + 1) % QueryCount;
assert(m_head != m_tail);
m_query[id] = eventInfo;
return id;
}
tracy_force_inline EventInfo& GetQuery(unsigned int id)
{
assert(id < QueryCount);
return m_query[id];
}
private:
tracy_force_inline int64_t GetHostStartTime() const
{
return m_hostStartTime;
}
tracy_force_inline int64_t GetDeviceStartTime() const
{
return m_deviceStartTime;
}
tracy_force_inline int64_t TimestampOffset(int64_t deviceTimestamp) const
{
return m_hostStartTime + (deviceTimestamp - m_deviceStartTime);
}
tracy_force_inline int64_t GetDeviceTimestamp(cl_context context, cl_device_id device) const
{
cl_ulong deviceTimestamp = 0;
cl_int err = CL_SUCCESS;
cl_command_queue queue = clCreateCommandQueue(context, device, CL_QUEUE_PROFILING_ENABLE, &err);
assert(err == CL_SUCCESS);
uint32_t dummyValue = 42;
cl_mem dummyBuffer = clCreateBuffer(context, CL_MEM_WRITE_ONLY, sizeof(uint32_t), nullptr, &err);
assert(err == CL_SUCCESS);
cl_event writeBufferEvent;
err = clEnqueueWriteBuffer(queue, dummyBuffer, CL_TRUE, 0, sizeof(uint32_t), &dummyValue, 0, nullptr, &writeBufferEvent);
assert(err == CL_SUCCESS);
err = clWaitForEvents(1, &writeBufferEvent);
assert(err == CL_SUCCESS);
cl_int eventStatus;
err = clGetEventInfo(writeBufferEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(cl_int), &eventStatus, nullptr);
assert(err == CL_SUCCESS);
assert(eventStatus == CL_COMPLETE);
err = clGetEventProfilingInfo(writeBufferEvent, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &deviceTimestamp, nullptr);
assert(err == CL_SUCCESS);
err = clReleaseEvent(writeBufferEvent);
assert(err == CL_SUCCESS);
err = clReleaseMemObject(dummyBuffer);
assert(err == CL_SUCCESS);
err = clReleaseCommandQueue(queue);
assert(err == CL_SUCCESS);
return (int64_t)deviceTimestamp;
}
unsigned int m_contextId;
EventInfo m_query[QueryCount];
unsigned int m_head;
unsigned int m_tail;
int64_t m_hostStartTime;
int64_t m_deviceStartTime;
};
class OpenCLCtxScope {
public:
tracy_force_inline OpenCLCtxScope(OpenCLCtx* ctx, const SourceLocationData* srcLoc, bool is_active)
#ifdef TRACY_ON_DEMAND
: m_active(is_active&& GetProfiler().IsConnected())
#else
: m_active(is_active)
#endif
, m_ctx(ctx)
, m_event(nullptr)
{
if (!m_active) return;
m_beginQueryId = ctx->NextQueryId(EventInfo{ nullptr, EventPhase::Begin });
auto item = Profiler::QueueSerial();
MemWrite(&item->hdr.type, QueueType::GpuZoneBeginSerial);
MemWrite(&item->gpuZoneBegin.cpuTime, Profiler::GetTime());
MemWrite(&item->gpuZoneBegin.srcloc, (uint64_t)srcLoc);
MemWrite(&item->gpuZoneBegin.thread, GetThreadHandle());
MemWrite(&item->gpuZoneBegin.queryId, (uint16_t)m_beginQueryId);
MemWrite(&item->gpuZoneBegin.context, ctx->GetId());
Profiler::QueueSerialFinish();
}
tracy_force_inline OpenCLCtxScope(OpenCLCtx* ctx, const SourceLocationData* srcLoc, int depth, bool is_active)
#ifdef TRACY_ON_DEMAND
: m_active(is_active&& GetProfiler().IsConnected())
#else
: m_active(is_active)
#endif
, m_ctx(ctx)
, m_event(nullptr)
{
if (!m_active) return;
m_beginQueryId = ctx->NextQueryId(EventInfo{ nullptr, EventPhase::Begin });
auto item = Profiler::QueueSerial();
MemWrite(&item->hdr.type, QueueType::GpuZoneBeginCallstackSerial);
MemWrite(&item->gpuZoneBegin.cpuTime, Profiler::GetTime());
MemWrite(&item->gpuZoneBegin.srcloc, (uint64_t)srcLoc);
MemWrite(&item->gpuZoneBegin.thread, GetThreadHandle());
MemWrite(&item->gpuZoneBegin.queryId, (uint16_t)m_beginQueryId);
MemWrite(&item->gpuZoneBegin.context, ctx->GetId());
Profiler::QueueSerialFinish();
GetProfiler().SendCallstack(depth);
}
tracy_force_inline void SetEvent(cl_event event)
{
m_event = event;
assert(clRetainEvent(m_event) == CL_SUCCESS);
m_ctx->GetQuery(m_beginQueryId).event = m_event;
}
tracy_force_inline ~OpenCLCtxScope()
{
const auto queryId = m_ctx->NextQueryId(EventInfo{ m_event, EventPhase::End });
auto item = Profiler::QueueSerial();
MemWrite(&item->hdr.type, QueueType::GpuZoneEndSerial);
MemWrite(&item->gpuZoneEnd.cpuTime, Profiler::GetTime());
MemWrite(&item->gpuZoneEnd.thread, GetThreadHandle());
MemWrite(&item->gpuZoneEnd.queryId, (uint16_t)queryId);
MemWrite(&item->gpuZoneEnd.context, m_ctx->GetId());
Profiler::QueueSerialFinish();
}
const bool m_active;
OpenCLCtx* m_ctx;
cl_event m_event;
unsigned int m_beginQueryId;
};
static inline OpenCLCtx* CreateCLContext(cl_context context, cl_device_id device)
{
InitRPMallocThread();
auto ctx = (OpenCLCtx*)tracy_malloc(sizeof(OpenCLCtx));
new (ctx) OpenCLCtx(context, device);
return ctx;
}
static inline void DestroyCLContext(OpenCLCtx* ctx)
{
ctx->~OpenCLCtx();
tracy_free(ctx);
}
} // namespace tracy
using TracyCLCtx = tracy::OpenCLCtx*;
#define TracyCLContext(context, device) tracy::CreateCLContext(context, device);
#define TracyCLDestroy(ctx) tracy::DestroyCLContext(ctx);
#if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
# define TracyCLNamedZone(ctx, varname, name, active) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::OpenCLCtxScope varname(ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), TRACY_CALLSTACK, active );
# define TracyCLNamedZoneC(ctx, varname, name, color, active) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::OpenCLCtxScope varname(ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), TRACY_CALLSTACK, active );
# define TracyCLZone(ctx, name) TracyCLNamedZoneS(ctx, __tracy_gpu_zone, name, TRACY_CALLSTACK, true)
# define TracyCLZoneC(ctx, name, color) TracyCLNamedZoneCS(ctx, __tracy_gpu_zone, name, color, TRACY_CALLSTACK, true)
#else
# define TracyCLNamedZone(ctx, varname, name, active) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__){ name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::OpenCLCtxScope varname(ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), active);
# define TracyCLNamedZoneC(ctx, varname, name, color, active) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__){ name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::OpenCLCtxScope varname(ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), active);
# define TracyCLZone(ctx, name) TracyCLNamedZone(ctx, __tracy_gpu_zone, name, true)
# define TracyCLZoneC(ctx, name, color) TracyCLNamedZoneC(ctx, __tracy_gpu_zone, name, color, true )
#endif
#ifdef TRACY_HAS_CALLSTACK
# define TracyCLNamedZoneS(ctx, varname, name, depth, active) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__){ name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::OpenCLCtxScope varname(ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), depth, active);
# define TracyCLNamedZoneCS(ctx, varname, name, color, depth, active) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__){ name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::OpenCLCtxScope varname(ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), depth, active);
# define TracyCLZoneS(ctx, name, depth) TracyCLNamedZoneS(ctx, __tracy_gpu_zone, name, depth, true)
# define TracyCLZoneCS(ctx, name, color, depth) TracyCLNamedZoneCS(ctx, __tracy_gpu_zone, name, color, depth, true)
#else
#define TracyCLNamedZoneS(ctx, varname, name, depth, active) TracyCLNamedZone(ctx, varname, name, active)
#define TracyCLNamedZoneCS(ctx, varname, name, color, depth, active) TracyCLNamedZoneC(ctx, varname, name, color, active)
#define TracyCLZoneS(ctx, name, depth) TracyCLZone(ctx, name)
#define TracyCLZoneCS(ctx, name, color, depth) TracyCLZoneC(ctx, name, color)
#endif
#define TracyCLNamedZoneSetEvent(varname, event) varname.SetEvent(event)
#define TracyCLZoneSetEvent(event) __tracy_gpu_zone.SetEvent(event)
#define TracyCLCollect(ctx) ctx->Collect()
#endif
#endif

View File

@ -1,321 +0,0 @@
#ifndef __TRACYVULKAN_HPP__
#define __TRACYVULKAN_HPP__
#if !defined TRACY_ENABLE
#define TracyVkContext(x,y,z,w) nullptr
#define TracyVkDestroy(x)
#define TracyVkNamedZone(c,x,y,z,w)
#define TracyVkNamedZoneC(c,x,y,z,w,a)
#define TracyVkZone(c,x,y)
#define TracyVkZoneC(c,x,y,z)
#define TracyVkCollect(c,x)
#define TracyVkNamedZoneS(c,x,y,z,w,a)
#define TracyVkNamedZoneCS(c,x,y,z,w,v,a)
#define TracyVkZoneS(c,x,y,z)
#define TracyVkZoneCS(c,x,y,z,w)
namespace tracy
{
class VkCtxScope {};
}
using TracyVkCtx = void*;
#else
#include <assert.h>
#include <stdlib.h>
#include <vulkan/vulkan.h>
#include "Tracy.hpp"
#include "client/TracyProfiler.hpp"
#include "client/TracyCallstack.hpp"
namespace tracy
{
class VkCtx
{
friend class VkCtxScope;
enum { QueryCount = 64 * 1024 };
public:
VkCtx( VkPhysicalDevice physdev, VkDevice device, VkQueue queue, VkCommandBuffer cmdbuf )
: m_device( device )
, m_context( GetGpuCtxCounter().fetch_add( 1, std::memory_order_relaxed ) )
, m_head( 0 )
, m_tail( 0 )
, m_oldCnt( 0 )
, m_queryCount( QueryCount )
{
assert( m_context != 255 );
VkPhysicalDeviceProperties prop;
vkGetPhysicalDeviceProperties( physdev, &prop );
const float period = prop.limits.timestampPeriod;
VkQueryPoolCreateInfo poolInfo = {};
poolInfo.sType = VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO;
poolInfo.queryCount = m_queryCount;
poolInfo.queryType = VK_QUERY_TYPE_TIMESTAMP;
while( vkCreateQueryPool( device, &poolInfo, nullptr, &m_query ) != VK_SUCCESS )
{
m_queryCount /= 2;
poolInfo.queryCount = m_queryCount;
}
VkCommandBufferBeginInfo beginInfo = {};
beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
beginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
VkSubmitInfo submitInfo = {};
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
submitInfo.commandBufferCount = 1;
submitInfo.pCommandBuffers = &cmdbuf;
vkBeginCommandBuffer( cmdbuf, &beginInfo );
vkCmdResetQueryPool( cmdbuf, m_query, 0, m_queryCount );
vkEndCommandBuffer( cmdbuf );
vkQueueSubmit( queue, 1, &submitInfo, VK_NULL_HANDLE );
vkQueueWaitIdle( queue );
vkBeginCommandBuffer( cmdbuf, &beginInfo );
vkCmdWriteTimestamp( cmdbuf, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, m_query, 0 );
vkEndCommandBuffer( cmdbuf );
vkQueueSubmit( queue, 1, &submitInfo, VK_NULL_HANDLE );
vkQueueWaitIdle( queue );
int64_t tcpu = Profiler::GetTime();
int64_t tgpu;
vkGetQueryPoolResults( device, m_query, 0, 1, sizeof( tgpu ), &tgpu, sizeof( tgpu ), VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT );
vkBeginCommandBuffer( cmdbuf, &beginInfo );
vkCmdResetQueryPool( cmdbuf, m_query, 0, 1 );
vkEndCommandBuffer( cmdbuf );
vkQueueSubmit( queue, 1, &submitInfo, VK_NULL_HANDLE );
vkQueueWaitIdle( queue );
auto item = Profiler::QueueSerial();
MemWrite( &item->hdr.type, QueueType::GpuNewContext );
MemWrite( &item->gpuNewContext.cpuTime, tcpu );
MemWrite( &item->gpuNewContext.gpuTime, tgpu );
memset( &item->gpuNewContext.thread, 0, sizeof( item->gpuNewContext.thread ) );
MemWrite( &item->gpuNewContext.period, period );
MemWrite( &item->gpuNewContext.context, m_context );
MemWrite( &item->gpuNewContext.accuracyBits, uint8_t( 0 ) );
MemWrite( &item->gpuNewContext.type, GpuContextType::Vulkan );
#ifdef TRACY_ON_DEMAND
GetProfiler().DeferItem( *item );
#endif
Profiler::QueueSerialFinish();
m_res = (int64_t*)tracy_malloc( sizeof( int64_t ) * m_queryCount );
}
~VkCtx()
{
tracy_free( m_res );
vkDestroyQueryPool( m_device, m_query, nullptr );
}
void Collect( VkCommandBuffer cmdbuf )
{
ZoneScopedC( Color::Red4 );
if( m_tail == m_head ) return;
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() )
{
vkCmdResetQueryPool( cmdbuf, m_query, 0, m_queryCount );
m_head = m_tail = 0;
return;
}
#endif
unsigned int cnt;
if( m_oldCnt != 0 )
{
cnt = m_oldCnt;
m_oldCnt = 0;
}
else
{
cnt = m_head < m_tail ? m_queryCount - m_tail : m_head - m_tail;
}
if( vkGetQueryPoolResults( m_device, m_query, m_tail, cnt, sizeof( int64_t ) * m_queryCount, m_res, sizeof( int64_t ), VK_QUERY_RESULT_64_BIT ) == VK_NOT_READY )
{
m_oldCnt = cnt;
return;
}
for( unsigned int idx=0; idx<cnt; idx++ )
{
auto item = Profiler::QueueSerial();
MemWrite( &item->hdr.type, QueueType::GpuTime );
MemWrite( &item->gpuTime.gpuTime, m_res[idx] );
MemWrite( &item->gpuTime.queryId, uint16_t( m_tail + idx ) );
MemWrite( &item->gpuTime.context, m_context );
Profiler::QueueSerialFinish();
}
vkCmdResetQueryPool( cmdbuf, m_query, m_tail, cnt );
m_tail += cnt;
if( m_tail == m_queryCount ) m_tail = 0;
}
private:
tracy_force_inline unsigned int NextQueryId()
{
const auto id = m_head;
m_head = ( m_head + 1 ) % m_queryCount;
assert( m_head != m_tail );
return id;
}
tracy_force_inline uint8_t GetId() const
{
return m_context;
}
VkDevice m_device;
VkQueryPool m_query;
uint8_t m_context;
unsigned int m_head;
unsigned int m_tail;
unsigned int m_oldCnt;
unsigned int m_queryCount;
int64_t* m_res;
};
class VkCtxScope
{
public:
tracy_force_inline VkCtxScope( VkCtx* ctx, const SourceLocationData* srcloc, VkCommandBuffer cmdbuf, bool is_active )
#ifdef TRACY_ON_DEMAND
: m_active( is_active && GetProfiler().IsConnected() )
#else
: m_active( is_active )
#endif
{
if( !m_active ) return;
m_cmdbuf = cmdbuf;
m_ctx = ctx;
const auto queryId = ctx->NextQueryId();
vkCmdWriteTimestamp( cmdbuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, ctx->m_query, queryId );
auto item = Profiler::QueueSerial();
MemWrite( &item->hdr.type, QueueType::GpuZoneBeginSerial );
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
MemWrite( &item->gpuZoneBegin.thread, GetThreadHandle() );
MemWrite( &item->gpuZoneBegin.queryId, uint16_t( queryId ) );
MemWrite( &item->gpuZoneBegin.context, ctx->GetId() );
Profiler::QueueSerialFinish();
}
tracy_force_inline VkCtxScope( VkCtx* ctx, const SourceLocationData* srcloc, VkCommandBuffer cmdbuf, int depth, bool is_active )
#ifdef TRACY_ON_DEMAND
: m_active( is_active && GetProfiler().IsConnected() )
#else
: m_active( is_active )
#endif
{
if( !m_active ) return;
m_cmdbuf = cmdbuf;
m_ctx = ctx;
const auto queryId = ctx->NextQueryId();
vkCmdWriteTimestamp( cmdbuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, ctx->m_query, queryId );
auto item = Profiler::QueueSerial();
MemWrite( &item->hdr.type, QueueType::GpuZoneBeginCallstackSerial );
MemWrite( &item->gpuZoneBegin.cpuTime, Profiler::GetTime() );
MemWrite( &item->gpuZoneBegin.srcloc, (uint64_t)srcloc );
MemWrite( &item->gpuZoneBegin.thread, GetThreadHandle() );
MemWrite( &item->gpuZoneBegin.queryId, uint16_t( queryId ) );
MemWrite( &item->gpuZoneBegin.context, ctx->GetId() );
Profiler::QueueSerialFinish();
GetProfiler().SendCallstack( depth );
}
tracy_force_inline ~VkCtxScope()
{
if( !m_active ) return;
const auto queryId = m_ctx->NextQueryId();
vkCmdWriteTimestamp( m_cmdbuf, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, m_ctx->m_query, queryId );
auto item = Profiler::QueueSerial();
MemWrite( &item->hdr.type, QueueType::GpuZoneEndSerial );
MemWrite( &item->gpuZoneEnd.cpuTime, Profiler::GetTime() );
MemWrite( &item->gpuZoneEnd.thread, GetThreadHandle() );
MemWrite( &item->gpuZoneEnd.queryId, uint16_t( queryId ) );
MemWrite( &item->gpuZoneEnd.context, m_ctx->GetId() );
Profiler::QueueSerialFinish();
}
private:
const bool m_active;
VkCommandBuffer m_cmdbuf;
VkCtx* m_ctx;
};
static inline VkCtx* CreateVkContext( VkPhysicalDevice physdev, VkDevice device, VkQueue queue, VkCommandBuffer cmdbuf )
{
InitRPMallocThread();
auto ctx = (VkCtx*)tracy_malloc( sizeof( VkCtx ) );
new(ctx) VkCtx( physdev, device, queue, cmdbuf );
return ctx;
}
static inline void DestroyVkContext( VkCtx* ctx )
{
ctx->~VkCtx();
tracy_free( ctx );
}
}
using TracyVkCtx = tracy::VkCtx*;
#define TracyVkContext( physdev, device, queue, cmdbuf ) tracy::CreateVkContext( physdev, device, queue, cmdbuf );
#define TracyVkDestroy( ctx ) tracy::DestroyVkContext( ctx );
#if defined TRACY_HAS_CALLSTACK && defined TRACY_CALLSTACK
# define TracyVkNamedZone( ctx, varname, cmdbuf, name, active ) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::VkCtxScope varname( ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), cmdbuf, TRACY_CALLSTACK, active );
# define TracyVkNamedZoneC( ctx, varname, cmdbuf, name, color, active ) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::VkCtxScope varname( ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), cmdbuf, TRACY_CALLSTACK, active );
# define TracyVkZone( ctx, cmdbuf, name ) TracyVkNamedZoneS( ctx, ___tracy_gpu_zone, cmdbuf, name, TRACY_CALLSTACK, true )
# define TracyVkZoneC( ctx, cmdbuf, name, color ) TracyVkNamedZoneCS( ctx, ___tracy_gpu_zone, cmdbuf, name, color, TRACY_CALLSTACK, true )
#else
# define TracyVkNamedZone( ctx, varname, cmdbuf, name, active ) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::VkCtxScope varname( ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), cmdbuf, active );
# define TracyVkNamedZoneC( ctx, varname, cmdbuf, name, color, active ) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::VkCtxScope varname( ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), cmdbuf, active );
# define TracyVkZone( ctx, cmdbuf, name ) TracyVkNamedZone( ctx, ___tracy_gpu_zone, cmdbuf, name, true )
# define TracyVkZoneC( ctx, cmdbuf, name, color ) TracyVkNamedZoneC( ctx, ___tracy_gpu_zone, cmdbuf, name, color, true )
#endif
#define TracyVkCollect( ctx, cmdbuf ) ctx->Collect( cmdbuf );
#ifdef TRACY_HAS_CALLSTACK
# define TracyVkNamedZoneS( ctx, varname, cmdbuf, name, depth, active ) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, 0 }; tracy::VkCtxScope varname( ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), cmdbuf, depth, active );
# define TracyVkNamedZoneCS( ctx, varname, cmdbuf, name, color, depth, active ) static const tracy::SourceLocationData TracyConcat(__tracy_gpu_source_location,__LINE__) { name, __FUNCTION__, __FILE__, (uint32_t)__LINE__, color }; tracy::VkCtxScope varname( ctx, &TracyConcat(__tracy_gpu_source_location,__LINE__), cmdbuf, depth, active );
# define TracyVkZoneS( ctx, cmdbuf, name, depth ) TracyVkNamedZoneS( ctx, ___tracy_gpu_zone, cmdbuf, name, depth, true )
# define TracyVkZoneCS( ctx, cmdbuf, name, color, depth ) TracyVkNamedZoneCS( ctx, ___tracy_gpu_zone, cmdbuf, name, color, depth, true )
#else
# define TracyVkNamedZoneS( ctx, varname, cmdbuf, name, depth, active ) TracyVkNamedZone( ctx, varname, cmdbuf, name, active )
# define TracyVkNamedZoneCS( ctx, varname, cmdbuf, name, color, depth, active ) TracyVkNamedZoneC( ctx, varname, cmdbuf, name, color, active )
# define TracyVkZoneS( ctx, cmdbuf, name, depth ) TracyVkZone( ctx, cmdbuf, name )
# define TracyVkZoneCS( ctx, cmdbuf, name, color, depth ) TracyVkZoneC( ctx, cmdbuf, name, color )
#endif
#endif
#endif

28
capture/CMakeLists.txt Normal file
View File

@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.16)
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
option(NO_STATISTICS "Disable calculation of statistics" ON)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
set(CMAKE_CXX_STANDARD 20)
project(
tracy-capture
LANGUAGES C CXX
VERSION ${TRACY_VERSION_STRING}
)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake)
set(PROGRAM_FILES
src/capture.cpp
)
add_executable(${PROJECT_NAME} ${PROGRAM_FILES} ${COMMON_FILES} ${SERVER_FILES})
target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyGetOpt)
set_property(DIRECTORY ${CMAKE_CURRENT_LIST_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})

View File

@ -1,12 +0,0 @@
all: debug
debug:
@+make -f debug.mk all
release:
@+make -f release.mk all
clean:
@+make -f build.mk clean
.PHONY: all clean debug release

View File

@ -1,60 +0,0 @@
CFLAGS +=
CXXFLAGS := $(CFLAGS) -std=gnu++17
DEFINES += -DTRACY_NO_STATISTICS
INCLUDES := $(shell pkg-config --cflags capstone)
LIBS := $(shell pkg-config --libs capstone) -lpthread
PROJECT := capture
IMAGE := $(PROJECT)-$(BUILD)
FILTER :=
BASE := $(shell egrep 'ClCompile.*cpp"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
BASE2 := $(shell egrep 'ClCompile.*c"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
SRC := $(filter-out $(FILTER),$(BASE))
SRC2 := $(filter-out $(FILTER),$(BASE2))
TBB := $(shell ld -ltbb -o /dev/null 2>/dev/null; echo $$?)
ifeq ($(TBB),0)
LIBS += -ltbb
endif
OBJDIRBASE := obj/$(BUILD)
OBJDIR := $(OBJDIRBASE)/o/o/o
OBJ := $(addprefix $(OBJDIR)/,$(SRC:%.cpp=%.o))
OBJ2 := $(addprefix $(OBJDIR)/,$(SRC2:%.c=%.o))
all: $(IMAGE)
$(OBJDIR)/%.o: %.cpp
$(CXX) -c $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< -o $@
$(OBJDIR)/%.d : %.cpp
@echo Resolving dependencies of $<
@mkdir -p $(@D)
@$(CXX) -MM $(INCLUDES) $(CXXFLAGS) $(DEFINES) $< > $@.$$$$; \
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.cpp=.o) $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
$(OBJDIR)/%.o: %.c
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
$(OBJDIR)/%.d : %.c
@echo Resolving dependencies of $<
@mkdir -p $(@D)
@$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.c=.o) $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
$(IMAGE): $(OBJ) $(OBJ2)
$(CXX) $(CXXFLAGS) $(DEFINES) $(OBJ) $(OBJ2) $(LIBS) -o $@
ifneq "$(MAKECMDGOALS)" "clean"
-include $(addprefix $(OBJDIR)/,$(SRC:.cpp=.d)) $(addprefix $(OBJDIR)/,$(SRC2:.c=.d))
endif
clean:
rm -rf $(OBJDIRBASE) $(IMAGE)*
.PHONY: clean all

View File

@ -1,11 +0,0 @@
ARCH := $(shell uname -m)
CFLAGS := -g3 -Wall
DEFINES := -DDEBUG
BUILD := debug
ifeq ($(ARCH),x86_64)
CFLAGS += -msse4.1
endif
include build.mk

View File

@ -1,7 +0,0 @@
ARCH := $(shell uname -m)
CFLAGS := -O3 -s -march=native
DEFINES := -DNDEBUG
BUILD := release
include build.mk

View File

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27428.2002
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "capture", "capture.vcxproj", "{447D58BF-94CD-4469-BB90-549C05D03E00}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x64.ActiveCfg = Debug|x64
{447D58BF-94CD-4469-BB90-549C05D03E00}.Debug|x64.Build.0 = Debug|x64
{447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x64.ActiveCfg = Release|x64
{447D58BF-94CD-4469-BB90-549C05D03E00}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3E51386C-43EA-44AC-9F24-AFAFE4D63ADE}
EndGlobalSection
EndGlobal

View File

@ -1,235 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>15.0</VCProjectVersion>
<ProjectGuid>{447D58BF-94CD-4469-BB90-549C05D03E00}</ProjectGuid>
<RootNamespace>capture</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<VcpkgTriplet>x64-windows-static</VcpkgTriplet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>TRACY_NO_STATISTICS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>..\..\..\vcpkg\vcpkg\installed\x64-windows-static\debug\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>TRACY_NO_STATISTICS;NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;WIN32_LEAN_AND_MEAN;NOMINMAX;_USE_MATH_DEFINES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions2</EnableEnhancedInstructionSet>
<LanguageStandard>stdcpplatest</LanguageStandard>
<AdditionalIncludeDirectories>..\..\..\vcpkg\vcpkg\installed\x64-windows-static\include</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>..\..\..\vcpkg\vcpkg\installed\x64-windows-static\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\common\TracySocket.cpp" />
<ClCompile Include="..\..\..\common\TracySystem.cpp" />
<ClCompile Include="..\..\..\common\tracy_lz4.cpp" />
<ClCompile Include="..\..\..\common\tracy_lz4hc.cpp" />
<ClCompile Include="..\..\..\server\TracyMemory.cpp" />
<ClCompile Include="..\..\..\server\TracyMmap.cpp" />
<ClCompile Include="..\..\..\server\TracyPrint.cpp" />
<ClCompile Include="..\..\..\server\TracyTaskDispatch.cpp" />
<ClCompile Include="..\..\..\server\TracyTextureCompression.cpp" />
<ClCompile Include="..\..\..\server\TracyThreadCompress.cpp" />
<ClCompile Include="..\..\..\server\TracyWorker.cpp" />
<ClCompile Include="..\..\..\zstd\debug.c" />
<ClCompile Include="..\..\..\zstd\entropy_common.c" />
<ClCompile Include="..\..\..\zstd\error_private.c" />
<ClCompile Include="..\..\..\zstd\fse_compress.c" />
<ClCompile Include="..\..\..\zstd\fse_decompress.c" />
<ClCompile Include="..\..\..\zstd\hist.c" />
<ClCompile Include="..\..\..\zstd\huf_compress.c" />
<ClCompile Include="..\..\..\zstd\huf_decompress.c" />
<ClCompile Include="..\..\..\zstd\pool.c" />
<ClCompile Include="..\..\..\zstd\threading.c" />
<ClCompile Include="..\..\..\zstd\xxhash.c" />
<ClCompile Include="..\..\..\zstd\zstdmt_compress.c" />
<ClCompile Include="..\..\..\zstd\zstd_common.c" />
<ClCompile Include="..\..\..\zstd\zstd_compress.c" />
<ClCompile Include="..\..\..\zstd\zstd_compress_literals.c" />
<ClCompile Include="..\..\..\zstd\zstd_compress_sequences.c" />
<ClCompile Include="..\..\..\zstd\zstd_compress_superblock.c" />
<ClCompile Include="..\..\..\zstd\zstd_ddict.c" />
<ClCompile Include="..\..\..\zstd\zstd_decompress.c" />
<ClCompile Include="..\..\..\zstd\zstd_decompress_block.c" />
<ClCompile Include="..\..\..\zstd\zstd_double_fast.c" />
<ClCompile Include="..\..\..\zstd\zstd_fast.c" />
<ClCompile Include="..\..\..\zstd\zstd_lazy.c" />
<ClCompile Include="..\..\..\zstd\zstd_ldm.c" />
<ClCompile Include="..\..\..\zstd\zstd_opt.c" />
<ClCompile Include="..\..\src\capture.cpp" />
<ClCompile Include="..\..\src\getopt.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\common\TracyAlign.hpp" />
<ClInclude Include="..\..\..\common\TracyAlloc.hpp" />
<ClInclude Include="..\..\..\common\TracyColor.hpp" />
<ClInclude Include="..\..\..\common\TracyForceInline.hpp" />
<ClInclude Include="..\..\..\common\TracyProtocol.hpp" />
<ClInclude Include="..\..\..\common\TracyQueue.hpp" />
<ClInclude Include="..\..\..\common\TracySocket.hpp" />
<ClInclude Include="..\..\..\common\TracySystem.hpp" />
<ClInclude Include="..\..\..\common\tracy_lz4.hpp" />
<ClInclude Include="..\..\..\common\tracy_lz4hc.hpp" />
<ClInclude Include="..\..\..\server\TracyCharUtil.hpp" />
<ClInclude Include="..\..\..\server\TracyEvent.hpp" />
<ClInclude Include="..\..\..\server\TracyFileRead.hpp" />
<ClInclude Include="..\..\..\server\TracyFileWrite.hpp" />
<ClInclude Include="..\..\..\server\TracyMemory.hpp" />
<ClInclude Include="..\..\..\server\TracyMmap.hpp" />
<ClInclude Include="..\..\..\server\TracyPopcnt.hpp" />
<ClInclude Include="..\..\..\server\TracyPrint.hpp" />
<ClInclude Include="..\..\..\server\TracySlab.hpp" />
<ClInclude Include="..\..\..\server\TracyTaskDispatch.hpp" />
<ClInclude Include="..\..\..\server\TracyTextureCompression.hpp" />
<ClInclude Include="..\..\..\server\TracyThreadCompress.hpp" />
<ClInclude Include="..\..\..\server\TracyVector.hpp" />
<ClInclude Include="..\..\..\server\TracyWorker.hpp" />
<ClInclude Include="..\..\..\zstd\bitstream.h" />
<ClInclude Include="..\..\..\zstd\compiler.h" />
<ClInclude Include="..\..\..\zstd\cpu.h" />
<ClInclude Include="..\..\..\zstd\debug.h" />
<ClInclude Include="..\..\..\zstd\error_private.h" />
<ClInclude Include="..\..\..\zstd\fse.h" />
<ClInclude Include="..\..\..\zstd\hist.h" />
<ClInclude Include="..\..\..\zstd\huf.h" />
<ClInclude Include="..\..\..\zstd\mem.h" />
<ClInclude Include="..\..\..\zstd\pool.h" />
<ClInclude Include="..\..\..\zstd\threading.h" />
<ClInclude Include="..\..\..\zstd\xxhash.h" />
<ClInclude Include="..\..\..\zstd\zstd.h" />
<ClInclude Include="..\..\..\zstd\zstdmt_compress.h" />
<ClInclude Include="..\..\..\zstd\zstd_compress_internal.h" />
<ClInclude Include="..\..\..\zstd\zstd_compress_literals.h" />
<ClInclude Include="..\..\..\zstd\zstd_compress_sequences.h" />
<ClInclude Include="..\..\..\zstd\zstd_compress_superblock.h" />
<ClInclude Include="..\..\..\zstd\zstd_cwksp.h" />
<ClInclude Include="..\..\..\zstd\zstd_ddict.h" />
<ClInclude Include="..\..\..\zstd\zstd_decompress_block.h" />
<ClInclude Include="..\..\..\zstd\zstd_decompress_internal.h" />
<ClInclude Include="..\..\..\zstd\zstd_double_fast.h" />
<ClInclude Include="..\..\..\zstd\zstd_errors.h" />
<ClInclude Include="..\..\..\zstd\zstd_fast.h" />
<ClInclude Include="..\..\..\zstd\zstd_internal.h" />
<ClInclude Include="..\..\..\zstd\zstd_lazy.h" />
<ClInclude Include="..\..\..\zstd\zstd_ldm.h" />
<ClInclude Include="..\..\..\zstd\zstd_opt.h" />
<ClInclude Include="..\..\src\getopt.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,297 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="src">
<UniqueIdentifier>{729c80ee-4d26-4a5e-8f1f-6c075783eb56}</UniqueIdentifier>
</Filter>
<Filter Include="server">
<UniqueIdentifier>{cf23ef7b-7694-4154-830b-00cf053350ea}</UniqueIdentifier>
</Filter>
<Filter Include="common">
<UniqueIdentifier>{e39d3623-47cd-4752-8da9-3ea324f964c1}</UniqueIdentifier>
</Filter>
<Filter Include="zstd">
<UniqueIdentifier>{043ecb94-f240-4986-94b0-bc5bbd415a82}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\common\tracy_lz4.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\common\TracySocket.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\common\TracySystem.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyMemory.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyWorker.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\src\capture.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\src\getopt.c">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\common\tracy_lz4hc.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyPrint.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyThreadCompress.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyTaskDispatch.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\debug.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\entropy_common.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\error_private.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\fse_compress.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\fse_decompress.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\hist.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\huf_compress.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\huf_decompress.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\pool.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\threading.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\xxhash.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_common.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_compress.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_compress_literals.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_compress_sequences.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_compress_superblock.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_ddict.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_decompress.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_decompress_block.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_double_fast.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_fast.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_lazy.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_ldm.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstd_opt.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\zstdmt_compress.c">
<Filter>zstd</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyMmap.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyTextureCompression.cpp">
<Filter>server</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\common\tracy_lz4.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\TracyAlloc.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\TracyColor.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\TracyForceInline.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\TracyProtocol.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\TracyQueue.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\TracySocket.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\TracySystem.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyCharUtil.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyEvent.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyFileWrite.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyMemory.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyPopcnt.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracySlab.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyVector.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyWorker.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\src\getopt.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\TracyAlign.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\common\tracy_lz4hc.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyPrint.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyThreadCompress.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyTaskDispatch.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\bitstream.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compiler.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\cpu.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\debug.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\error_private.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\fse.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\hist.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\huf.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\mem.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\pool.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\threading.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\xxhash.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_compress_internal.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_compress_literals.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_compress_sequences.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_compress_superblock.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_cwksp.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_ddict.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_decompress_block.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_decompress_internal.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_double_fast.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_errors.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_fast.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_internal.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_lazy.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_ldm.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_opt.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstdmt_compress.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyFileRead.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyMmap.hpp">
<Filter>server</Filter>
</ClInclude>
<ClInclude Include="..\..\..\server\TracyTextureCompression.hpp">
<Filter>server</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -1,33 +1,98 @@
#ifdef _WIN32 #ifdef _WIN32
# include <windows.h> # include <windows.h>
# include <io.h>
#else
# include <unistd.h>
#endif #endif
#include <atomic>
#include <chrono> #include <chrono>
#include <inttypes.h> #include <inttypes.h>
#include <mutex> #include <mutex>
#include <signal.h> #include <signal.h>
#include <stdarg.h>
#include <stdint.h> #include <stdint.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/stat.h>
#include "../../common/TracyProtocol.hpp" #include "../../public/common/TracyProtocol.hpp"
#include "../../public/common/TracyStackFrames.hpp"
#include "../../server/TracyFileWrite.hpp" #include "../../server/TracyFileWrite.hpp"
#include "../../server/TracyMemory.hpp" #include "../../server/TracyMemory.hpp"
#include "../../server/TracyPrint.hpp" #include "../../server/TracyPrint.hpp"
#include "../../server/TracySysUtil.hpp"
#include "../../server/TracyWorker.hpp" #include "../../server/TracyWorker.hpp"
#include "getopt.h"
#ifdef _WIN32
# include "../../getopt/getopt.h"
#endif
bool disconnect = false; // This atomic is written by a signal handler (SigInt). Traditionally that would
// have had to be `volatile sig_atomic_t`, and annoyingly, `bool` was
// technically not allowed there, even though in practice it would work.
// The good thing with C++11 atomics is that we can use atomic<bool> instead
// here and be on the actually supported path.
static std::atomic<bool> s_disconnect { false };
void SigInt( int ) void SigInt( int )
{ {
disconnect = true; // Relaxed order is closest to a traditional `volatile` write.
// We don't need stronger ordering since this signal handler doesn't do
// anything else that would need to be ordered relatively to this.
s_disconnect.store(true, std::memory_order_relaxed);
} }
void Usage() static bool s_isStdoutATerminal = false;
void InitIsStdoutATerminal() {
#ifdef _WIN32
s_isStdoutATerminal = _isatty( fileno( stdout ) );
#else
s_isStdoutATerminal = isatty( fileno( stdout ) );
#endif
}
bool IsStdoutATerminal() { return s_isStdoutATerminal; }
#define ANSI_RESET "\033[0m"
#define ANSI_BOLD "\033[1m"
#define ANSI_BLACK "\033[30m"
#define ANSI_RED "\033[31m"
#define ANSI_GREEN "\033[32m"
#define ANSI_YELLOW "\033[33m"
#define ANSI_BLUE "\033[34m"
#define ANSI_MAGENTA "\033[35m"
#define ANSI_CYAN "\033[36m"
#define ANSI_ERASE_LINE "\033[2K"
// Like printf, but if stdout is a terminal, prepends the output with
// the given `ansiEscape` and appends ANSI_RESET.
void AnsiPrintf( const char* ansiEscape, const char* format, ... ) {
if( IsStdoutATerminal() )
{
// Prepend ansiEscape and append ANSI_RESET.
char buf[256];
va_list args;
va_start( args, format );
vsnprintf( buf, sizeof buf, format, args );
va_end( args );
printf( "%s%s" ANSI_RESET, ansiEscape, buf );
}
else
{
// Just a normal printf.
va_list args;
va_start( args, format );
vfprintf( stdout, format, args );
va_end( args );
}
}
[[noreturn]] void Usage()
{ {
printf( "Usage: capture -o output.tracy [-a address] [-p port]\n" ); printf( "Usage: capture -o output.tracy [-a address] [-p port] [-f] [-s seconds] [-m memlimit]\n" );
exit( 1 ); exit( 1 );
} }
@ -41,12 +106,17 @@ int main( int argc, char** argv )
} }
#endif #endif
const char* address = "localhost"; InitIsStdoutATerminal();
bool overwrite = false;
const char* address = "127.0.0.1";
const char* output = nullptr; const char* output = nullptr;
int port = 8086; int port = 8086;
int seconds = -1;
int64_t memoryLimit = -1;
int c; int c;
while( ( c = getopt( argc, argv, "a:o:p:" ) ) != -1 ) while( ( c = getopt( argc, argv, "a:o:p:fs:m:" ) ) != -1 )
{ {
switch( c ) switch( c )
{ {
@ -59,6 +129,15 @@ int main( int argc, char** argv )
case 'p': case 'p':
port = atoi( optarg ); port = atoi( optarg );
break; break;
case 'f':
overwrite = true;
break;
case 's':
seconds = atoi(optarg);
break;
case 'm':
memoryLimit = std::clamp( atoll( optarg ), 1ll, 999ll ) * tracy::GetPhysicalMemorySize() / 100;
break;
default: default:
Usage(); Usage();
break; break;
@ -67,10 +146,26 @@ int main( int argc, char** argv )
if( !address || !output ) Usage(); if( !address || !output ) Usage();
struct stat st;
if( stat( output, &st ) == 0 && !overwrite )
{
printf( "Output file %s already exists! Use -f to force overwrite.\n", output );
return 4;
}
FILE* test = fopen( output, "wb" );
if( !test )
{
printf( "Cannot open output file %s for writing!\n", output );
return 5;
}
fclose( test );
unlink( output );
printf( "Connecting to %s:%i...", address, port ); printf( "Connecting to %s:%i...", address, port );
fflush( stdout ); fflush( stdout );
tracy::Worker worker( address, port ); tracy::Worker worker( address, port, memoryLimit );
while( !worker.IsConnected() ) while( !worker.HasData() )
{ {
const auto handshake = worker.GetHandshakeStatus(); const auto handshake = worker.GetHandshakeStatus();
if( handshake == tracy::HandshakeProtocolMismatch ) if( handshake == tracy::HandshakeProtocolMismatch )
@ -88,8 +183,8 @@ int main( int argc, char** argv )
printf( "\nThe client you are trying to connect to has disconnected during the initial\nconnection handshake. Please check your network configuration.\n" ); printf( "\nThe client you are trying to connect to has disconnected during the initial\nconnection handshake. Please check your network configuration.\n" );
return 3; return 3;
} }
std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
} }
while( !worker.HasData() ) std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
printf( "\nQueue delay: %s\nTimer resolution: %s\n", tracy::TimeToString( worker.GetDelay() ), tracy::TimeToString( worker.GetResolution() ) ); printf( "\nQueue delay: %s\nTimer resolution: %s\n", tracy::TimeToString( worker.GetDelay() ), tracy::TimeToString( worker.GetResolution() ) );
#ifdef _WIN32 #ifdef _WIN32
@ -101,15 +196,22 @@ int main( int argc, char** argv )
sigaction( SIGINT, &sigint, &oldsigint ); sigaction( SIGINT, &sigint, &oldsigint );
#endif #endif
const auto firstTime = worker.GetFirstTime();
auto& lock = worker.GetMbpsDataLock(); auto& lock = worker.GetMbpsDataLock();
const auto t0 = std::chrono::high_resolution_clock::now(); const auto t0 = std::chrono::high_resolution_clock::now();
while( worker.IsConnected() ) while( worker.IsConnected() )
{ {
if( disconnect ) // Relaxed order is sufficient here because `s_disconnect` is only ever
// set by this thread or by the SigInt handler, and that handler does
// nothing else than storing `s_disconnect`.
if( s_disconnect.load( std::memory_order_relaxed ) )
{ {
worker.Disconnect(); worker.Disconnect();
disconnect = false; // Relaxed order is sufficient because only this thread ever reads
// this value.
s_disconnect.store(false, std::memory_order_relaxed );
break;
} }
lock.lock(); lock.lock();
@ -118,48 +220,144 @@ int main( int argc, char** argv )
const auto netTotal = worker.GetDataTransferred(); const auto netTotal = worker.GetDataTransferred();
lock.unlock(); lock.unlock();
if( mbps < 0.1f ) // Output progress info only if destination is a TTY to avoid bloating
// log files (so this is not just about usage of ANSI color codes).
if( IsStdoutATerminal() )
{ {
printf( "\33[2K\r\033[36;1m%7.2f Kbps", mbps * 1000.f ); const char* unit = "Mbps";
float unitsPerMbps = 1.f;
if( mbps < 0.1f )
{
unit = "Kbps";
unitsPerMbps = 1000.f;
}
AnsiPrintf( ANSI_ERASE_LINE ANSI_CYAN ANSI_BOLD, "\r%7.2f %s", mbps * unitsPerMbps, unit );
printf( " /");
AnsiPrintf( ANSI_CYAN ANSI_BOLD, "%5.1f%%", compRatio * 100.f );
printf( " =");
AnsiPrintf( ANSI_YELLOW ANSI_BOLD, "%7.2f Mbps", mbps / compRatio );
printf( " | ");
AnsiPrintf( ANSI_YELLOW, "Tx: ");
AnsiPrintf( ANSI_GREEN, "%s", tracy::MemSizeToString( netTotal ) );
printf( " | ");
AnsiPrintf( ANSI_RED ANSI_BOLD, "%s", tracy::MemSizeToString( tracy::memUsage.load( std::memory_order_relaxed ) ) );
if( memoryLimit > 0 )
{
printf( " / " );
AnsiPrintf( ANSI_BLUE ANSI_BOLD, "%s", tracy::MemSizeToString( memoryLimit ) );
}
printf( " | ");
AnsiPrintf( ANSI_RED, "%s", tracy::TimeToString( worker.GetLastTime() - firstTime ) );
fflush( stdout );
} }
else
{
printf( "\33[2K\r\033[36;1m%7.2f Mbps", mbps );
}
printf( " \033[0m /\033[36;1m%5.1f%% \033[0m=\033[33;1m%7.2f Mbps \033[0m| \033[33mNet: \033[32m%s \033[0m| \033[33mMem: \033[31;1m%s\033[0m | \033[33mTime: %s\033[0m",
compRatio * 100.f,
mbps / compRatio,
tracy::MemSizeToString( netTotal ),
tracy::MemSizeToString( tracy::memUsage ),
tracy::TimeToString( worker.GetLastTime() ) );
fflush( stdout );
std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) ); std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) );
if( seconds != -1 )
{
const auto dur = std::chrono::high_resolution_clock::now() - t0;
if( std::chrono::duration_cast<std::chrono::seconds>(dur).count() >= seconds )
{
// Relaxed order is sufficient because only this thread ever reads
// this value.
s_disconnect.store(true, std::memory_order_relaxed );
}
}
} }
const auto t1 = std::chrono::high_resolution_clock::now(); const auto t1 = std::chrono::high_resolution_clock::now();
const auto& failure = worker.GetFailureType(); const auto& failure = worker.GetFailureType();
if( failure != tracy::Worker::Failure::None ) if( failure != tracy::Worker::Failure::None )
{ {
printf( "\n\033[31;1mInstrumentation failure: %s\033[0m", tracy::Worker::GetFailureString( failure ) ); AnsiPrintf( ANSI_RED ANSI_BOLD, "\nInstrumentation failure: %s", tracy::Worker::GetFailureString( failure ) );
auto& fd = worker.GetFailureData();
if( !fd.message.empty() )
{
printf( "\nContext: %s", fd.message.c_str() );
}
if( fd.callstack != 0 )
{
AnsiPrintf( ANSI_BOLD, "\nFailure callstack:\n" );
auto& cs = worker.GetCallstack( fd.callstack );
int fidx = 0;
for( auto& entry : cs )
{
auto frameData = worker.GetCallstackFrame( entry );
if( !frameData )
{
printf( "%3i. %p\n", fidx++, (void*)worker.GetCanonicalPointer( entry ) );
}
else
{
const auto fsz = frameData->size;
for( uint8_t f=0; f<fsz; f++ )
{
const auto& frame = frameData->data[f];
auto txt = worker.GetString( frame.name );
if( fidx == 0 && f != fsz-1 )
{
auto test = tracy::s_tracyStackFrames;
bool match = false;
do
{
if( strcmp( txt, *test ) == 0 )
{
match = true;
break;
}
}
while( *++test );
if( match ) continue;
}
if( f == fsz-1 )
{
printf( "%3i. ", fidx++ );
}
else
{
AnsiPrintf( ANSI_BLACK ANSI_BOLD, "inl. " );
}
AnsiPrintf( ANSI_CYAN, "%s ", txt );
txt = worker.GetString( frame.file );
if( frame.line == 0 )
{
AnsiPrintf( ANSI_YELLOW, "(%s)", txt );
}
else
{
AnsiPrintf( ANSI_YELLOW, "(%s:%" PRIu32 ")", txt, frame.line );
}
if( frameData->imageName.Active() )
{
AnsiPrintf( ANSI_MAGENTA, " %s\n", worker.GetString( frameData->imageName ) );
}
else
{
printf( "\n" );
}
}
}
}
}
} }
printf( "\nFrames: %" PRIu64 "\nTime span: %s\nZones: %s\nElapsed time: %s\nSaving trace...", printf( "\nFrames: %" PRIu64 "\nTime span: %s\nZones: %s\nElapsed time: %s\nSaving trace...",
worker.GetFrameCount( *worker.GetFramesBase() ), tracy::TimeToString( worker.GetLastTime() ), tracy::RealToString( worker.GetZoneCount() ), worker.GetFrameCount( *worker.GetFramesBase() ), tracy::TimeToString( worker.GetLastTime() - firstTime ), tracy::RealToString( worker.GetZoneCount() ),
tracy::TimeToString( std::chrono::duration_cast<std::chrono::nanoseconds>( t1 - t0 ).count() ) ); tracy::TimeToString( std::chrono::duration_cast<std::chrono::nanoseconds>( t1 - t0 ).count() ) );
fflush( stdout ); fflush( stdout );
auto f = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output ) ); auto f = std::unique_ptr<tracy::FileWrite>( tracy::FileWrite::Open( output, tracy::FileCompression::Zstd, 3, 4 ) );
if( f ) if( f )
{ {
worker.Write( *f ); worker.Write( *f, false );
printf( " \033[32;1mdone!\033[0m\n" ); AnsiPrintf( ANSI_GREEN ANSI_BOLD, " done!\n" );
f->Finish(); f->Finish();
const auto stats = f->GetCompressionStatistics(); const auto stats = f->GetCompressionStatistics();
printf( "Trace size %s (%.2f%% ratio)\n", tracy::MemSizeToString( stats.second ), 100.f * stats.second / stats.first ); printf( "Trace size %s (%.2f%% ratio)\n", tracy::MemSizeToString( stats.second ), 100.f * stats.second / stats.first );
} }
else else
{ {
printf( " \033[31;1failed!\033[0m\n" ); AnsiPrintf( ANSI_RED ANSI_BOLD, " failed!\n");
} }
return 0; return 0;

View File

@ -1,741 +0,0 @@
#include <new>
#include <stdio.h>
#include <string.h>
#include "TracyCallstack.hpp"
#include "TracyFastVector.hpp"
#include "../common/TracyAlloc.hpp"
#ifdef TRACY_HAS_CALLSTACK
#if TRACY_HAS_CALLSTACK == 1
# ifndef NOMINMAX
# define NOMINMAX
# endif
# include <windows.h>
# include <psapi.h>
# ifdef _MSC_VER
# pragma warning( push )
# pragma warning( disable : 4091 )
# endif
# include <dbghelp.h>
# ifdef _MSC_VER
# pragma warning( pop )
# endif
#elif TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6
# include "../libbacktrace/backtrace.hpp"
# include <dlfcn.h>
# include <cxxabi.h>
#elif TRACY_HAS_CALLSTACK == 5
# include <dlfcn.h>
# include <cxxabi.h>
#endif
namespace tracy
{
static inline char* CopyString( const char* src, size_t sz )
{
assert( strlen( src ) == sz );
auto dst = (char*)tracy_malloc( sz + 1 );
memcpy( dst, src, sz );
dst[sz] = '\0';
return dst;
}
static inline char* CopyString( const char* src )
{
const auto sz = strlen( src );
auto dst = (char*)tracy_malloc( sz + 1 );
memcpy( dst, src, sz );
dst[sz] = '\0';
return dst;
}
#if TRACY_HAS_CALLSTACK == 1
enum { MaxCbTrace = 16 };
enum { MaxNameSize = 8*1024 };
int cb_num;
CallstackEntry cb_data[MaxCbTrace];
extern "C"
{
typedef unsigned long (__stdcall *t_RtlWalkFrameChain)( void**, unsigned long, unsigned long );
t_RtlWalkFrameChain RtlWalkFrameChain = 0;
}
#if defined __MINGW32__ && API_VERSION_NUMBER < 12
extern "C" {
// Actual required API_VERSION_NUMBER is unknown because it is undocumented. These functions are not present in at least v11.
DWORD IMAGEAPI SymAddrIncludeInlineTrace(HANDLE hProcess, DWORD64 Address);
BOOL IMAGEAPI SymQueryInlineTrace(HANDLE hProcess, DWORD64 StartAddress, DWORD StartContext, DWORD64 StartRetAddress,
DWORD64 CurAddress, LPDWORD CurContext, LPDWORD CurFrameIndex);
BOOL IMAGEAPI SymFromInlineContext(HANDLE hProcess, DWORD64 Address, ULONG InlineContext, PDWORD64 Displacement,
PSYMBOL_INFO Symbol);
BOOL IMAGEAPI SymGetLineFromInlineContext(HANDLE hProcess, DWORD64 qwAddr, ULONG InlineContext,
DWORD64 qwModuleBaseAddress, PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line64);
};
#endif
#ifndef __CYGWIN__
struct ModuleCache
{
uint64_t start;
uint64_t end;
char* name;
};
static FastVector<ModuleCache>* s_modCache;
#endif
void InitCallstack()
{
RtlWalkFrameChain = (t_RtlWalkFrameChain)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "RtlWalkFrameChain" );
SymInitialize( GetCurrentProcess(), nullptr, true );
SymSetOptions( SYMOPT_LOAD_LINES );
#ifndef __CYGWIN__
HMODULE mod[1024];
DWORD needed;
HANDLE proc = GetCurrentProcess();
s_modCache = (FastVector<ModuleCache>*)tracy_malloc( sizeof( FastVector<ModuleCache> ) );
new(s_modCache) FastVector<ModuleCache>( 512 );
if( EnumProcessModules( proc, mod, sizeof( mod ), &needed ) != 0 )
{
const auto sz = needed / sizeof( HMODULE );
for( size_t i=0; i<sz; i++ )
{
MODULEINFO info;
if( GetModuleInformation( proc, mod[i], &info, sizeof( info ) ) != 0 )
{
const auto base = uint64_t( info.lpBaseOfDll );
char name[1024];
const auto res = GetModuleFileNameA( mod[i], name, 1021 );
if( res > 0 )
{
auto ptr = name + res;
while( ptr > name && *ptr != '\\' && *ptr != '/' ) ptr--;
if( ptr > name ) ptr++;
const auto namelen = name + res - ptr;
auto cache = s_modCache->push_next();
cache->start = base;
cache->end = base + info.SizeOfImage;
cache->name = (char*)tracy_malloc( namelen+3 );
cache->name[0] = '[';
memcpy( cache->name+1, ptr, namelen );
cache->name[namelen+1] = ']';
cache->name[namelen+2] = '\0';
}
}
}
}
#endif
}
TRACY_API uintptr_t* CallTrace( int depth )
{
auto trace = (uintptr_t*)tracy_malloc( ( 1 + depth ) * sizeof( uintptr_t ) );
const auto num = RtlWalkFrameChain( (void**)( trace + 1 ), depth, 0 );
*trace = num;
return trace;
}
const char* DecodeCallstackPtrFast( uint64_t ptr )
{
static char ret[MaxNameSize];
const auto proc = GetCurrentProcess();
char buf[sizeof( SYMBOL_INFO ) + MaxNameSize];
auto si = (SYMBOL_INFO*)buf;
si->SizeOfStruct = sizeof( SYMBOL_INFO );
si->MaxNameLen = MaxNameSize;
if( SymFromAddr( proc, ptr, nullptr, si ) == 0 )
{
*ret = '\0';
}
else
{
memcpy( ret, si->Name, si->NameLen );
ret[si->NameLen] = '\0';
}
return ret;
}
static const char* GetModuleName( uint64_t addr )
{
if( ( addr & 0x8000000000000000 ) != 0 ) return "[kernel]";
#ifndef __CYGWIN__
for( auto& v : *s_modCache )
{
if( addr >= v.start && addr < v.end )
{
return v.name;
}
}
HMODULE mod[1024];
DWORD needed;
HANDLE proc = GetCurrentProcess();
if( EnumProcessModules( proc, mod, sizeof( mod ), &needed ) != 0 )
{
const auto sz = needed / sizeof( HMODULE );
for( size_t i=0; i<sz; i++ )
{
MODULEINFO info;
if( GetModuleInformation( proc, mod[i], &info, sizeof( info ) ) != 0 )
{
const auto base = uint64_t( info.lpBaseOfDll );
if( addr >= base && addr < base + info.SizeOfImage )
{
char name[1024];
const auto res = GetModuleFileNameA( mod[i], name, 1021 );
if( res > 0 )
{
auto ptr = name + res;
while( ptr > name && *ptr != '\\' && *ptr != '/' ) ptr--;
if( ptr > name ) ptr++;
const auto namelen = name + res - ptr;
auto cache = s_modCache->push_next();
cache->start = base;
cache->end = base + info.SizeOfImage;
cache->name = (char*)tracy_malloc( namelen+3 );
cache->name[0] = '[';
memcpy( cache->name+1, ptr, namelen );
cache->name[namelen+1] = ']';
cache->name[namelen+2] = '\0';
return cache->name;
}
}
}
}
}
#endif
return "[unknown]";
}
SymbolData DecodeSymbolAddress( uint64_t ptr )
{
SymbolData sym;
IMAGEHLP_LINE64 line;
DWORD displacement = 0;
line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
if( SymGetLineFromAddr64( GetCurrentProcess(), ptr, &displacement, &line ) == 0 )
{
sym.file = "[unknown]";
sym.line = 0;
}
else
{
sym.file = line.FileName;
sym.line = line.LineNumber;
}
sym.needFree = false;
return sym;
}
SymbolData DecodeCodeAddress( uint64_t ptr )
{
SymbolData sym;
const auto proc = GetCurrentProcess();
bool done = false;
IMAGEHLP_LINE64 line;
DWORD displacement = 0;
line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
#ifndef __CYGWIN__
DWORD inlineNum = SymAddrIncludeInlineTrace( proc, ptr );
DWORD ctx = 0;
DWORD idx;
BOOL doInline = FALSE;
if( inlineNum != 0 ) doInline = SymQueryInlineTrace( proc, ptr, 0, ptr, ptr, &ctx, &idx );
if( doInline )
{
if( SymGetLineFromInlineContext( proc, ptr, ctx, 0, &displacement, &line ) != 0 )
{
sym.file = line.FileName;
sym.line = line.LineNumber;
done = true;
}
}
#endif
if( !done )
{
if( SymGetLineFromAddr64( proc, ptr, &displacement, &line ) == 0 )
{
sym.file = "[unknown]";
sym.line = 0;
}
else
{
sym.file = line.FileName;
sym.line = line.LineNumber;
}
}
sym.needFree = false;
return sym;
}
CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
{
int write;
const auto proc = GetCurrentProcess();
#ifndef __CYGWIN__
DWORD inlineNum = SymAddrIncludeInlineTrace( proc, ptr );
if( inlineNum > MaxCbTrace - 1 ) inlineNum = MaxCbTrace - 1;
DWORD ctx = 0;
DWORD idx;
BOOL doInline = FALSE;
if( inlineNum != 0 ) doInline = SymQueryInlineTrace( proc, ptr, 0, ptr, ptr, &ctx, &idx );
if( doInline )
{
write = inlineNum;
cb_num = 1 + inlineNum;
}
else
#endif
{
write = 0;
cb_num = 1;
}
char buf[sizeof( SYMBOL_INFO ) + MaxNameSize];
auto si = (SYMBOL_INFO*)buf;
si->SizeOfStruct = sizeof( SYMBOL_INFO );
si->MaxNameLen = MaxNameSize;
const auto moduleName = GetModuleName( ptr );
const auto symValid = SymFromAddr( proc, ptr, nullptr, si ) != 0;
IMAGEHLP_LINE64 line;
DWORD displacement = 0;
line.SizeOfStruct = sizeof(IMAGEHLP_LINE64);
{
const char* filename;
if( SymGetLineFromAddr64( proc, ptr, &displacement, &line ) == 0 )
{
filename = "[unknown]";
cb_data[write].line = 0;
}
else
{
filename = line.FileName;
cb_data[write].line = line.LineNumber;
}
cb_data[write].name = symValid ? CopyString( si->Name, si->NameLen ) : CopyString( moduleName );
cb_data[write].file = CopyString( filename );
if( symValid )
{
cb_data[write].symLen = si->Size;
cb_data[write].symAddr = si->Address;
}
else
{
cb_data[write].symLen = 0;
cb_data[write].symAddr = 0;
}
}
#ifndef __CYGWIN__
if( doInline )
{
for( DWORD i=0; i<inlineNum; i++ )
{
auto& cb = cb_data[i];
const auto symInlineValid = SymFromInlineContext( proc, ptr, ctx, nullptr, si ) != 0;
const char* filename;
if( SymGetLineFromInlineContext( proc, ptr, ctx, 0, &displacement, &line ) == 0 )
{
filename = "[unknown]";
cb.line = 0;
}
else
{
filename = line.FileName;
cb.line = line.LineNumber;
}
cb.name = symInlineValid ? CopyString( si->Name, si->NameLen ) : CopyString( moduleName );
cb.file = CopyString( filename );
if( symInlineValid )
{
cb.symLen = si->Size;
cb.symAddr = si->Address;
}
else
{
cb.symLen = 0;
cb.symAddr = 0;
}
ctx++;
}
}
#endif
return { cb_data, uint8_t( cb_num ), moduleName };
}
#elif TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6
enum { MaxCbTrace = 16 };
struct backtrace_state* cb_bts;
int cb_num;
CallstackEntry cb_data[MaxCbTrace];
int cb_fixup;
void InitCallstack()
{
cb_bts = backtrace_create_state( nullptr, 0, nullptr, nullptr );
}
static int FastCallstackDataCb( void* data, uintptr_t pc, uintptr_t lowaddr, const char* fn, int lineno, const char* function )
{
if( function )
{
strcpy( (char*)data, function );
}
else
{
const char* symname = nullptr;
auto vptr = (void*)pc;
Dl_info dlinfo;
if( dladdr( vptr, &dlinfo ) )
{
symname = dlinfo.dli_sname;
}
if( symname )
{
strcpy( (char*)data, symname );
}
else
{
*(char*)data = '\0';
}
}
return 1;
}
static void FastCallstackErrorCb( void* data, const char* /*msg*/, int /*errnum*/ )
{
*(char*)data = '\0';
}
const char* DecodeCallstackPtrFast( uint64_t ptr )
{
static char ret[1024];
backtrace_pcinfo( cb_bts, ptr, FastCallstackDataCb, FastCallstackErrorCb, ret );
return ret;
}
static int SymbolAddressDataCb( void* data, uintptr_t pc, uintptr_t lowaddr, const char* fn, int lineno, const char* function )
{
auto& sym = *(SymbolData*)data;
if( !fn )
{
const char* symloc = nullptr;
Dl_info dlinfo;
if( dladdr( (void*)pc, &dlinfo ) ) symloc = dlinfo.dli_fname;
if( !symloc ) symloc = "[unknown]";
sym.file = symloc;
sym.line = 0;
sym.needFree = false;
}
else
{
sym.file = CopyString( fn );
sym.line = lineno;
sym.needFree = true;
}
return 1;
}
static void SymbolAddressErrorCb( void* data, const char* /*msg*/, int /*errnum*/ )
{
auto& sym = *(SymbolData*)data;
sym.file = "[unknown]";
sym.line = 0;
sym.needFree = false;
}
SymbolData DecodeSymbolAddress( uint64_t ptr )
{
SymbolData sym;
backtrace_pcinfo( cb_bts, ptr, SymbolAddressDataCb, SymbolAddressErrorCb, &sym );
return sym;
}
SymbolData DecodeCodeAddress( uint64_t ptr )
{
return DecodeSymbolAddress( ptr );
}
static int CallstackDataCb( void* /*data*/, uintptr_t pc, uintptr_t lowaddr, const char* fn, int lineno, const char* function )
{
enum { DemangleBufLen = 64*1024 };
char demangled[DemangleBufLen];
cb_data[cb_num].symLen = 0;
cb_data[cb_num].symAddr = (uint64_t)lowaddr;
if( !fn && !function )
{
const char* symname = nullptr;
const char* symloc = nullptr;
auto vptr = (void*)pc;
ptrdiff_t symoff = 0;
Dl_info dlinfo;
if( dladdr( vptr, &dlinfo ) )
{
symloc = dlinfo.dli_fname;
symname = dlinfo.dli_sname;
symoff = (char*)pc - (char*)dlinfo.dli_saddr;
if( symname && symname[0] == '_' )
{
size_t len = DemangleBufLen;
int status;
abi::__cxa_demangle( symname, demangled, &len, &status );
if( status == 0 )
{
symname = demangled;
}
}
}
if( !symname ) symname = "[unknown]";
if( !symloc ) symloc = "[unknown]";
if( symoff == 0 )
{
cb_data[cb_num].name = CopyString( symname );
}
else
{
char buf[32];
const auto offlen = sprintf( buf, " + %td", symoff );
const auto namelen = strlen( symname );
auto name = (char*)tracy_malloc( namelen + offlen + 1 );
memcpy( name, symname, namelen );
memcpy( name + namelen, buf, offlen );
name[namelen + offlen] = '\0';
cb_data[cb_num].name = name;
}
char buf[32];
const auto addrlen = sprintf( buf, " [%p]", (void*)pc );
const auto loclen = strlen( symloc );
auto loc = (char*)tracy_malloc( loclen + addrlen + 1 );
memcpy( loc, symloc, loclen );
memcpy( loc + loclen, buf, addrlen );
loc[loclen + addrlen] = '\0';
cb_data[cb_num].file = loc;
cb_data[cb_num].line = 0;
}
else
{
if( !fn ) fn = "[unknown]";
if( !function )
{
function = "[unknown]";
}
else
{
if( function[0] == '_' )
{
size_t len = DemangleBufLen;
int status;
abi::__cxa_demangle( function, demangled, &len, &status );
if( status == 0 )
{
function = demangled;
}
}
}
cb_data[cb_num].name = CopyString( function );
cb_data[cb_num].file = CopyString( fn );
cb_data[cb_num].line = lineno;
}
if( ++cb_num >= MaxCbTrace )
{
return 1;
}
else
{
return 0;
}
}
static void CallstackErrorCb( void* /*data*/, const char* /*msg*/, int /*errnum*/ )
{
for( int i=0; i<cb_num; i++ )
{
tracy_free( (void*)cb_data[i].name );
tracy_free( (void*)cb_data[i].file );
}
cb_data[0].name = CopyString( "[error]" );
cb_data[0].file = CopyString( "[error]" );
cb_data[0].line = 0;
cb_num = 1;
}
void SymInfoCallback( void* /*data*/, uintptr_t pc, const char* symname, uintptr_t symval, uintptr_t symsize )
{
cb_data[cb_num-1].symLen = (uint32_t)symsize;
cb_data[cb_num-1].symAddr = (uint64_t)symval;
}
void SymInfoError( void* /*data*/, const char* /*msg*/, int /*errnum*/ )
{
cb_data[cb_num-1].symLen = 0;
cb_data[cb_num-1].symAddr = 0;
}
CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
{
cb_num = 0;
backtrace_pcinfo( cb_bts, ptr, CallstackDataCb, CallstackErrorCb, nullptr );
assert( cb_num > 0 );
backtrace_syminfo( cb_bts, ptr, SymInfoCallback, SymInfoError, nullptr );
const char* symloc = nullptr;
Dl_info dlinfo;
if( dladdr( (void*)ptr, &dlinfo ) ) symloc = dlinfo.dli_fname;
return { cb_data, uint8_t( cb_num ), symloc ? symloc : "[unknown]" };
}
#elif TRACY_HAS_CALLSTACK == 5
void InitCallstack()
{
}
const char* DecodeCallstackPtrFast( uint64_t ptr )
{
static char ret[1024];
auto vptr = (void*)ptr;
const char* symname = nullptr;
Dl_info dlinfo;
if( dladdr( vptr, &dlinfo ) && dlinfo.dli_sname )
{
symname = dlinfo.dli_sname;
}
if( symname )
{
strcpy( ret, symname );
}
else
{
*ret = '\0';
}
return ret;
}
SymbolData DecodeSymbolAddress( uint64_t ptr )
{
const char* symloc = nullptr;
Dl_info dlinfo;
if( dladdr( (void*)ptr, &dlinfo ) ) symloc = dlinfo.dli_fname;
if( !symloc ) symloc = "[unknown]";
return SymbolData { symloc, 0, false };
}
SymbolData DecodeCodeAddress( uint64_t ptr )
{
return DecodeSymbolAddress( ptr );
}
CallstackEntryData DecodeCallstackPtr( uint64_t ptr )
{
static CallstackEntry cb;
cb.line = 0;
char* demangled = nullptr;
const char* symname = nullptr;
const char* symloc = nullptr;
auto vptr = (void*)ptr;
ptrdiff_t symoff = 0;
void* symaddr = nullptr;
Dl_info dlinfo;
if( dladdr( vptr, &dlinfo ) )
{
symloc = dlinfo.dli_fname;
symname = dlinfo.dli_sname;
symoff = (char*)ptr - (char*)dlinfo.dli_saddr;
symaddr = dlinfo.dli_saddr;
if( symname && symname[0] == '_' )
{
size_t len = 0;
int status;
demangled = abi::__cxa_demangle( symname, nullptr, &len, &status );
if( status == 0 )
{
symname = demangled;
}
}
}
if( !symname ) symname = "[unknown]";
if( !symloc ) symloc = "[unknown]";
if( symoff == 0 )
{
cb.name = CopyString( symname );
}
else
{
char buf[32];
const auto offlen = sprintf( buf, " + %td", symoff );
const auto namelen = strlen( symname );
auto name = (char*)tracy_malloc( namelen + offlen + 1 );
memcpy( name, symname, namelen );
memcpy( name + namelen, buf, offlen );
name[namelen + offlen] = '\0';
cb.name = name;
}
char buf[32];
const auto addrlen = sprintf( buf, " [%p]", (void*)ptr );
const auto loclen = strlen( symloc );
auto loc = (char*)tracy_malloc( loclen + addrlen + 1 );
memcpy( loc, symloc, loclen );
memcpy( loc + loclen, buf, addrlen );
loc[loclen + addrlen] = '\0';
cb.file = loc;
cb.symLen = 0;
cb.symAddr = (uint64_t)symaddr;
if( demangled ) free( demangled );
return { &cb, 1, symloc };
}
#endif
}
#endif

View File

@ -1,28 +0,0 @@
#ifndef __TRACYCALLSTACK_H__
#define __TRACYCALLSTACK_H__
#if !defined _WIN32 && !defined __CYGWIN__
# include <sys/param.h>
#endif
#if defined _WIN32 || defined __CYGWIN__
# define TRACY_HAS_CALLSTACK 1
#elif defined __ANDROID__
# if !defined __arm__ || __ANDROID_API__ >= 21
# define TRACY_HAS_CALLSTACK 2
# else
# define TRACY_HAS_CALLSTACK 5
# endif
#elif defined __linux
# if defined _GNU_SOURCE && defined __GLIBC__
# define TRACY_HAS_CALLSTACK 3
# else
# define TRACY_HAS_CALLSTACK 2
# endif
#elif defined __APPLE__
# define TRACY_HAS_CALLSTACK 4
#elif defined BSD
# define TRACY_HAS_CALLSTACK 6
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,680 +0,0 @@
#ifndef __TRACYPROFILER_HPP__
#define __TRACYPROFILER_HPP__
#include <assert.h>
#include <atomic>
#include <stdint.h>
#include <string.h>
#include "tracy_concurrentqueue.h"
#include "TracyCallstack.hpp"
#include "TracySysTime.hpp"
#include "TracyFastVector.hpp"
#include "../common/TracyQueue.hpp"
#include "../common/TracyAlign.hpp"
#include "../common/TracyAlloc.hpp"
#include "../common/TracyMutex.hpp"
#include "../common/TracyProtocol.hpp"
#if defined _WIN32 || defined __CYGWIN__
# include <intrin.h>
#endif
#ifdef __APPLE__
# include <TargetConditionals.h>
# include <mach/mach_time.h>
#endif
#if defined _WIN32 || defined __CYGWIN__ || ( ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 ) && !defined __ANDROID__ ) || __ARM_ARCH >= 6
# define TRACY_HW_TIMER
#endif
#if !defined TRACY_HW_TIMER || ( defined __ARM_ARCH && __ARM_ARCH >= 6 && !defined CLOCK_MONOTONIC_RAW )
#include <chrono>
#endif
#ifndef TracyConcat
# define TracyConcat(x,y) TracyConcatIndirect(x,y)
#endif
#ifndef TracyConcatIndirect
# define TracyConcatIndirect(x,y) x##y
#endif
namespace tracy
{
class GpuCtx;
class Profiler;
class Socket;
class UdpBroadcast;
struct GpuCtxWrapper
{
GpuCtx* ptr;
};
TRACY_API moodycamel::ConcurrentQueue<QueueItem>::ExplicitProducer* GetToken();
TRACY_API Profiler& GetProfiler();
TRACY_API std::atomic<uint32_t>& GetLockCounter();
TRACY_API std::atomic<uint8_t>& GetGpuCtxCounter();
TRACY_API GpuCtxWrapper& GetGpuCtx();
TRACY_API uint64_t GetThreadHandle();
TRACY_API void InitRPMallocThread();
struct SourceLocationData
{
const char* name;
const char* function;
const char* file;
uint32_t line;
uint32_t color;
};
#ifdef TRACY_ON_DEMAND
struct LuaZoneState
{
uint32_t counter;
bool active;
};
#endif
#define TracyLfqPrepare( _type ) \
moodycamel::ConcurrentQueueDefaultTraits::index_t __magic; \
auto __token = GetToken(); \
auto& __tail = __token->get_tail_index(); \
auto item = __token->enqueue_begin( __magic ); \
MemWrite( &item->hdr.type, _type );
#define TracyLfqCommit \
__tail.store( __magic + 1, std::memory_order_release );
#define TracyLfqPrepareC( _type ) \
tracy::moodycamel::ConcurrentQueueDefaultTraits::index_t __magic; \
auto __token = tracy::GetToken(); \
auto& __tail = __token->get_tail_index(); \
auto item = __token->enqueue_begin( __magic ); \
tracy::MemWrite( &item->hdr.type, _type );
#define TracyLfqCommitC \
__tail.store( __magic + 1, std::memory_order_release );
typedef void(*ParameterCallback)( uint32_t idx, int32_t val );
class Profiler
{
struct FrameImageQueueItem
{
void* image;
uint64_t frame;
uint16_t w;
uint16_t h;
uint8_t offset;
bool flip;
};
public:
Profiler();
~Profiler();
static tracy_force_inline int64_t GetTime()
{
#ifdef TRACY_HW_TIMER
# if defined TARGET_OS_IOS && TARGET_OS_IOS == 1
return mach_absolute_time();
# elif defined __ARM_ARCH && __ARM_ARCH >= 6
# ifdef CLOCK_MONOTONIC_RAW
struct timespec ts;
clock_gettime( CLOCK_MONOTONIC_RAW, &ts );
return int64_t( ts.tv_sec ) * 1000000000ll + int64_t( ts.tv_nsec );
# else
return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
# endif
# elif defined _WIN32 || defined __CYGWIN__
# ifdef TRACY_TIMER_QPC
return GetTimeQpc();
# else
return int64_t( __rdtsc() );
# endif
# elif defined __i386 || defined _M_IX86
uint32_t eax, edx;
asm volatile ( "rdtsc" : "=a" (eax), "=d" (edx) );
return ( uint64_t( edx ) << 32 ) + uint64_t( eax );
# elif defined __x86_64__ || defined _M_X64
uint64_t rax, rdx;
asm volatile ( "rdtsc" : "=a" (rax), "=d" (rdx) );
return ( rdx << 32 ) + rax;
# endif
#else
return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
#endif
}
tracy_force_inline uint32_t GetNextZoneId()
{
return m_zoneId.fetch_add( 1, std::memory_order_relaxed );
}
static tracy_force_inline QueueItem* QueueSerial()
{
auto& p = GetProfiler();
p.m_serialLock.lock();
return p.m_serialQueue.prepare_next();
}
static tracy_force_inline void QueueSerialFinish()
{
auto& p = GetProfiler();
p.m_serialQueue.commit_next();
p.m_serialLock.unlock();
}
static tracy_force_inline void SendFrameMark( const char* name )
{
if( !name ) GetProfiler().m_frameCount.fetch_add( 1, std::memory_order_relaxed );
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
TracyLfqPrepare( QueueType::FrameMarkMsg );
MemWrite( &item->frameMark.time, GetTime() );
MemWrite( &item->frameMark.name, uint64_t( name ) );
TracyLfqCommit;
}
static tracy_force_inline void SendFrameMark( const char* name, QueueType type )
{
assert( type == QueueType::FrameMarkMsgStart || type == QueueType::FrameMarkMsgEnd );
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
auto item = QueueSerial();
MemWrite( &item->hdr.type, type );
MemWrite( &item->frameMark.time, GetTime() );
MemWrite( &item->frameMark.name, uint64_t( name ) );
QueueSerialFinish();
}
static tracy_force_inline void SendFrameImage( const void* image, uint16_t w, uint16_t h, uint8_t offset, bool flip )
{
auto& profiler = GetProfiler();
#ifdef TRACY_ON_DEMAND
if( !profiler.IsConnected() ) return;
#endif
const auto sz = size_t( w ) * size_t( h ) * 4;
auto ptr = (char*)tracy_malloc( sz );
memcpy( ptr, image, sz );
profiler.m_fiLock.lock();
auto fi = profiler.m_fiQueue.prepare_next();
fi->image = ptr;
fi->frame = profiler.m_frameCount.load( std::memory_order_relaxed ) - offset;
fi->w = w;
fi->h = h;
fi->flip = flip;
profiler.m_fiQueue.commit_next();
profiler.m_fiLock.unlock();
}
static tracy_force_inline void PlotData( const char* name, int64_t val )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
TracyLfqPrepare( QueueType::PlotData );
MemWrite( &item->plotData.name, (uint64_t)name );
MemWrite( &item->plotData.time, GetTime() );
MemWrite( &item->plotData.type, PlotDataType::Int );
MemWrite( &item->plotData.data.i, val );
TracyLfqCommit;
}
static tracy_force_inline void PlotData( const char* name, float val )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
TracyLfqPrepare( QueueType::PlotData );
MemWrite( &item->plotData.name, (uint64_t)name );
MemWrite( &item->plotData.time, GetTime() );
MemWrite( &item->plotData.type, PlotDataType::Float );
MemWrite( &item->plotData.data.f, val );
TracyLfqCommit;
}
static tracy_force_inline void PlotData( const char* name, double val )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
TracyLfqPrepare( QueueType::PlotData );
MemWrite( &item->plotData.name, (uint64_t)name );
MemWrite( &item->plotData.time, GetTime() );
MemWrite( &item->plotData.type, PlotDataType::Double );
MemWrite( &item->plotData.data.d, val );
TracyLfqCommit;
}
static tracy_force_inline void ConfigurePlot( const char* name, PlotFormatType type )
{
TracyLfqPrepare( QueueType::PlotConfig );
MemWrite( &item->plotConfig.name, (uint64_t)name );
MemWrite( &item->plotConfig.type, (uint8_t)type );
#ifdef TRACY_ON_DEMAND
GetProfiler().DeferItem( *item );
#endif
TracyLfqCommit;
}
static tracy_force_inline void Message( const char* txt, size_t size, int callstack )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
TracyLfqPrepare( callstack == 0 ? QueueType::Message : QueueType::MessageCallstack );
auto ptr = (char*)tracy_malloc( size+1 );
memcpy( ptr, txt, size );
ptr[size] = '\0';
MemWrite( &item->message.time, GetTime() );
MemWrite( &item->message.text, (uint64_t)ptr );
TracyLfqCommit;
if( callstack != 0 ) tracy::GetProfiler().SendCallstack( callstack );
}
static tracy_force_inline void Message( const char* txt, int callstack )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
TracyLfqPrepare( callstack == 0 ? QueueType::MessageLiteral : QueueType::MessageLiteralCallstack );
MemWrite( &item->message.time, GetTime() );
MemWrite( &item->message.text, (uint64_t)txt );
TracyLfqCommit;
if( callstack != 0 ) tracy::GetProfiler().SendCallstack( callstack );
}
static tracy_force_inline void MessageColor( const char* txt, size_t size, uint32_t color, int callstack )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
TracyLfqPrepare( callstack == 0 ? QueueType::MessageColor : QueueType::MessageColorCallstack );
auto ptr = (char*)tracy_malloc( size+1 );
memcpy( ptr, txt, size );
ptr[size] = '\0';
MemWrite( &item->messageColor.time, GetTime() );
MemWrite( &item->messageColor.text, (uint64_t)ptr );
MemWrite( &item->messageColor.r, uint8_t( ( color ) & 0xFF ) );
MemWrite( &item->messageColor.g, uint8_t( ( color >> 8 ) & 0xFF ) );
MemWrite( &item->messageColor.b, uint8_t( ( color >> 16 ) & 0xFF ) );
TracyLfqCommit;
if( callstack != 0 ) tracy::GetProfiler().SendCallstack( callstack );
}
static tracy_force_inline void MessageColor( const char* txt, uint32_t color, int callstack )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
TracyLfqPrepare( callstack == 0 ? QueueType::MessageLiteralColor : QueueType::MessageLiteralColorCallstack );
MemWrite( &item->messageColor.time, GetTime() );
MemWrite( &item->messageColor.text, (uint64_t)txt );
MemWrite( &item->messageColor.r, uint8_t( ( color ) & 0xFF ) );
MemWrite( &item->messageColor.g, uint8_t( ( color >> 8 ) & 0xFF ) );
MemWrite( &item->messageColor.b, uint8_t( ( color >> 16 ) & 0xFF ) );
TracyLfqCommit;
if( callstack != 0 ) tracy::GetProfiler().SendCallstack( callstack );
}
static tracy_force_inline void MessageAppInfo( const char* txt, size_t size )
{
InitRPMallocThread();
auto ptr = (char*)tracy_malloc( size+1 );
memcpy( ptr, txt, size );
ptr[size] = '\0';
TracyLfqPrepare( QueueType::MessageAppInfo );
MemWrite( &item->message.time, GetTime() );
MemWrite( &item->message.text, (uint64_t)ptr );
#ifdef TRACY_ON_DEMAND
GetProfiler().DeferItem( *item );
#endif
TracyLfqCommit;
}
static tracy_force_inline void MemAlloc( const void* ptr, size_t size )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
const auto thread = GetThreadHandle();
GetProfiler().m_serialLock.lock();
SendMemAlloc( QueueType::MemAlloc, thread, ptr, size );
GetProfiler().m_serialLock.unlock();
}
static tracy_force_inline void MemFree( const void* ptr )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
const auto thread = GetThreadHandle();
GetProfiler().m_serialLock.lock();
SendMemFree( QueueType::MemFree, thread, ptr );
GetProfiler().m_serialLock.unlock();
}
static tracy_force_inline void MemAllocCallstack( const void* ptr, size_t size, int depth )
{
#ifdef TRACY_HAS_CALLSTACK
auto& profiler = GetProfiler();
# ifdef TRACY_ON_DEMAND
if( !profiler.IsConnected() ) return;
# endif
const auto thread = GetThreadHandle();
InitRPMallocThread();
auto callstack = Callstack( depth );
profiler.m_serialLock.lock();
SendMemAlloc( QueueType::MemAllocCallstack, thread, ptr, size );
SendCallstackMemory( callstack );
profiler.m_serialLock.unlock();
#else
MemAlloc( ptr, size );
#endif
}
static tracy_force_inline void MemFreeCallstack( const void* ptr, int depth )
{
#ifdef TRACY_HAS_CALLSTACK
auto& profiler = GetProfiler();
# ifdef TRACY_ON_DEMAND
if( !profiler.IsConnected() ) return;
# endif
const auto thread = GetThreadHandle();
InitRPMallocThread();
auto callstack = Callstack( depth );
profiler.m_serialLock.lock();
SendMemFree( QueueType::MemFreeCallstack, thread, ptr );
SendCallstackMemory( callstack );
profiler.m_serialLock.unlock();
#else
MemFree( ptr );
#endif
}
static tracy_force_inline void SendCallstack( int depth )
{
#ifdef TRACY_HAS_CALLSTACK
auto ptr = Callstack( depth );
TracyLfqPrepare( QueueType::Callstack );
MemWrite( &item->callstack.ptr, (uint64_t)ptr );
TracyLfqCommit;
#endif
}
static tracy_force_inline void ParameterRegister( ParameterCallback cb ) { GetProfiler().m_paramCallback = cb; }
static tracy_force_inline void ParameterSetup( uint32_t idx, const char* name, bool isBool, int32_t val )
{
TracyLfqPrepare( QueueType::ParamSetup );
tracy::MemWrite( &item->paramSetup.idx, idx );
tracy::MemWrite( &item->paramSetup.name, (uint64_t)name );
tracy::MemWrite( &item->paramSetup.isBool, (uint8_t)isBool );
tracy::MemWrite( &item->paramSetup.val, val );
#ifdef TRACY_ON_DEMAND
GetProfiler().DeferItem( *item );
#endif
TracyLfqCommit;
}
void SendCallstack( int depth, const char* skipBefore );
static void CutCallstack( void* callstack, const char* skipBefore );
static bool ShouldExit();
#ifdef TRACY_ON_DEMAND
tracy_force_inline bool IsConnected() const
{
return m_isConnected.load( std::memory_order_acquire );
}
tracy_force_inline uint64_t ConnectionId() const
{
return m_connectionId.load( std::memory_order_acquire );
}
tracy_force_inline void DeferItem( const QueueItem& item )
{
m_deferredLock.lock();
auto dst = m_deferredQueue.push_next();
memcpy( dst, &item, sizeof( item ) );
m_deferredLock.unlock();
}
#endif
void RequestShutdown() { m_shutdown.store( true, std::memory_order_relaxed ); m_shutdownManual.store( true, std::memory_order_relaxed ); }
bool HasShutdownFinished() const { return m_shutdownFinished.load( std::memory_order_relaxed ); }
void SendString( uint64_t ptr, const char* str, QueueType type );
// Allocated source location data layout:
// 4b payload size
// 4b color
// 4b source line
// fsz function name
// 1b null terminator
// ssz source file name
// 1b null terminator
// nsz zone name (optional)
static tracy_force_inline uint64_t AllocSourceLocation( uint32_t line, const char* source, const char* function )
{
const auto fsz = strlen( function );
const auto ssz = strlen( source );
const uint32_t sz = uint32_t( 4 + 4 + 4 + fsz + 1 + ssz + 1 );
auto ptr = (char*)tracy_malloc( sz );
memcpy( ptr, &sz, 4 );
memset( ptr + 4, 0, 4 );
memcpy( ptr + 8, &line, 4 );
memcpy( ptr + 12, function, fsz+1 );
memcpy( ptr + 12 + fsz + 1, source, ssz + 1 );
return uint64_t( ptr );
}
static tracy_force_inline uint64_t AllocSourceLocation( uint32_t line, const char* source, const char* function, const char* name, size_t nameSz )
{
const auto fsz = strlen( function );
const auto ssz = strlen( source );
const uint32_t sz = uint32_t( 4 + 4 + 4 + fsz + 1 + ssz + 1 + nameSz );
auto ptr = (char*)tracy_malloc( sz );
memcpy( ptr, &sz, 4 );
memset( ptr + 4, 0, 4 );
memcpy( ptr + 8, &line, 4 );
memcpy( ptr + 12, function, fsz+1 );
memcpy( ptr + 12 + fsz + 1, source, ssz + 1 );
memcpy( ptr + 12 + fsz + 1 + ssz + 1, name, nameSz );
return uint64_t( ptr );
}
private:
enum class DequeueStatus { DataDequeued, ConnectionLost, QueueEmpty };
static void LaunchWorker( void* ptr ) { ((Profiler*)ptr)->Worker(); }
void Worker();
static void LaunchCompressWorker( void* ptr ) { ((Profiler*)ptr)->CompressWorker(); }
void CompressWorker();
void ClearQueues( tracy::moodycamel::ConsumerToken& token );
void ClearSerial();
DequeueStatus Dequeue( tracy::moodycamel::ConsumerToken& token );
DequeueStatus DequeueContextSwitches( tracy::moodycamel::ConsumerToken& token, int64_t& timeStop );
DequeueStatus DequeueSerial();
bool CommitData();
tracy_force_inline bool AppendData( const void* data, size_t len )
{
const auto ret = NeedDataSize( len );
AppendDataUnsafe( data, len );
return ret;
}
tracy_force_inline bool NeedDataSize( size_t len )
{
assert( len <= TargetFrameSize );
bool ret = true;
if( m_bufferOffset - m_bufferStart + len > TargetFrameSize )
{
ret = CommitData();
}
return ret;
}
tracy_force_inline void AppendDataUnsafe( const void* data, size_t len )
{
memcpy( m_buffer + m_bufferOffset, data, len );
m_bufferOffset += int( len );
}
bool SendData( const char* data, size_t len );
void SendLongString( uint64_t ptr, const char* str, size_t len, QueueType type );
void SendSourceLocation( uint64_t ptr );
void SendSourceLocationPayload( uint64_t ptr );
void SendCallstackPayload( uint64_t ptr );
void SendCallstackPayload64( uint64_t ptr );
void SendCallstackAlloc( uint64_t ptr );
void SendCallstackFrame( uint64_t ptr );
void SendCodeLocation( uint64_t ptr );
bool HandleServerQuery();
void HandleDisconnect();
void HandleParameter( uint64_t payload );
void HandleSymbolQuery( uint64_t symbol );
void HandleSymbolCodeQuery( uint64_t symbol, uint32_t size );
void CalibrateTimer();
void CalibrateDelay();
void ReportTopology();
static tracy_force_inline void SendCallstackMemory( void* ptr )
{
#ifdef TRACY_HAS_CALLSTACK
auto item = GetProfiler().m_serialQueue.prepare_next();
MemWrite( &item->hdr.type, QueueType::CallstackMemory );
MemWrite( &item->callstackMemory.ptr, (uint64_t)ptr );
GetProfiler().m_serialQueue.commit_next();
#endif
}
static tracy_force_inline void SendMemAlloc( QueueType type, const uint64_t thread, const void* ptr, size_t size )
{
assert( type == QueueType::MemAlloc || type == QueueType::MemAllocCallstack );
auto item = GetProfiler().m_serialQueue.prepare_next();
MemWrite( &item->hdr.type, type );
MemWrite( &item->memAlloc.time, GetTime() );
MemWrite( &item->memAlloc.thread, thread );
MemWrite( &item->memAlloc.ptr, (uint64_t)ptr );
if( compile_time_condition<sizeof( size ) == 4>::value )
{
memcpy( &item->memAlloc.size, &size, 4 );
memset( &item->memAlloc.size + 4, 0, 2 );
}
else
{
assert( sizeof( size ) == 8 );
memcpy( &item->memAlloc.size, &size, 4 );
memcpy( ((char*)&item->memAlloc.size)+4, ((char*)&size)+4, 2 );
}
GetProfiler().m_serialQueue.commit_next();
}
static tracy_force_inline void SendMemFree( QueueType type, const uint64_t thread, const void* ptr )
{
assert( type == QueueType::MemFree || type == QueueType::MemFreeCallstack );
auto item = GetProfiler().m_serialQueue.prepare_next();
MemWrite( &item->hdr.type, type );
MemWrite( &item->memFree.time, GetTime() );
MemWrite( &item->memFree.thread, thread );
MemWrite( &item->memFree.ptr, (uint64_t)ptr );
GetProfiler().m_serialQueue.commit_next();
}
#if ( defined _WIN32 || defined __CYGWIN__ ) && defined TRACY_TIMER_QPC
static int64_t GetTimeQpc();
#endif
double m_timerMul;
uint64_t m_resolution;
uint64_t m_delay;
std::atomic<int64_t> m_timeBegin;
uint64_t m_mainThread;
uint64_t m_epoch;
std::atomic<bool> m_shutdown;
std::atomic<bool> m_shutdownManual;
std::atomic<bool> m_shutdownFinished;
Socket* m_sock;
UdpBroadcast* m_broadcast;
bool m_noExit;
uint32_t m_userPort;
std::atomic<uint32_t> m_zoneId;
int64_t m_samplingPeriod;
uint64_t m_threadCtx;
int64_t m_refTimeThread;
int64_t m_refTimeSerial;
int64_t m_refTimeCtx;
int64_t m_refTimeGpu;
void* m_stream; // LZ4_stream_t*
char* m_buffer;
int m_bufferOffset;
int m_bufferStart;
char* m_lz4Buf;
FastVector<QueueItem> m_serialQueue, m_serialDequeue;
TracyMutex m_serialLock;
FastVector<FrameImageQueueItem> m_fiQueue, m_fiDequeue;
TracyMutex m_fiLock;
std::atomic<uint64_t> m_frameCount;
#ifdef TRACY_ON_DEMAND
std::atomic<bool> m_isConnected;
std::atomic<uint64_t> m_connectionId;
TracyMutex m_deferredLock;
FastVector<QueueItem> m_deferredQueue;
#endif
#ifdef TRACY_HAS_SYSTIME
void ProcessSysTime();
SysTime m_sysTime;
uint64_t m_sysTimeLast = 0;
#else
void ProcessSysTime() {}
#endif
ParameterCallback m_paramCallback;
};
}
#endif

View File

@ -1,114 +0,0 @@
#ifndef __TRACYSCOPED_HPP__
#define __TRACYSCOPED_HPP__
#include <stdint.h>
#include <string.h>
#include "../common/TracySystem.hpp"
#include "../common/TracyAlign.hpp"
#include "../common/TracyAlloc.hpp"
#include "TracyProfiler.hpp"
namespace tracy
{
class ScopedZone
{
public:
tracy_force_inline ScopedZone( const SourceLocationData* srcloc, bool is_active = true )
#ifdef TRACY_ON_DEMAND
: m_active( is_active && GetProfiler().IsConnected() )
#else
: m_active( is_active )
#endif
{
if( !m_active ) return;
#ifdef TRACY_ON_DEMAND
m_connectionId = GetProfiler().ConnectionId();
#endif
TracyLfqPrepare( QueueType::ZoneBegin );
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
TracyLfqCommit;
}
tracy_force_inline ScopedZone( const SourceLocationData* srcloc, int depth, bool is_active = true )
#ifdef TRACY_ON_DEMAND
: m_active( is_active && GetProfiler().IsConnected() )
#else
: m_active( is_active )
#endif
{
if( !m_active ) return;
#ifdef TRACY_ON_DEMAND
m_connectionId = GetProfiler().ConnectionId();
#endif
TracyLfqPrepare( QueueType::ZoneBeginCallstack );
MemWrite( &item->zoneBegin.time, Profiler::GetTime() );
MemWrite( &item->zoneBegin.srcloc, (uint64_t)srcloc );
TracyLfqCommit;
GetProfiler().SendCallstack( depth );
}
tracy_force_inline ~ScopedZone()
{
if( !m_active ) return;
#ifdef TRACY_ON_DEMAND
if( GetProfiler().ConnectionId() != m_connectionId ) return;
#endif
TracyLfqPrepare( QueueType::ZoneEnd );
MemWrite( &item->zoneEnd.time, Profiler::GetTime() );
TracyLfqCommit;
}
tracy_force_inline void Text( const char* txt, size_t size )
{
if( !m_active ) return;
#ifdef TRACY_ON_DEMAND
if( GetProfiler().ConnectionId() != m_connectionId ) return;
#endif
auto ptr = (char*)tracy_malloc( size+1 );
memcpy( ptr, txt, size );
ptr[size] = '\0';
TracyLfqPrepare( QueueType::ZoneText );
MemWrite( &item->zoneText.text, (uint64_t)ptr );
TracyLfqCommit;
}
tracy_force_inline void Name( const char* txt, size_t size )
{
if( !m_active ) return;
#ifdef TRACY_ON_DEMAND
if( GetProfiler().ConnectionId() != m_connectionId ) return;
#endif
auto ptr = (char*)tracy_malloc( size+1 );
memcpy( ptr, txt, size );
ptr[size] = '\0';
TracyLfqPrepare( QueueType::ZoneName );
MemWrite( &item->zoneText.text, (uint64_t)ptr );
TracyLfqCommit;
}
tracy_force_inline void Value( uint64_t value )
{
if( !m_active ) return;
#ifdef TRACY_ON_DEMAND
if( GetProfiler().ConnectionId() != m_connectionId ) return;
#endif
TracyLfqPrepare( QueueType::ZoneValue );
MemWrite( &item->zoneValue.value, value );
TracyLfqCommit;
}
private:
const bool m_active;
#ifdef TRACY_ON_DEMAND
uint64_t m_connectionId;
#endif
};
}
#endif

View File

@ -1,954 +0,0 @@
#include "TracySysTrace.hpp"
#ifdef TRACY_HAS_SYSTEM_TRACING
# if defined _WIN32 || defined __CYGWIN__
# ifndef NOMINMAX
# define NOMINMAX
# endif
# define INITGUID
# include <assert.h>
# include <string.h>
# include <windows.h>
# include <dbghelp.h>
# include <evntrace.h>
# include <evntcons.h>
# include <psapi.h>
# include <winternl.h>
# include "../common/TracyAlloc.hpp"
# include "../common/TracySystem.hpp"
# include "TracyProfiler.hpp"
namespace tracy
{
DEFINE_GUID ( /* ce1dbfb4-137e-4da6-87b0-3f59aa102cbc */
PerfInfoGuid,
0xce1dbfb4,
0x137e,
0x4da6,
0x87, 0xb0, 0x3f, 0x59, 0xaa, 0x10, 0x2c, 0xbc
);
static TRACEHANDLE s_traceHandle;
static TRACEHANDLE s_traceHandle2;
static EVENT_TRACE_PROPERTIES* s_prop;
static DWORD s_pid;
struct CSwitch
{
uint32_t newThreadId;
uint32_t oldThreadId;
int8_t newThreadPriority;
int8_t oldThreadPriority;
uint8_t previousCState;
int8_t spareByte;
int8_t oldThreadWaitReason;
int8_t oldThreadWaitMode;
int8_t oldThreadState;
int8_t oldThreadWaitIdealProcessor;
uint32_t newThreadWaitTime;
uint32_t reserved;
};
struct ReadyThread
{
uint32_t threadId;
int8_t adjustReason;
int8_t adjustIncrement;
int8_t flag;
int8_t reserverd;
};
struct ThreadTrace
{
uint32_t processId;
uint32_t threadId;
uint32_t stackBase;
uint32_t stackLimit;
uint32_t userStackBase;
uint32_t userStackLimit;
uint32_t startAddr;
uint32_t win32StartAddr;
uint32_t tebBase;
uint32_t subProcessTag;
};
struct StackWalkEvent
{
uint64_t eventTimeStamp;
uint32_t stackProcess;
uint32_t stackThread;
uint64_t stack[192];
};
#ifdef __CYGWIN__
extern "C" typedef DWORD (WINAPI *t_GetProcessIdOfThread)( HANDLE );
extern "C" typedef DWORD (WINAPI *t_GetProcessImageFileNameA)( HANDLE, LPSTR, DWORD );
extern "C" ULONG WMIAPI TraceSetInformation(TRACEHANDLE SessionHandle, TRACE_INFO_CLASS InformationClass, PVOID TraceInformation, ULONG InformationLength);
t_GetProcessIdOfThread GetProcessIdOfThread = (t_GetProcessIdOfThread)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetProcessIdOfThread" );
t_GetProcessImageFileNameA GetProcessImageFileNameA = (t_GetProcessImageFileNameA)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "K32GetProcessImageFileNameA" );
#endif
extern "C" typedef NTSTATUS (WINAPI *t_NtQueryInformationThread)( HANDLE, THREADINFOCLASS, PVOID, ULONG, PULONG );
extern "C" typedef BOOL (WINAPI *t_EnumProcessModules)( HANDLE, HMODULE*, DWORD, LPDWORD );
extern "C" typedef BOOL (WINAPI *t_GetModuleInformation)( HANDLE, HMODULE, LPMODULEINFO, DWORD );
extern "C" typedef DWORD (WINAPI *t_GetModuleBaseNameA)( HANDLE, HMODULE, LPSTR, DWORD );
extern "C" typedef HRESULT (WINAPI *t_GetThreadDescription)( HANDLE, PWSTR* );
t_NtQueryInformationThread NtQueryInformationThread = (t_NtQueryInformationThread)GetProcAddress( GetModuleHandleA( "ntdll.dll" ), "NtQueryInformationThread" );
t_EnumProcessModules _EnumProcessModules = (t_EnumProcessModules)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "K32EnumProcessModules" );
t_GetModuleInformation _GetModuleInformation = (t_GetModuleInformation)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "K32GetModuleInformation" );
t_GetModuleBaseNameA _GetModuleBaseNameA = (t_GetModuleBaseNameA)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "K32GetModuleBaseNameA" );
static t_GetThreadDescription _GetThreadDescription = 0;
void WINAPI EventRecordCallback( PEVENT_RECORD record )
{
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) return;
#endif
const auto& hdr = record->EventHeader;
switch( hdr.ProviderId.Data1 )
{
case 0x3d6fa8d1: // Thread Guid
if( hdr.EventDescriptor.Opcode == 36 )
{
const auto cswitch = (const CSwitch*)record->UserData;
TracyLfqPrepare( QueueType::ContextSwitch );
MemWrite( &item->contextSwitch.time, hdr.TimeStamp.QuadPart );
memcpy( &item->contextSwitch.oldThread, &cswitch->oldThreadId, sizeof( cswitch->oldThreadId ) );
memcpy( &item->contextSwitch.newThread, &cswitch->newThreadId, sizeof( cswitch->newThreadId ) );
memset( ((char*)&item->contextSwitch.oldThread)+4, 0, 4 );
memset( ((char*)&item->contextSwitch.newThread)+4, 0, 4 );
MemWrite( &item->contextSwitch.cpu, record->BufferContext.ProcessorNumber );
MemWrite( &item->contextSwitch.reason, cswitch->oldThreadWaitReason );
MemWrite( &item->contextSwitch.state, cswitch->oldThreadState );
TracyLfqCommit;
}
else if( hdr.EventDescriptor.Opcode == 50 )
{
const auto rt = (const ReadyThread*)record->UserData;
TracyLfqPrepare( QueueType::ThreadWakeup );
MemWrite( &item->threadWakeup.time, hdr.TimeStamp.QuadPart );
memcpy( &item->threadWakeup.thread, &rt->threadId, sizeof( rt->threadId ) );
memset( ((char*)&item->threadWakeup.thread)+4, 0, 4 );
TracyLfqCommit;
}
else if( hdr.EventDescriptor.Opcode == 1 || hdr.EventDescriptor.Opcode == 3 )
{
const auto tt = (const ThreadTrace*)record->UserData;
uint64_t tid = tt->threadId;
if( tid == 0 ) return;
uint64_t pid = tt->processId;
TracyLfqPrepare( QueueType::TidToPid );
MemWrite( &item->tidToPid.tid, tid );
MemWrite( &item->tidToPid.pid, pid );
TracyLfqCommit;
}
break;
case 0xdef2fe46: // StackWalk Guid
if( hdr.EventDescriptor.Opcode == 32 )
{
const auto sw = (const StackWalkEvent*)record->UserData;
if( sw->stackProcess == s_pid && ( sw->stack[0] & 0x8000000000000000 ) == 0 )
{
const uint64_t sz = ( record->UserDataLength - 16 ) / 8;
if( sz > 0 )
{
auto trace = (uint64_t*)tracy_malloc( ( 1 + sz ) * sizeof( uint64_t ) );
memcpy( trace, &sz, sizeof( uint64_t ) );
memcpy( trace+1, sw->stack, sizeof( uint64_t ) * sz );
TracyLfqPrepare( QueueType::CallstackSample );
MemWrite( &item->callstackSample.time, sw->eventTimeStamp );
MemWrite( &item->callstackSample.thread, (uint64_t)sw->stackThread );
MemWrite( &item->callstackSample.ptr, (uint64_t)trace );
TracyLfqCommit;
}
}
}
break;
default:
break;
}
}
bool SysTraceStart( int64_t& samplingPeriod )
{
if( !_GetThreadDescription ) _GetThreadDescription = (t_GetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetThreadDescription" );
s_pid = GetCurrentProcessId();
#if defined _WIN64
constexpr bool isOs64Bit = true;
#else
BOOL _iswow64;
IsWow64Process( GetCurrentProcess(), &_iswow64 );
const bool isOs64Bit = _iswow64;
#endif
TOKEN_PRIVILEGES priv = {};
priv.PrivilegeCount = 1;
priv.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if( LookupPrivilegeValue( nullptr, SE_SYSTEM_PROFILE_NAME, &priv.Privileges[0].Luid ) == 0 ) return false;
HANDLE pt;
if( OpenProcessToken( GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &pt ) == 0 ) return false;
const auto adjust = AdjustTokenPrivileges( pt, FALSE, &priv, 0, nullptr, nullptr );
CloseHandle( pt );
if( adjust == 0 ) return false;
const auto status = GetLastError();
if( status != ERROR_SUCCESS ) return false;
if( isOs64Bit )
{
TRACE_PROFILE_INTERVAL interval = {};
interval.Interval = 1250; // 8 kHz
const auto intervalStatus = TraceSetInformation( 0, TraceSampledProfileIntervalInfo, &interval, sizeof( interval ) );
if( intervalStatus != ERROR_SUCCESS ) return false;
samplingPeriod = 125*1000;
}
const auto psz = sizeof( EVENT_TRACE_PROPERTIES ) + sizeof( KERNEL_LOGGER_NAME );
s_prop = (EVENT_TRACE_PROPERTIES*)tracy_malloc( psz );
memset( s_prop, 0, sizeof( EVENT_TRACE_PROPERTIES ) );
ULONG flags = EVENT_TRACE_FLAG_CSWITCH | EVENT_TRACE_FLAG_DISPATCHER | EVENT_TRACE_FLAG_THREAD;
if( isOs64Bit ) flags |= EVENT_TRACE_FLAG_PROFILE;
s_prop->EnableFlags = flags;
s_prop->LogFileMode = EVENT_TRACE_REAL_TIME_MODE;
s_prop->Wnode.BufferSize = psz;
s_prop->Wnode.Flags = WNODE_FLAG_TRACED_GUID;
#ifdef TRACY_TIMER_QPC
s_prop->Wnode.ClientContext = 1;
#else
s_prop->Wnode.ClientContext = 3;
#endif
s_prop->Wnode.Guid = SystemTraceControlGuid;
s_prop->BufferSize = 1024;
s_prop->LoggerNameOffset = sizeof( EVENT_TRACE_PROPERTIES );
memcpy( ((char*)s_prop) + sizeof( EVENT_TRACE_PROPERTIES ), KERNEL_LOGGER_NAME, sizeof( KERNEL_LOGGER_NAME ) );
auto backup = tracy_malloc( psz );
memcpy( backup, s_prop, psz );
const auto controlStatus = ControlTrace( 0, KERNEL_LOGGER_NAME, s_prop, EVENT_TRACE_CONTROL_STOP );
if( controlStatus != ERROR_SUCCESS && controlStatus != ERROR_WMI_INSTANCE_NOT_FOUND )
{
tracy_free( s_prop );
return false;
}
memcpy( s_prop, backup, psz );
tracy_free( backup );
const auto startStatus = StartTrace( &s_traceHandle, KERNEL_LOGGER_NAME, s_prop );
if( startStatus != ERROR_SUCCESS )
{
tracy_free( s_prop );
return false;
}
if( isOs64Bit )
{
CLASSIC_EVENT_ID stackId;
stackId.EventGuid = PerfInfoGuid;
stackId.Type = 46;
const auto stackStatus = TraceSetInformation( s_traceHandle, TraceStackTracingInfo, &stackId, sizeof( stackId ) );
if( stackStatus != ERROR_SUCCESS )
{
tracy_free( s_prop );
return false;
}
}
#ifdef UNICODE
WCHAR KernelLoggerName[sizeof( KERNEL_LOGGER_NAME )];
#else
char KernelLoggerName[sizeof( KERNEL_LOGGER_NAME )];
#endif
memcpy( KernelLoggerName, KERNEL_LOGGER_NAME, sizeof( KERNEL_LOGGER_NAME ) );
EVENT_TRACE_LOGFILE log = {};
log.LoggerName = KernelLoggerName;
log.ProcessTraceMode = PROCESS_TRACE_MODE_REAL_TIME | PROCESS_TRACE_MODE_EVENT_RECORD | PROCESS_TRACE_MODE_RAW_TIMESTAMP;
log.EventRecordCallback = EventRecordCallback;
s_traceHandle2 = OpenTrace( &log );
if( s_traceHandle2 == (TRACEHANDLE)INVALID_HANDLE_VALUE )
{
CloseTrace( s_traceHandle );
tracy_free( s_prop );
return false;
}
return true;
}
void SysTraceStop()
{
CloseTrace( s_traceHandle2 );
CloseTrace( s_traceHandle );
}
void SysTraceWorker( void* ptr )
{
SetThreadName( "Tracy SysTrace" );
ProcessTrace( &s_traceHandle2, 1, 0, 0 );
ControlTrace( 0, KERNEL_LOGGER_NAME, s_prop, EVENT_TRACE_CONTROL_STOP );
tracy_free( s_prop );
}
void SysTraceSendExternalName( uint64_t thread )
{
bool threadSent = false;
auto hnd = OpenThread( THREAD_QUERY_INFORMATION, FALSE, DWORD( thread ) );
if( hnd == 0 )
{
hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, DWORD( thread ) );
}
if( hnd != 0 )
{
PWSTR tmp;
_GetThreadDescription( hnd, &tmp );
char buf[256];
if( tmp )
{
auto ret = wcstombs( buf, tmp, 256 );
if( ret != 0 )
{
GetProfiler().SendString( thread, buf, QueueType::ExternalThreadName );
threadSent = true;
}
}
const auto pid = GetProcessIdOfThread( hnd );
if( !threadSent && NtQueryInformationThread && _EnumProcessModules && _GetModuleInformation && _GetModuleBaseNameA )
{
void* ptr;
ULONG retlen;
auto status = NtQueryInformationThread( hnd, (THREADINFOCLASS)9 /*ThreadQuerySetWin32StartAddress*/, &ptr, sizeof( &ptr ), &retlen );
if( status == 0 )
{
const auto phnd = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid );
if( phnd != INVALID_HANDLE_VALUE )
{
HMODULE modules[1024];
DWORD needed;
if( _EnumProcessModules( phnd, modules, 1024 * sizeof( HMODULE ), &needed ) != 0 )
{
const auto sz = std::min( DWORD( needed / sizeof( HMODULE ) ), DWORD( 1024 ) );
for( DWORD i=0; i<sz; i++ )
{
MODULEINFO info;
if( _GetModuleInformation( phnd, modules[i], &info, sizeof( info ) ) != 0 )
{
if( (uint64_t)ptr >= (uint64_t)info.lpBaseOfDll && (uint64_t)ptr <= (uint64_t)info.lpBaseOfDll + (uint64_t)info.SizeOfImage )
{
char buf2[1024];
if( _GetModuleBaseNameA( phnd, modules[i], buf2, 1024 ) != 0 )
{
GetProfiler().SendString( thread, buf2, QueueType::ExternalThreadName );
threadSent = true;
}
}
}
}
}
CloseHandle( phnd );
}
}
}
CloseHandle( hnd );
if( !threadSent )
{
GetProfiler().SendString( thread, "???", QueueType::ExternalThreadName );
threadSent = true;
}
if( pid != 0 )
{
{
uint64_t _pid = pid;
TracyLfqPrepare( QueueType::TidToPid );
MemWrite( &item->tidToPid.tid, thread );
MemWrite( &item->tidToPid.pid, _pid );
TracyLfqCommit;
}
if( pid == 4 )
{
GetProfiler().SendString( thread, "System", QueueType::ExternalName );
return;
}
else
{
const auto phnd = OpenProcess( PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid );
if( phnd != INVALID_HANDLE_VALUE )
{
char buf2[1024];
const auto sz = GetProcessImageFileNameA( phnd, buf2, 1024 );
CloseHandle( phnd );
if( sz != 0 )
{
auto ptr = buf2 + sz - 1;
while( ptr > buf2 && *ptr != '\\' ) ptr--;
if( *ptr == '\\' ) ptr++;
GetProfiler().SendString( thread, ptr, QueueType::ExternalName );
return;
}
}
}
}
}
if( !threadSent )
{
GetProfiler().SendString( thread, "???", QueueType::ExternalThreadName );
}
GetProfiler().SendString( thread, "???", QueueType::ExternalName );
}
}
# elif defined __linux__
# include <sys/types.h>
# include <sys/stat.h>
# include <sys/wait.h>
# include <fcntl.h>
# include <inttypes.h>
# include <limits>
# include <poll.h>
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <unistd.h>
# include <atomic>
# include "TracyProfiler.hpp"
# ifdef __ANDROID__
# include "TracySysTracePayload.hpp"
# endif
namespace tracy
{
static const char BasePath[] = "/sys/kernel/debug/tracing/";
static const char TracingOn[] = "tracing_on";
static const char CurrentTracer[] = "current_tracer";
static const char TraceOptions[] = "trace_options";
static const char TraceClock[] = "trace_clock";
static const char SchedSwitch[] = "events/sched/sched_switch/enable";
static const char SchedWakeup[] = "events/sched/sched_wakeup/enable";
static const char BufferSizeKb[] = "buffer_size_kb";
static const char TracePipe[] = "trace_pipe";
static std::atomic<bool> traceActive { false };
#ifdef __ANDROID__
static bool TraceWrite( const char* path, size_t psz, const char* val, size_t vsz )
{
char tmp[256];
sprintf( tmp, "su -c 'echo \"%s\" > %s%s'", val, BasePath, path );
return system( tmp ) == 0;
}
#else
static bool TraceWrite( const char* path, size_t psz, const char* val, size_t vsz )
{
char tmp[256];
memcpy( tmp, BasePath, sizeof( BasePath ) - 1 );
memcpy( tmp + sizeof( BasePath ) - 1, path, psz );
int fd = open( tmp, O_WRONLY );
if( fd < 0 ) return false;
for(;;)
{
ssize_t cnt = write( fd, val, vsz );
if( cnt == (ssize_t)vsz )
{
close( fd );
return true;
}
if( cnt < 0 )
{
close( fd );
return false;
}
vsz -= cnt;
val += cnt;
}
}
#endif
#ifdef __ANDROID__
void SysTraceInjectPayload()
{
int pipefd[2];
if( pipe( pipefd ) == 0 )
{
const auto pid = fork();
if( pid == 0 )
{
// child
close( pipefd[1] );
if( dup2( pipefd[0], STDIN_FILENO ) >= 0 )
{
close( pipefd[0] );
execlp( "su", "su", "-c", "cat > /data/tracy_systrace", (char*)nullptr );
exit( 1 );
}
}
else if( pid > 0 )
{
// parent
close( pipefd[0] );
#ifdef __aarch64__
write( pipefd[1], tracy_systrace_aarch64_data, tracy_systrace_aarch64_size );
#else
write( pipefd[1], tracy_systrace_armv7_data, tracy_systrace_armv7_size );
#endif
close( pipefd[1] );
waitpid( pid, nullptr, 0 );
system( "su -c 'chmod 700 /data/tracy_systrace'" );
}
}
}
#endif
bool SysTraceStart( int64_t& samplingPeriod )
{
if( !TraceWrite( TracingOn, sizeof( TracingOn ), "0", 2 ) ) return false;
if( !TraceWrite( CurrentTracer, sizeof( CurrentTracer ), "nop", 4 ) ) return false;
TraceWrite( TraceOptions, sizeof( TraceOptions ), "norecord-cmd", 13 );
TraceWrite( TraceOptions, sizeof( TraceOptions ), "norecord-tgid", 14 );
TraceWrite( TraceOptions, sizeof( TraceOptions ), "noirq-info", 11 );
TraceWrite( TraceOptions, sizeof( TraceOptions ), "noannotate", 11 );
#if defined TRACY_HW_TIMER && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
if( !TraceWrite( TraceClock, sizeof( TraceClock ), "x86-tsc", 8 ) ) return false;
#elif __ARM_ARCH >= 6
if( !TraceWrite( TraceClock, sizeof( TraceClock ), "mono_raw", 9 ) ) return false;
#endif
if( !TraceWrite( SchedSwitch, sizeof( SchedSwitch ), "1", 2 ) ) return false;
if( !TraceWrite( SchedWakeup, sizeof( SchedWakeup ), "1", 2 ) ) return false;
if( !TraceWrite( BufferSizeKb, sizeof( BufferSizeKb ), "512", 4 ) ) return false;
#if defined __ANDROID__ && ( defined __aarch64__ || defined __ARM_ARCH )
SysTraceInjectPayload();
#endif
if( !TraceWrite( TracingOn, sizeof( TracingOn ), "1", 2 ) ) return false;
traceActive.store( true, std::memory_order_relaxed );
return true;
}
void SysTraceStop()
{
TraceWrite( TracingOn, sizeof( TracingOn ), "0", 2 );
traceActive.store( false, std::memory_order_relaxed );
}
static uint64_t ReadNumber( const char*& ptr )
{
uint64_t val = 0;
for(;;)
{
if( *ptr >= '0' && *ptr <= '9' )
{
val = val * 10 + ( *ptr - '0' );
ptr++;
}
else
{
return val;
}
}
}
static uint8_t ReadState( char state )
{
switch( state )
{
case 'D': return 101;
case 'I': return 102;
case 'R': return 103;
case 'S': return 104;
case 'T': return 105;
case 't': return 106;
case 'W': return 107;
case 'X': return 108;
case 'Z': return 109;
default: return 100;
}
}
#if defined __ANDROID__ && defined __ANDROID_API__ && __ANDROID_API__ < 18
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Christos Zoulas.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
ssize_t getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp)
{
char *ptr, *eptr;
if (*buf == NULL || *bufsiz == 0) {
*bufsiz = BUFSIZ;
if ((*buf = (char*)malloc(*bufsiz)) == NULL)
return -1;
}
for (ptr = *buf, eptr = *buf + *bufsiz;;) {
int c = fgetc(fp);
if (c == -1) {
if (feof(fp))
return ptr == *buf ? -1 : ptr - *buf;
else
return -1;
}
*ptr++ = c;
if (c == delimiter) {
*ptr = '\0';
return ptr - *buf;
}
if (ptr + 2 >= eptr) {
char *nbuf;
size_t nbufsiz = *bufsiz * 2;
ssize_t d = ptr - *buf;
if ((nbuf = (char*)realloc(*buf, nbufsiz)) == NULL)
return -1;
*buf = nbuf;
*bufsiz = nbufsiz;
eptr = nbuf + nbufsiz;
ptr = nbuf + d;
}
}
}
ssize_t getline(char **buf, size_t *bufsiz, FILE *fp)
{
return getdelim(buf, bufsiz, '\n', fp);
}
#endif
static void HandleTraceLine( const char* line )
{
line += 23;
while( *line != '[' ) line++;
line++;
const auto cpu = (uint8_t)ReadNumber( line );
line++; // ']'
while( *line == ' ' ) line++;
#if defined TRACY_HW_TIMER && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
const auto time = ReadNumber( line );
#elif __ARM_ARCH >= 6
const auto ts = ReadNumber( line );
line++; // '.'
const auto tus = ReadNumber( line );
const auto time = ts * 1000000000ll + tus * 1000ll;
#endif
line += 2; // ': '
if( memcmp( line, "sched_switch", 12 ) == 0 )
{
line += 14;
while( memcmp( line, "prev_pid", 8 ) != 0 ) line++;
line += 9;
const auto oldPid = ReadNumber( line );
line++;
while( memcmp( line, "prev_state", 10 ) != 0 ) line++;
line += 11;
const auto oldState = (uint8_t)ReadState( *line );
line += 5;
while( memcmp( line, "next_pid", 8 ) != 0 ) line++;
line += 9;
const auto newPid = ReadNumber( line );
uint8_t reason = 100;
TracyLfqPrepare( QueueType::ContextSwitch );
MemWrite( &item->contextSwitch.time, time );
MemWrite( &item->contextSwitch.oldThread, oldPid );
MemWrite( &item->contextSwitch.newThread, newPid );
MemWrite( &item->contextSwitch.cpu, cpu );
MemWrite( &item->contextSwitch.reason, reason );
MemWrite( &item->contextSwitch.state, oldState );
TracyLfqCommit;
}
else if( memcmp( line, "sched_wakeup", 12 ) == 0 )
{
line += 14;
while( memcmp( line, "pid", 3 ) != 0 ) line++;
line += 4;
const auto pid = ReadNumber( line );
TracyLfqPrepare( QueueType::ThreadWakeup );
MemWrite( &item->threadWakeup.time, time );
MemWrite( &item->threadWakeup.thread, pid );
TracyLfqCommit;
}
}
#ifdef __ANDROID__
static void ProcessTraceLines( int fd )
{
// Linux pipe buffer is 64KB, additional 1KB is for unfinished lines
char* buf = (char*)tracy_malloc( (64+1)*1024 );
char* line = buf;
for(;;)
{
if( !traceActive.load( std::memory_order_relaxed ) ) break;
const auto rd = read( fd, line, 64*1024 );
if( rd <= 0 ) break;
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() )
{
if( rd < 64*1024 )
{
assert( line[rd-1] == '\n' );
line = buf;
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
}
else
{
const auto end = line + rd;
line = end - 1;
while( line > buf && *line != '\n' ) line--;
if( line > buf )
{
line++;
const auto lsz = end - line;
memmove( buf, line, lsz );
line = buf + lsz;
}
}
continue;
}
#endif
const auto end = line + rd;
line = buf;
for(;;)
{
auto next = line;
while( next < end && *next != '\n' ) next++;
next++;
if( next >= end )
{
const auto lsz = end - line;
memmove( buf, line, lsz );
line = buf + lsz;
break;
}
HandleTraceLine( line );
line = next;
}
if( rd < 64*1024 )
{
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
}
}
tracy_free( buf );
}
void SysTraceWorker( void* ptr )
{
SetThreadName( "Tracy SysTrace" );
int pipefd[2];
if( pipe( pipefd ) == 0 )
{
const auto pid = fork();
if( pid == 0 )
{
// child
close( pipefd[0] );
dup2( pipefd[1], STDERR_FILENO );
if( dup2( pipefd[1], STDOUT_FILENO ) >= 0 )
{
close( pipefd[1] );
#if defined __ANDROID__ && ( defined __aarch64__ || defined __ARM_ARCH )
execlp( "su", "su", "-c", "/data/tracy_systrace", (char*)nullptr );
#endif
execlp( "su", "su", "-c", "cat /sys/kernel/debug/tracing/trace_pipe", (char*)nullptr );
exit( 1 );
}
}
else if( pid > 0 )
{
// parent
close( pipefd[1] );
ProcessTraceLines( pipefd[0] );
close( pipefd[0] );
}
}
}
#else
static void ProcessTraceLines( int fd )
{
char* buf = (char*)tracy_malloc( 64*1024 );
struct pollfd pfd;
pfd.fd = fd;
pfd.events = POLLIN | POLLERR;
for(;;)
{
while( poll( &pfd, 1, 0 ) <= 0 )
{
if( !traceActive.load( std::memory_order_relaxed ) ) break;
std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
}
const auto rd = read( fd, buf, 64*1024 );
if( rd <= 0 ) break;
#ifdef TRACY_ON_DEMAND
if( !GetProfiler().IsConnected() ) continue;
#endif
auto line = buf;
const auto end = buf + rd;
for(;;)
{
auto next = line;
while( next < end && *next != '\n' ) next++;
if( next == end ) break;
assert( *next == '\n' );
next++;
HandleTraceLine( line );
line = next;
}
}
tracy_free( buf );
}
void SysTraceWorker( void* ptr )
{
SetThreadName( "Tracy SysTrace" );
char tmp[256];
memcpy( tmp, BasePath, sizeof( BasePath ) - 1 );
memcpy( tmp + sizeof( BasePath ) - 1, TracePipe, sizeof( TracePipe ) );
int fd = open( tmp, O_RDONLY );
if( fd < 0 ) return;
ProcessTraceLines( fd );
close( fd );
}
#endif
void SysTraceSendExternalName( uint64_t thread )
{
FILE* f;
char fn[256];
sprintf( fn, "/proc/%" PRIu64 "/comm", thread );
f = fopen( fn, "rb" );
if( f )
{
char buf[256];
const auto sz = fread( buf, 1, 256, f );
if( sz > 0 && buf[sz-1] == '\n' ) buf[sz-1] = '\0';
GetProfiler().SendString( thread, buf, QueueType::ExternalThreadName );
fclose( f );
}
else
{
GetProfiler().SendString( thread, "???", QueueType::ExternalThreadName );
}
sprintf( fn, "/proc/%" PRIu64 "/status", thread );
f = fopen( fn, "rb" );
if( f )
{
int pid = -1;
size_t lsz = 1024;
auto line = (char*)malloc( lsz );
for(;;)
{
auto rd = getline( &line, &lsz, f );
if( rd <= 0 ) break;
if( memcmp( "Tgid:\t", line, 6 ) == 0 )
{
pid = atoi( line + 6 );
break;
}
}
free( line );
fclose( f );
if( pid >= 0 )
{
{
uint64_t _pid = pid;
TracyLfqPrepare( QueueType::TidToPid );
MemWrite( &item->tidToPid.tid, thread );
MemWrite( &item->tidToPid.pid, _pid );
TracyLfqCommit;
}
sprintf( fn, "/proc/%i/comm", pid );
f = fopen( fn, "rb" );
if( f )
{
char buf[256];
const auto sz = fread( buf, 1, 256, f );
if( sz > 0 && buf[sz-1] == '\n' ) buf[sz-1] = '\0';
GetProfiler().SendString( thread, buf, QueueType::ExternalName );
fclose( f );
return;
}
}
}
GetProfiler().SendString( thread, "???", QueueType::ExternalName );
}
}
# endif
#endif

View File

@ -1,80 +0,0 @@
// File: '/home/wolf/desktop/tracy_systrace.armv7' (1210 bytes)`
// File: '/home/wolf/desktop/tracy_systrace.aarch64' (1650 bytes)
// Exported using binary_to_compressed_c.cpp
namespace tracy
{
static const unsigned int tracy_systrace_armv7_size = 1210;
static const unsigned int tracy_systrace_armv7_data[1212/4] =
{
0x464c457f, 0x00010101, 0x00000000, 0x00000000, 0x00280003, 0x00000001, 0x00000208, 0x00000034, 0x00000000, 0x05000200, 0x00200034, 0x00280007,
0x00000000, 0x00000006, 0x00000034, 0x00000034, 0x00000034, 0x000000e0, 0x000000e0, 0x00000004, 0x00000004, 0x00000003, 0x00000114, 0x00000114,
0x00000114, 0x00000013, 0x00000013, 0x00000004, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x000003ed, 0x000003ed, 0x00000005,
0x00001000, 0x00000001, 0x000003ed, 0x000013ed, 0x000013ed, 0x000000cd, 0x000000cf, 0x00000006, 0x00001000, 0x00000002, 0x000003f0, 0x000013f0,
0x000013f0, 0x000000b8, 0x000000b8, 0x00000006, 0x00000004, 0x6474e551, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000006,
0x00000010, 0x70000001, 0x00000394, 0x00000394, 0x00000394, 0x00000008, 0x00000008, 0x00000004, 0x00000004, 0x7379732f, 0x2f6d6574, 0x2f6e6962,
0x6b6e696c, 0x00007265, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000012, 0x00000016, 0x00000000,
0x00000000, 0x00000012, 0x6f6c6400, 0x006e6570, 0x4342494c, 0x62696c00, 0x732e6c64, 0x6c64006f, 0x006d7973, 0x00000001, 0x00000003, 0x00000001,
0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000003, 0x00000002, 0x00000000, 0x00000000, 0x00000001, 0x00020000, 0x00000002, 0x00010001,
0x0000000d, 0x00000010, 0x00000000, 0x00050d63, 0x00020000, 0x00000008, 0x00000000, 0x000014b4, 0x00000116, 0x000014b8, 0x00000216, 0xe52de004,
0xe59fe004, 0xe08fe00e, 0xe5bef008, 0x000012bc, 0xe28fc600, 0xe28cca01, 0xe5bcf2bc, 0xe28fc600, 0xe28cca01, 0xe5bcf2b4, 0xe92d4ff0, 0xe28db01c,
0xe24dd01c, 0xe24dd801, 0xe59f0154, 0xe3a01001, 0xe08f0000, 0xebfffff1, 0xe59f1148, 0xe1a07000, 0xe08f1001, 0xebfffff0, 0xe59f113c, 0xe1a09000,
0xe1a00007, 0xe08f1001, 0xebffffeb, 0xe59f112c, 0xe1a04000, 0xe1a00007, 0xe08f1001, 0xebffffe6, 0xe59f111c, 0xe1a05000, 0xe1a00007, 0xe08f1001,
0xebffffe1, 0xe59f110c, 0xe1a06000, 0xe1a00007, 0xe08f1001, 0xebffffdc, 0xe58d0004, 0xe1a00007, 0xe59f10f4, 0xe08f1001, 0xebffffd7, 0xe1a0a000,
0xe59f00e8, 0xe3a01000, 0xe3a08000, 0xe08f0000, 0xe12fff39, 0xe1a07000, 0xe3700001, 0xca000001, 0xe3a00000, 0xe12fff34, 0xe3a00009, 0xe58d4000,
0xe1cd01b4, 0xe3090680, 0xe3400098, 0xe28d4010, 0xe58d000c, 0xe28d9018, 0xe58d8008, 0xe28d8008, 0xe58d7010, 0xea000003, 0xe1a02000, 0xe3a00001,
0xe1a01009, 0xe12fff3a, 0xe1a00004, 0xe3a01001, 0xe3a02000, 0xe12fff35, 0xe3500000, 0xca000008, 0xe1a00008, 0xe3a01000, 0xe12fff36, 0xe1a00004,
0xe3a01001, 0xe3a02000, 0xe12fff35, 0xe3500001, 0xbafffff6, 0xe59d3004, 0xe1a00007, 0xe1a01009, 0xe3a02801, 0xe12fff33, 0xe3500001, 0xaaffffe5,
0xe59d1000, 0xe3a00000, 0xe12fff31, 0xe24bd01c, 0xe8bd8ff0, 0x00000174, 0x0000016c, 0x0000015d, 0x0000014e, 0x0000013f, 0x00000135, 0x00000126,
0x00000114, 0x7ffffe74, 0x00000001, 0x6362696c, 0x006f732e, 0x6e65706f, 0x69786500, 0x6f700074, 0x6e006c6c, 0x736f6e61, 0x7065656c, 0x61657200,
0x72770064, 0x00657469, 0x7379732f, 0x72656b2f, 0x2f6c656e, 0x75626564, 0x72742f67, 0x6e696361, 0x72742f67, 0x5f656361, 0x65706970, 0x00000000,
0x00000003, 0x000014a8, 0x00000002, 0x00000010, 0x00000017, 0x000001cc, 0x00000014, 0x00000011, 0x00000015, 0x00000000, 0x00000006, 0x00000128,
0x0000000b, 0x00000010, 0x00000005, 0x00000158, 0x0000000a, 0x0000001c, 0x6ffffef5, 0x00000174, 0x00000004, 0x0000018c, 0x00000001, 0x0000000d,
0x0000001e, 0x00000008, 0x6ffffffb, 0x00000001, 0x6ffffff0, 0x000001a4, 0x6ffffffe, 0x000001ac, 0x6fffffff, 0x00000001, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x000001dc, 0x000001dc,
};
static const unsigned int tracy_systrace_aarch64_size = 1650;
static const unsigned int tracy_systrace_aarch64_data[1652/4] =
{
0x464c457f, 0x00010102, 0x00000000, 0x00000000, 0x00b70003, 0x00000001, 0x00000300, 0x00000000, 0x00000040, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00380040, 0x00400006, 0x00000000, 0x00000006, 0x00000005, 0x00000040, 0x00000000, 0x00000040, 0x00000000, 0x00000040, 0x00000000,
0x00000150, 0x00000000, 0x00000150, 0x00000000, 0x00000008, 0x00000000, 0x00000003, 0x00000004, 0x00000190, 0x00000000, 0x00000190, 0x00000000,
0x00000190, 0x00000000, 0x00000015, 0x00000000, 0x00000015, 0x00000000, 0x00000001, 0x00000000, 0x00000001, 0x00000005, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000004d1, 0x00000000, 0x000004d1, 0x00000000, 0x00010000, 0x00000000, 0x00000001, 0x00000006,
0x000004d8, 0x00000000, 0x000104d8, 0x00000000, 0x000104d8, 0x00000000, 0x0000019a, 0x00000000, 0x000001a0, 0x00000000, 0x00010000, 0x00000000,
0x00000002, 0x00000006, 0x000004d8, 0x00000000, 0x000104d8, 0x00000000, 0x000104d8, 0x00000000, 0x00000170, 0x00000000, 0x00000170, 0x00000000,
0x00000008, 0x00000000, 0x6474e551, 0x00000006, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000010, 0x00000000, 0x7379732f, 0x2f6d6574, 0x2f6e6962, 0x6b6e696c, 0x34367265, 0x00000000, 0x00000001, 0x00000004,
0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0x00000000, 0x00000001, 0x00000001, 0x00000001, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000a0003, 0x00000300, 0x00000000,
0x00000000, 0x00000000, 0x0000000a, 0x00000012, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000011, 0x00000012, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x62696c00, 0x732e6c64, 0x6c64006f, 0x6e65706f, 0x736c6400, 0x4c006d79, 0x00434249, 0x00000000, 0x00020002, 0x00000000,
0x00010001, 0x00000001, 0x00000010, 0x00000000, 0x00050d63, 0x00020000, 0x00000017, 0x00000000, 0x00010668, 0x00000000, 0x00000402, 0x00000002,
0x00000000, 0x00000000, 0x00010670, 0x00000000, 0x00000402, 0x00000003, 0x00000000, 0x00000000, 0xa9bf7bf0, 0x90000090, 0xf9433211, 0x91198210,
0xd61f0220, 0xd503201f, 0xd503201f, 0xd503201f, 0x90000090, 0xf9433611, 0x9119a210, 0xd61f0220, 0x90000090, 0xf9433a11, 0x9119c210, 0xd61f0220,
0xf81b0ffc, 0xa9015ff8, 0xa90257f6, 0xa9034ff4, 0xa9047bfd, 0x910103fd, 0xd14043ff, 0xd10043ff, 0x90000000, 0x91120000, 0x320003e1, 0x97ffffed,
0x90000001, 0x91122021, 0xaa0003f7, 0x97ffffed, 0x90000001, 0xaa0003f8, 0x91123421, 0xaa1703e0, 0x97ffffe8, 0x90000001, 0xaa0003f3, 0x91124821,
0xaa1703e0, 0x97ffffe3, 0x90000001, 0xaa0003f4, 0x91125c21, 0xaa1703e0, 0x97ffffde, 0x90000001, 0xaa0003f5, 0x91128421, 0xaa1703e0, 0x97ffffd9,
0x90000001, 0xaa0003f6, 0x91129821, 0xaa1703e0, 0x97ffffd4, 0xaa0003f7, 0x90000000, 0x9112b000, 0x2a1f03e1, 0xd63f0300, 0x2a0003f8, 0x36f80060,
0x2a1f03e0, 0xd63f0260, 0x90000008, 0x3dc11d00, 0x52800128, 0xb81c83b8, 0x781cc3a8, 0x3d8003e0, 0x14000005, 0x93407c02, 0x320003e0, 0x910043e1,
0xd63f02e0, 0xd100e3a0, 0x320003e1, 0x2a1f03e2, 0xd63f0280, 0x7100001f, 0x5400014c, 0x910003e0, 0xaa1f03e1, 0xd63f02a0, 0xd100e3a0, 0x320003e1,
0x2a1f03e2, 0xd63f0280, 0x7100041f, 0x54ffff0b, 0x910043e1, 0x321003e2, 0x2a1803e0, 0xd63f02c0, 0x7100041f, 0x54fffd0a, 0x2a1f03e0, 0xd63f0260,
0x914043ff, 0x910043ff, 0xa9447bfd, 0xa9434ff4, 0xa94257f6, 0xa9415ff8, 0xf84507fc, 0xd65f03c0, 0x00000000, 0x00000000, 0x00989680, 0x00000000,
0x6362696c, 0x006f732e, 0x6e65706f, 0x69786500, 0x6f700074, 0x6e006c6c, 0x736f6e61, 0x7065656c, 0x61657200, 0x72770064, 0x00657469, 0x7379732f,
0x72656b2f, 0x2f6c656e, 0x75626564, 0x72742f67, 0x6e696361, 0x72742f67, 0x5f656361, 0x65706970, 0x00000000, 0x00000000, 0x00000001, 0x00000000,
0x00000001, 0x00000000, 0x00000004, 0x00000000, 0x000001a8, 0x00000000, 0x6ffffef5, 0x00000000, 0x000001c8, 0x00000000, 0x00000005, 0x00000000,
0x00000248, 0x00000000, 0x00000006, 0x00000000, 0x000001e8, 0x00000000, 0x0000000a, 0x00000000, 0x0000001c, 0x00000000, 0x0000000b, 0x00000000,
0x00000018, 0x00000000, 0x00000015, 0x00000000, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00010650, 0x00000000, 0x00000002, 0x00000000,
0x00000030, 0x00000000, 0x00000014, 0x00000000, 0x00000007, 0x00000000, 0x00000017, 0x00000000, 0x00000290, 0x00000000, 0x0000001e, 0x00000000,
0x00000008, 0x00000000, 0x6ffffffb, 0x00000000, 0x00000001, 0x00000000, 0x6ffffffe, 0x00000000, 0x00000270, 0x00000000, 0x6fffffff, 0x00000000,
0x00000001, 0x00000000, 0x6ffffff0, 0x00000000, 0x00000264, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000104d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x000002c0, 0x00000000, 0x000002c0,
};
}

File diff suppressed because it is too large Load Diff

1269
cmake/CPM.cmake Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,300 @@
#.rst:
# ECMFindModuleHelpers
# --------------------
#
# Helper macros for find modules: ecm_find_package_version_check(),
# ecm_find_package_parse_components() and
# ecm_find_package_handle_library_components().
#
# ::
#
# ecm_find_package_version_check(<name>)
#
# Prints warnings if the CMake version or the project's required CMake version
# is older than that required by extra-cmake-modules.
#
# ::
#
# ecm_find_package_parse_components(<name>
# RESULT_VAR <variable>
# KNOWN_COMPONENTS <component1> [<component2> [...]]
# [SKIP_DEPENDENCY_HANDLING])
#
# This macro will populate <variable> with a list of components found in
# <name>_FIND_COMPONENTS, after checking that all those components are in the
# list of KNOWN_COMPONENTS; if there are any unknown components, it will print
# an error or warning (depending on the value of <name>_FIND_REQUIRED) and call
# return().
#
# The order of components in <variable> is guaranteed to match the order they
# are listed in the KNOWN_COMPONENTS argument.
#
# If SKIP_DEPENDENCY_HANDLING is not set, for each component the variable
# <name>_<component>_component_deps will be checked for dependent components.
# If <component> is listed in <name>_FIND_COMPONENTS, then all its (transitive)
# dependencies will also be added to <variable>.
#
# ::
#
# ecm_find_package_handle_library_components(<name>
# COMPONENTS <component> [<component> [...]]
# [SKIP_DEPENDENCY_HANDLING])
# [SKIP_PKG_CONFIG])
#
# Creates an imported library target for each component. The operation of this
# macro depends on the presence of a number of CMake variables.
#
# The <name>_<component>_lib variable should contain the name of this library,
# and <name>_<component>_header variable should contain the name of a header
# file associated with it (whatever relative path is normally passed to
# '#include'). <name>_<component>_header_subdir variable can be used to specify
# which subdirectory of the include path the headers will be found in.
# ecm_find_package_components() will then search for the library
# and include directory (creating appropriate cache variables) and create an
# imported library target named <name>::<component>.
#
# Additional variables can be used to provide additional information:
#
# If SKIP_PKG_CONFIG, the <name>_<component>_pkg_config variable is set, and
# pkg-config is found, the pkg-config module given by
# <name>_<component>_pkg_config will be searched for and used to help locate the
# library and header file. It will also be used to set
# <name>_<component>_VERSION.
#
# Note that if version information is found via pkg-config,
# <name>_<component>_FIND_VERSION can be set to require a particular version
# for each component.
#
# If SKIP_DEPENDENCY_HANDLING is not set, the INTERFACE_LINK_LIBRARIES property
# of the imported target for <component> will be set to contain the imported
# targets for the components listed in <name>_<component>_component_deps.
# <component>_FOUND will also be set to false if any of the components in
# <name>_<component>_component_deps are not found. This requires the components
# in <name>_<component>_component_deps to be listed before <component> in the
# COMPONENTS argument.
#
# The following variables will be set:
#
# ``<name>_TARGETS``
# the imported targets
# ``<name>_LIBRARIES``
# the found libraries
# ``<name>_INCLUDE_DIRS``
# the combined required include directories for the components
# ``<name>_DEFINITIONS``
# the "other" CFLAGS provided by pkg-config, if any
# ``<name>_VERSION``
# the value of ``<name>_<component>_VERSION`` for the first component that
# has this variable set (note that components are searched for in the order
# they are passed to the macro), although if it is already set, it will not
# be altered
#
# Note that these variables are never cleared, so if
# ecm_find_package_handle_library_components() is called multiple times with
# different components (typically because of multiple find_package() calls) then
# ``<name>_TARGETS``, for example, will contain all the targets found in any
# call (although no duplicates).
#
# Since pre-1.0.0.
#=============================================================================
# Copyright 2014 Alex Merry <alex.merry@kde.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
macro(ecm_find_package_version_check module_name)
if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "CMake 2.8.12 is required by Find${module_name}.cmake")
endif()
if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12)
message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Find${module_name}.cmake")
endif()
endmacro()
macro(ecm_find_package_parse_components module_name)
set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING)
set(ecm_fppc_oneValueArgs RESULT_VAR)
set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS)
cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN})
if(ECM_FPPC_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}")
endif()
if(NOT ECM_FPPC_RESULT_VAR)
message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components")
endif()
if(NOT ECM_FPPC_KNOWN_COMPONENTS)
message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components")
endif()
if(NOT ECM_FPPC_DEFAULT_COMPONENTS)
set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS})
endif()
if(${module_name}_FIND_COMPONENTS)
set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS})
if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING)
# Make sure deps are included
foreach(ecm_fppc_comp ${ecm_fppc_requestedComps})
foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps})
list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index)
if("${ecm_fppc_index}" STREQUAL "-1")
if(NOT ${module_name}_FIND_QUIETLY)
message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}")
endif()
list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}")
endif()
endforeach()
endforeach()
else()
message(STATUS "Skipping dependency handling for ${module_name}")
endif()
list(REMOVE_DUPLICATES ecm_fppc_requestedComps)
# This makes sure components are listed in the same order as
# KNOWN_COMPONENTS (potentially important for inter-dependencies)
set(${ECM_FPPC_RESULT_VAR})
foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS})
list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index)
if(NOT "${ecm_fppc_index}" STREQUAL "-1")
list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}")
list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index})
endif()
endforeach()
# if there are any left, they are unknown components
if(ecm_fppc_requestedComps)
set(ecm_fppc_msgType STATUS)
if(${module_name}_FIND_REQUIRED)
set(ecm_fppc_msgType FATAL_ERROR)
endif()
if(NOT ${module_name}_FIND_QUIETLY)
message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}")
endif()
return()
endif()
else()
set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS})
endif()
endmacro()
macro(ecm_find_package_handle_library_components module_name)
set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING)
set(ecm_fpwc_oneValueArgs)
set(ecm_fpwc_multiValueArgs COMPONENTS)
cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN})
if(ECM_FPWC_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}")
endif()
if(NOT ECM_FPWC_COMPONENTS)
message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components")
endif()
include(FindPackageHandleStandardArgs)
find_package(PkgConfig QUIET)
foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS})
set(ecm_fpwc_dep_vars)
set(ecm_fpwc_dep_targets)
if(NOT SKIP_DEPENDENCY_HANDLING)
foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps})
list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND")
list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}")
endforeach()
endif()
if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config)
pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET
${${module_name}_${ecm_fpwc_comp}_pkg_config})
endif()
find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
NAMES ${${module_name}_${ecm_fpwc_comp}_header}
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS}
PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir}
)
find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY
NAMES ${${module_name}_${ecm_fpwc_comp}_lib}
HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS}
)
set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}")
if(NOT ${module_name}_VERSION)
set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION})
endif()
set(_name_mismatched_arg)
if(NOT CMAKE_VERSION VERSION_LESS 3.17)
set(_name_mismatched_arg NAME_MISMATCHED)
endif()
find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp}
FOUND_VAR
${module_name}_${ecm_fpwc_comp}_FOUND
REQUIRED_VARS
${module_name}_${ecm_fpwc_comp}_LIBRARY
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
${ecm_fpwc_dep_vars}
VERSION_VAR
${module_name}_${ecm_fpwc_comp}_VERSION
${_name_mismatched_arg}
)
mark_as_advanced(
${module_name}_${ecm_fpwc_comp}_LIBRARY
${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR
)
if(${module_name}_${ecm_fpwc_comp}_FOUND)
list(APPEND ${module_name}_LIBRARIES
"${${module_name}_${ecm_fpwc_comp}_LIBRARY}")
list(APPEND ${module_name}_INCLUDE_DIRS
"${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}")
set(${module_name}_DEFINITIONS
${${module_name}_DEFINITIONS}
${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS})
if(NOT TARGET ${module_name}::${ecm_fpwc_comp})
add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED)
set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES
IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}"
)
endif()
list(APPEND ${module_name}_TARGETS
"${module_name}::${ecm_fpwc_comp}")
endif()
endforeach()
if(${module_name}_LIBRARIES)
list(REMOVE_DUPLICATES ${module_name}_LIBRARIES)
endif()
if(${module_name}_INCLUDE_DIRS)
list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS)
endif()
if(${module_name}_DEFINITIONS)
list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS)
endif()
if(${module_name}_TARGETS)
list(REMOVE_DUPLICATES ${module_name}_TARGETS)
endif()
endmacro()

View File

@ -0,0 +1,170 @@
#.rst:
# FindWaylandScanner
# ------------------
#
# Try to find wayland-scanner.
#
# If the wayland-scanner executable is not in your PATH, you can provide
# an alternative name or full path location with the ``WaylandScanner_EXECUTABLE``
# variable.
#
# This will define the following variables:
#
# ``WaylandScanner_FOUND``
# True if wayland-scanner is available.
#
# ``WaylandScanner_EXECUTABLE``
# The wayland-scanner executable.
#
# If ``WaylandScanner_FOUND`` is TRUE, it will also define the following imported
# target:
#
# ``Wayland::Scanner``
# The wayland-scanner executable.
#
# This module provides the following functions to generate C protocol
# implementations:
#
# - ``ecm_add_wayland_client_protocol``
# - ``ecm_add_wayland_server_protocol``
#
# ::
#
# ecm_add_wayland_client_protocol(<source_files_var>
# PROTOCOL <xmlfile>
# BASENAME <basename>)
#
# Generate Wayland client protocol files from ``<xmlfile>`` XML
# definition for the ``<basename>`` interface and append those files
# to ``<source_files_var>``.
#
# ::
#
# ecm_add_wayland_server_protocol(<source_files_var>
# PROTOCOL <xmlfile>
# BASENAME <basename>)
#
# Generate Wayland server protocol files from ``<xmlfile>`` XML
# definition for the ``<basename>`` interface and append those files
# to ``<source_files_var>``.
#
# Since 1.4.0.
#=============================================================================
# Copyright 2012-2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake)
ecm_find_package_version_check(WaylandScanner)
# Find wayland-scanner
find_program(WaylandScanner_EXECUTABLE NAMES wayland-scanner)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(WaylandScanner
FOUND_VAR
WaylandScanner_FOUND
REQUIRED_VARS
WaylandScanner_EXECUTABLE
)
mark_as_advanced(WaylandScanner_EXECUTABLE)
if(NOT TARGET Wayland::Scanner AND WaylandScanner_FOUND)
add_executable(Wayland::Scanner IMPORTED)
set_target_properties(Wayland::Scanner PROPERTIES
IMPORTED_LOCATION "${WaylandScanner_EXECUTABLE}"
)
endif()
include(FeatureSummary)
set_package_properties(WaylandScanner PROPERTIES
URL "https://wayland.freedesktop.org/"
DESCRIPTION "Executable that converts XML protocol files to C code"
)
function(ecm_add_wayland_client_protocol out_var)
# Parse arguments
set(oneValueArgs PROTOCOL BASENAME)
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN})
if(ARGS_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_client_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
endif()
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-client-protocol.h")
set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-protocol.c")
set_source_files_properties(${_client_header} GENERATED)
set_source_files_properties(${_code} GENERATED)
set_property(SOURCE ${_client_header} PROPERTY SKIP_AUTOMOC ON)
add_custom_command(OUTPUT "${_client_header}"
COMMAND ${WaylandScanner_EXECUTABLE} client-header ${_infile} ${_client_header}
DEPENDS ${WaylandScanner_EXECUTABLE} ${_infile}
VERBATIM
)
add_custom_command(OUTPUT "${_code}"
COMMAND ${WaylandScanner_EXECUTABLE} private-code ${_infile} ${_code}
DEPENDS ${WaylandScanner_EXECUTABLE} ${_infile} ${_client_header}
VERBATIM
)
list(APPEND ${out_var} "${_client_header}" "${_code}")
set(${out_var} ${${out_var}} PARENT_SCOPE)
endfunction()
function(ecm_add_wayland_server_protocol out_var)
# Parse arguments
set(oneValueArgs PROTOCOL BASENAME)
cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN})
if(ARGS_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_server_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"")
endif()
ecm_add_wayland_client_protocol(${out_var}
PROTOCOL ${ARGS_PROTOCOL}
BASENAME ${ARGS_BASENAME})
get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE)
set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-server-protocol.h")
set_property(SOURCE ${_server_header} PROPERTY SKIP_AUTOMOC ON)
set_source_files_properties(${_server_header} GENERATED)
add_custom_command(OUTPUT "${_server_header}"
COMMAND ${WaylandScanner_EXECUTABLE} server-header ${_infile} ${_server_header}
DEPENDS ${WaylandScanner_EXECUTABLE} ${_infile}
VERBATIM
)
list(APPEND ${out_var} "${_server_header}")
set(${out_var} ${${out_var}} PARENT_SCOPE)
endfunction()

62
cmake/config.cmake Normal file
View File

@ -0,0 +1,62 @@
if (NOT NO_ISA_EXTENSIONS)
include(CheckCXXCompilerFlag)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
CHECK_CXX_COMPILER_FLAG("-mcpu=native" COMPILER_SUPPORTS_MCPU_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE)
add_compile_options(-mcpu=native)
endif()
else()
CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE)
if(COMPILER_SUPPORTS_MARCH_NATIVE)
add_compile_options(-march=native)
endif()
endif()
if(WIN32)
add_compile_options(/arch:AVX2)
endif()
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT LEGACY)
set(USE_WAYLAND ON)
else()
set(USE_WAYLAND OFF)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fexperimental-library>)
endif()
endif()
if(WIN32)
add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
add_compile_options(/MP)
endif()
if(EMSCRIPTEN)
add_compile_options(-pthread -DIMGUI_IMPL_OPENGL_ES2)
endif()
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT EMSCRIPTEN)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_program(MOLD_LINKER mold)
if(MOLD_LINKER)
set(CMAKE_LINKER_TYPE "MOLD")
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(-fno-eliminate-unused-debug-types)
endif()
endif()
find_program(CCACHE ccache)
if(CCACHE)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
endif()
file(GENERATE OUTPUT .gitignore CONTENT "*")
set(CMAKE_COLOR_DIAGNOSTICS ON)

View File

@ -0,0 +1,12 @@
diff --git a/extra_symbols.txt b/extra_symbols.txt
index b95bb58..6b8f616 100644
--- a/extra_symbols.txt
+++ b/extra_symbols.txt
@@ -1,3 +1,7 @@
+glCompressedTexImage2D
+GL_LINEAR_MIPMAP_LINEAR
+GL_TEXTURE_WRAP_S
+GL_TEXTURE_WRAP_T
glReadPixels
glClearColor
glClear

View File

@ -0,0 +1,14 @@
diff '--color=auto' -ruN 72d8f61727dc878102157113d1998f86b852d20e/imconfig.h new/imconfig.h
--- 72d8f61727dc878102157113d1998f86b852d20e/imconfig.h 2024-09-27 14:28:05.568760349 +0200
+++ new/imconfig.h 2024-09-27 14:29:47.310243707 +0200
@@ -113,6 +113,10 @@
// Read about ImGuiBackendFlags_RendererHasVtxOffset for details.
//#define ImDrawIdx unsigned int
+#ifdef __EMSCRIPTEN__
+#define ImDrawIdx unsigned int
+#endif
+
//---- Override ImDrawCallback signature (will need to modify renderer backends accordingly)
//struct ImDrawList;
//struct ImDrawCmd;

56
cmake/imgui-loader.patch Normal file
View File

@ -0,0 +1,56 @@
diff --git a/backends/imgui_impl_opengl3_loader.h b/backends/imgui_impl_opengl3_loader.h
index d6ffa5a2d..e48372c64 100644
--- a/backends/imgui_impl_opengl3_loader.h
+++ b/backends/imgui_impl_opengl3_loader.h
@@ -179,6 +179,7 @@ typedef khronos_uint8_t GLubyte;
#define GL_VERSION 0x1F02
#define GL_EXTENSIONS 0x1F03
#define GL_LINEAR 0x2601
+#define GL_LINEAR_MIPMAP_LINEAR 0x2703
#define GL_TEXTURE_MAG_FILTER 0x2800
#define GL_TEXTURE_MIN_FILTER 0x2801
#define GL_TEXTURE_WRAP_S 0x2802
@@ -241,8 +242,10 @@ GLAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures);
#define GL_TEXTURE0 0x84C0
#define GL_ACTIVE_TEXTURE 0x84E0
typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
+typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glActiveTexture (GLenum texture);
+GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
#endif
#endif /* GL_VERSION_1_3 */
#ifndef GL_VERSION_1_4
@@ -478,7 +481,7 @@ GL3W_API GL3WglProc imgl3wGetProcAddress(const char *proc);
/* gl3w internal state */
union ImGL3WProcs {
- GL3WglProc ptr[59];
+ GL3WglProc ptr[60];
struct {
PFNGLACTIVETEXTUREPROC ActiveTexture;
PFNGLATTACHSHADERPROC AttachShader;
@@ -494,6 +497,7 @@ union ImGL3WProcs {
PFNGLCLEARPROC Clear;
PFNGLCLEARCOLORPROC ClearColor;
PFNGLCOMPILESHADERPROC CompileShader;
+ PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D;
PFNGLCREATEPROGRAMPROC CreateProgram;
PFNGLCREATESHADERPROC CreateShader;
PFNGLDELETEBUFFERSPROC DeleteBuffers;
@@ -559,6 +563,7 @@ GL3W_API extern union ImGL3WProcs imgl3wProcs;
#define glClear imgl3wProcs.gl.Clear
#define glClearColor imgl3wProcs.gl.ClearColor
#define glCompileShader imgl3wProcs.gl.CompileShader
+#define glCompressedTexImage2D imgl3wProcs.gl.CompressedTexImage2D
#define glCreateProgram imgl3wProcs.gl.CreateProgram
#define glCreateShader imgl3wProcs.gl.CreateShader
#define glDeleteBuffers imgl3wProcs.gl.DeleteBuffers
@@ -854,6 +859,7 @@ static const char *proc_names[] = {
"glClear",
"glClearColor",
"glCompileShader",
+ "glCompressedTexImage2D",
"glCreateProgram",
"glCreateShader",
"glDeleteBuffers",

35
cmake/server.cmake Normal file
View File

@ -0,0 +1,35 @@
set(TRACY_COMMON_DIR ${CMAKE_CURRENT_LIST_DIR}/../public/common)
set(TRACY_COMMON_SOURCES
tracy_lz4.cpp
tracy_lz4hc.cpp
TracySocket.cpp
TracyStackFrames.cpp
TracySystem.cpp
)
list(TRANSFORM TRACY_COMMON_SOURCES PREPEND "${TRACY_COMMON_DIR}/")
set(TRACY_SERVER_DIR ${CMAKE_CURRENT_LIST_DIR}/../server)
set(TRACY_SERVER_SOURCES
TracyMemory.cpp
TracyMmap.cpp
TracyPrint.cpp
TracySysUtil.cpp
TracyTaskDispatch.cpp
TracyTextureCompression.cpp
TracyThreadCompress.cpp
TracyWorker.cpp
)
list(TRANSFORM TRACY_SERVER_SOURCES PREPEND "${TRACY_SERVER_DIR}/")
add_library(TracyServer STATIC EXCLUDE_FROM_ALL ${TRACY_COMMON_SOURCES} ${TRACY_SERVER_SOURCES})
target_include_directories(TracyServer PUBLIC ${TRACY_COMMON_DIR} ${TRACY_SERVER_DIR})
target_link_libraries(TracyServer PUBLIC TracyCapstone libzstd PPQSort::PPQSort)
if(NO_STATISTICS)
target_compile_definitions(TracyServer PUBLIC TRACY_NO_STATISTICS)
endif()

222
cmake/vendor.cmake Normal file
View File

@ -0,0 +1,222 @@
# Vendor Specific CMake
# The Tracy project keeps most vendor source locally
set (ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../")
# Dependencies are taken from the system first and if not found, they are pulled with CPM and built from source
include(FindPkgConfig)
include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake)
option(DOWNLOAD_CAPSTONE "Force download capstone" ON)
option(DOWNLOAD_GLFW "Force download glfw" OFF)
option(DOWNLOAD_FREETYPE "Force download freetype" OFF)
# capstone
pkg_check_modules(CAPSTONE capstone)
if(CAPSTONE_FOUND AND NOT DOWNLOAD_CAPSTONE)
message(STATUS "Capstone found: ${CAPSTONE}")
add_library(TracyCapstone INTERFACE)
target_include_directories(TracyCapstone INTERFACE ${CAPSTONE_INCLUDE_DIRS})
target_link_libraries(TracyCapstone INTERFACE ${CAPSTONE_LINK_LIBRARIES})
else()
CPMAddPackage(
NAME capstone
GITHUB_REPOSITORY capstone-engine/capstone
GIT_TAG 6.0.0-Alpha1
OPTIONS
"CAPSTONE_X86_ATT_DISABLE ON"
"CAPSTONE_ALPHA_SUPPORT OFF"
"CAPSTONE_HPPA_SUPPORT OFF"
"CAPSTONE_LOONGARCH_SUPPORT OFF"
"CAPSTONE_M680X_SUPPORT OFF"
"CAPSTONE_M68K_SUPPORT OFF"
"CAPSTONE_MIPS_SUPPORT OFF"
"CAPSTONE_MOS65XX_SUPPORT OFF"
"CAPSTONE_PPC_SUPPORT OFF"
"CAPSTONE_SPARC_SUPPORT OFF"
"CAPSTONE_SYSTEMZ_SUPPORT OFF"
"CAPSTONE_XCORE_SUPPORT OFF"
"CAPSTONE_TRICORE_SUPPORT OFF"
"CAPSTONE_TMS320C64X_SUPPORT OFF"
"CAPSTONE_M680X_SUPPORT OFF"
"CAPSTONE_EVM_SUPPORT OFF"
"CAPSTONE_WASM_SUPPORT OFF"
"CAPSTONE_BPF_SUPPORT OFF"
"CAPSTONE_RISCV_SUPPORT OFF"
"CAPSTONE_SH_SUPPORT OFF"
"CAPSTONE_XTENSA_SUPPORT OFF"
"CAPSTONE_BUILD_MACOS_THIN ON"
EXCLUDE_FROM_ALL TRUE
)
add_library(TracyCapstone INTERFACE)
target_include_directories(TracyCapstone INTERFACE ${capstone_SOURCE_DIR}/include/capstone)
target_link_libraries(TracyCapstone INTERFACE capstone)
endif()
# GLFW
if(NOT USE_WAYLAND AND NOT EMSCRIPTEN)
pkg_check_modules(GLFW glfw3)
if (GLFW_FOUND AND NOT DOWNLOAD_GLFW)
add_library(TracyGlfw3 INTERFACE)
target_include_directories(TracyGlfw3 INTERFACE ${GLFW_INCLUDE_DIRS})
target_link_libraries(TracyGlfw3 INTERFACE ${GLFW_LINK_LIBRARIES})
else()
CPMAddPackage(
NAME glfw
GITHUB_REPOSITORY glfw/glfw
GIT_TAG 3.4
OPTIONS
"GLFW_BUILD_EXAMPLES OFF"
"GLFW_BUILD_TESTS OFF"
"GLFW_BUILD_DOCS OFF"
"GLFW_INSTALL OFF"
EXCLUDE_FROM_ALL TRUE
)
add_library(TracyGlfw3 INTERFACE)
target_link_libraries(TracyGlfw3 INTERFACE glfw)
endif()
endif()
# freetype
pkg_check_modules(FREETYPE freetype2)
if (FREETYPE_FOUND AND NOT DOWNLOAD_FREETYPE)
add_library(TracyFreetype INTERFACE)
target_include_directories(TracyFreetype INTERFACE ${FREETYPE_INCLUDE_DIRS})
target_link_libraries(TracyFreetype INTERFACE ${FREETYPE_LINK_LIBRARIES})
else()
CPMAddPackage(
NAME freetype
GITHUB_REPOSITORY freetype/freetype
GIT_TAG VER-2-13-3
OPTIONS
"FT_DISABLE_HARFBUZZ ON"
"FT_WITH_HARFBUZZ OFF"
EXCLUDE_FROM_ALL TRUE
)
add_library(TracyFreetype INTERFACE)
target_link_libraries(TracyFreetype INTERFACE freetype)
endif()
# Zstd
CPMAddPackage(
NAME zstd
GITHUB_REPOSITORY facebook/zstd
GIT_TAG v1.5.7
OPTIONS
"ZSTD_BUILD_SHARED OFF"
EXCLUDE_FROM_ALL TRUE
SOURCE_SUBDIR build/cmake
)
# Diff Template Library
set(DTL_DIR "${ROOT_DIR}/dtl")
file(GLOB_RECURSE DTL_HEADERS CONFIGURE_DEPENDS RELATIVE ${DTL_DIR} "*.hpp")
add_library(TracyDtl INTERFACE)
target_sources(TracyDtl INTERFACE ${DTL_HEADERS})
target_include_directories(TracyDtl INTERFACE ${DTL_DIR})
# Get Opt
set(GETOPT_DIR "${ROOT_DIR}/getopt")
set(GETOPT_SOURCES ${GETOPT_DIR}/getopt.c)
set(GETOPT_HEADERS ${GETOPT_DIR}/getopt.h)
add_library(TracyGetOpt STATIC EXCLUDE_FROM_ALL ${GETOPT_SOURCES} ${GETOPT_HEADERS})
target_include_directories(TracyGetOpt PUBLIC ${GETOPT_DIR})
# ImGui
CPMAddPackage(
NAME ImGui
GITHUB_REPOSITORY ocornut/imgui
GIT_TAG v1.91.8-docking
DOWNLOAD_ONLY TRUE
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/imgui-emscripten.patch"
"${CMAKE_CURRENT_LIST_DIR}/imgui-loader.patch"
)
set(IMGUI_SOURCES
imgui_widgets.cpp
imgui_draw.cpp
imgui_demo.cpp
imgui.cpp
imgui_tables.cpp
misc/freetype/imgui_freetype.cpp
backends/imgui_impl_opengl3.cpp
)
list(TRANSFORM IMGUI_SOURCES PREPEND "${ImGui_SOURCE_DIR}/")
add_library(TracyImGui STATIC EXCLUDE_FROM_ALL ${IMGUI_SOURCES})
target_include_directories(TracyImGui PUBLIC ${ImGui_SOURCE_DIR})
target_link_libraries(TracyImGui PUBLIC TracyFreetype)
target_compile_definitions(TracyImGui PRIVATE "IMGUI_ENABLE_FREETYPE")
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_definitions(TracyImGui PRIVATE "IMGUI_DISABLE_DEBUG_TOOLS")
endif()
# NFD
if (NOT NO_FILESELECTOR AND NOT EMSCRIPTEN)
set(NFD_DIR "${ROOT_DIR}/nfd")
if (WIN32)
set(NFD_SOURCES "${NFD_DIR}/nfd_win.cpp")
elseif (APPLE)
set(NFD_SOURCES "${NFD_DIR}/nfd_cocoa.m")
else()
if (GTK_FILESELECTOR)
set(NFD_SOURCES "${NFD_DIR}/nfd_gtk.cpp")
else()
set(NFD_SOURCES "${NFD_DIR}/nfd_portal.cpp")
endif()
endif()
file(GLOB_RECURSE NFD_HEADERS CONFIGURE_DEPENDS RELATIVE ${NFD_DIR} "*.h")
add_library(TracyNfd STATIC EXCLUDE_FROM_ALL ${NFD_SOURCES} ${NFD_HEADERS})
target_include_directories(TracyNfd PUBLIC ${NFD_DIR})
if (APPLE)
find_library(APPKIT_LIBRARY AppKit)
find_library(UNIFORMTYPEIDENTIFIERS_LIBRARY UniformTypeIdentifiers)
target_link_libraries(TracyNfd PUBLIC ${APPKIT_LIBRARY} ${UNIFORMTYPEIDENTIFIERS_LIBRARY})
elseif (UNIX)
if (GTK_FILESELECTOR)
pkg_check_modules(GTK3 gtk+-3.0)
if (NOT GTK3_FOUND)
message(FATAL_ERROR "GTK3 not found. Please install it or set GTK_FILESELECTOR to OFF.")
endif()
add_library(TracyGtk3 INTERFACE)
target_include_directories(TracyGtk3 INTERFACE ${GTK3_INCLUDE_DIRS})
target_link_libraries(TracyGtk3 INTERFACE ${GTK3_LINK_LIBRARIES})
target_link_libraries(TracyNfd PUBLIC TracyGtk3)
else()
pkg_check_modules(DBUS dbus-1)
if (NOT DBUS_FOUND)
message(FATAL_ERROR "D-Bus not found. Please install it or set GTK_FILESELECTOR to ON.")
endif()
add_library(TracyDbus INTERFACE)
target_include_directories(TracyDbus INTERFACE ${DBUS_INCLUDE_DIRS})
target_link_libraries(TracyDbus INTERFACE ${DBUS_LINK_LIBRARIES})
target_link_libraries(TracyNfd PUBLIC TracyDbus)
endif()
endif()
endif()
# PPQSort
CPMAddPackage(
NAME PPQSort
GITHUB_REPOSITORY GabTux/PPQSort
VERSION 1.0.5
EXCLUDE_FROM_ALL TRUE
)

24
cmake/version.cmake Normal file
View File

@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.10)
message("Parsing public/common/TracyVersion.hpp file")
file(READ "${CMAKE_CURRENT_LIST_DIR}/../public/common/TracyVersion.hpp" version)
# Note: This looks for a specific pattern in TracyVersion.hpp, if it changes
# this needs updating.
string(REGEX MATCH "Major = ([0-9]+)" _ ${version})
# This works do to the above () subexpression selection. See
# https://cmake.org/cmake/help/latest/command/string.html#regex-match for more
# details
set(TRACY_VERSION_MAJOR ${CMAKE_MATCH_1})
string(REGEX MATCH "Minor = ([0-9]+)" _ ${version})
set(TRACY_VERSION_MINOR ${CMAKE_MATCH_1})
string(REGEX MATCH "Patch = ([0-9]+)" _ ${version})
set(TRACY_VERSION_PATCH ${CMAKE_MATCH_1})
set(TRACY_VERSION_STRING "${TRACY_VERSION_MAJOR}.${TRACY_VERSION_MINOR}.${TRACY_VERSION_PATCH}")
message("VERSION ${TRACY_VERSION_STRING}")

View File

@ -1,33 +0,0 @@
#ifndef __TRACYALLOC_HPP__
#define __TRACYALLOC_HPP__
#include <stdlib.h>
#ifdef TRACY_ENABLE
# include "../client/tracy_rpmalloc.hpp"
#endif
namespace tracy
{
static inline void* tracy_malloc( size_t size )
{
#ifdef TRACY_ENABLE
return rpmalloc( size );
#else
return malloc( size );
#endif
}
static inline void tracy_free( void* ptr )
{
#ifdef TRACY_ENABLE
rpfree( ptr );
#else
free( ptr );
#endif
}
}
#endif

View File

@ -1,604 +0,0 @@
#ifndef __TRACYQUEUE_HPP__
#define __TRACYQUEUE_HPP__
#include <stdint.h>
namespace tracy
{
enum class QueueType : uint8_t
{
ZoneText,
ZoneName,
Message,
MessageColor,
MessageCallstack,
MessageColorCallstack,
MessageAppInfo,
ZoneBeginAllocSrcLoc,
ZoneBeginAllocSrcLocLean,
ZoneBeginAllocSrcLocCallstack,
ZoneBeginAllocSrcLocCallstackLean,
CallstackMemory,
CallstackMemoryLean,
Callstack,
CallstackLean,
CallstackAlloc,
CallstackAllocLean,
CallstackSample,
CallstackSampleLean,
FrameImage,
FrameImageLean,
ZoneBegin,
ZoneBeginCallstack,
ZoneEnd,
LockWait,
LockObtain,
LockRelease,
LockSharedWait,
LockSharedObtain,
LockSharedRelease,
LockName,
MemAlloc,
MemFree,
MemAllocCallstack,
MemFreeCallstack,
GpuZoneBegin,
GpuZoneBeginCallstack,
GpuZoneEnd,
GpuZoneBeginSerial,
GpuZoneBeginCallstackSerial,
GpuZoneEndSerial,
PlotData,
ContextSwitch,
ThreadWakeup,
GpuTime,
Terminate,
KeepAlive,
ThreadContext,
Crash,
CrashReport,
ZoneValidation,
ZoneValue,
FrameMarkMsg,
FrameMarkMsgStart,
FrameMarkMsgEnd,
SourceLocation,
LockAnnounce,
LockTerminate,
LockMark,
MessageLiteral,
MessageLiteralColor,
MessageLiteralCallstack,
MessageLiteralColorCallstack,
GpuNewContext,
CallstackFrameSize,
CallstackFrame,
SymbolInformation,
CodeInformation,
SysTimeReport,
TidToPid,
PlotConfig,
ParamSetup,
ParamPingback,
CpuTopology,
StringData,
ThreadName,
CustomStringData,
PlotName,
SourceLocationPayload,
CallstackPayload,
CallstackAllocPayload,
FrameName,
FrameImageData,
ExternalName,
ExternalThreadName,
SymbolCode,
NUM_TYPES
};
#pragma pack( 1 )
struct QueueThreadContext
{
uint64_t thread;
};
struct QueueZoneBeginLean
{
int64_t time;
};
struct QueueZoneBegin : public QueueZoneBeginLean
{
uint64_t srcloc; // ptr
};
struct QueueZoneEnd
{
int64_t time;
};
struct QueueZoneValidation
{
uint32_t id;
};
struct QueueZoneValue
{
uint64_t value;
};
struct QueueStringTransfer
{
uint64_t ptr;
};
struct QueueFrameMark
{
int64_t time;
uint64_t name; // ptr
};
struct QueueFrameImageLean
{
uint64_t frame;
uint16_t w;
uint16_t h;
uint8_t flip;
};
struct QueueFrameImage : public QueueFrameImageLean
{
uint64_t image; // ptr
};
struct QueueSourceLocation
{
uint64_t name;
uint64_t function; // ptr
uint64_t file; // ptr
uint32_t line;
uint8_t r;
uint8_t g;
uint8_t b;
};
struct QueueZoneText
{
uint64_t text; // ptr
};
enum class LockType : uint8_t
{
Lockable,
SharedLockable
};
struct QueueLockAnnounce
{
uint32_t id;
int64_t time;
uint64_t lckloc; // ptr
LockType type;
};
struct QueueLockTerminate
{
uint32_t id;
int64_t time;
LockType type;
};
struct QueueLockWait
{
uint64_t thread;
uint32_t id;
int64_t time;
LockType type;
};
struct QueueLockObtain
{
uint64_t thread;
uint32_t id;
int64_t time;
};
struct QueueLockRelease
{
uint64_t thread;
uint32_t id;
int64_t time;
};
struct QueueLockMark
{
uint64_t thread;
uint32_t id;
uint64_t srcloc; // ptr
};
struct QueueLockName
{
uint32_t id;
uint64_t name; // ptr
};
enum class PlotDataType : uint8_t
{
Float,
Double,
Int
};
struct QueuePlotData
{
uint64_t name; // ptr
int64_t time;
PlotDataType type;
union
{
double d;
float f;
int64_t i;
} data;
};
struct QueueMessage
{
int64_t time;
uint64_t text; // ptr
};
struct QueueMessageColor : public QueueMessage
{
uint8_t r;
uint8_t g;
uint8_t b;
};
// Don't change order, only add new entries at the end, this is also used on trace dumps!
enum class GpuContextType : uint8_t
{
Invalid,
OpenGl,
Vulkan,
OpenCL,
Direct3D12
};
struct QueueGpuNewContext
{
int64_t cpuTime;
int64_t gpuTime;
uint64_t thread;
float period;
uint8_t context;
uint8_t accuracyBits;
GpuContextType type;
};
struct QueueGpuZoneBegin
{
int64_t cpuTime;
uint64_t srcloc;
uint64_t thread;
uint16_t queryId;
uint8_t context;
};
struct QueueGpuZoneEnd
{
int64_t cpuTime;
uint64_t thread;
uint16_t queryId;
uint8_t context;
};
struct QueueGpuTime
{
int64_t gpuTime;
uint16_t queryId;
uint8_t context;
};
struct QueueMemAlloc
{
int64_t time;
uint64_t thread;
uint64_t ptr;
char size[6];
};
struct QueueMemFree
{
int64_t time;
uint64_t thread;
uint64_t ptr;
};
struct QueueCallstackMemory
{
uint64_t ptr;
};
struct QueueCallstack
{
uint64_t ptr;
};
struct QueueCallstackAlloc
{
uint64_t ptr;
uint64_t nativePtr;
};
struct QueueCallstackSampleLean
{
int64_t time;
uint64_t thread;
};
struct QueueCallstackSample : public QueueCallstackSampleLean
{
uint64_t ptr;
};
struct QueueCallstackFrameSize
{
uint64_t ptr;
uint8_t size;
uint64_t imageName;
};
struct QueueCallstackFrame
{
uint64_t name;
uint64_t file;
uint32_t line;
uint64_t symAddr;
char symLen[3];
};
struct QueueSymbolInformation
{
uint64_t file;
uint32_t line;
uint64_t symAddr;
};
struct QueueCodeInformation
{
uint64_t ptr;
uint64_t file;
uint32_t line;
};
struct QueueCrashReport
{
int64_t time;
uint64_t text; // ptr
};
struct QueueSysTime
{
int64_t time;
float sysTime;
};
struct QueueContextSwitch
{
int64_t time;
uint64_t oldThread;
uint64_t newThread;
uint8_t cpu;
uint8_t reason;
uint8_t state;
};
struct QueueThreadWakeup
{
int64_t time;
uint64_t thread;
};
struct QueueTidToPid
{
uint64_t tid;
uint64_t pid;
};
enum class PlotFormatType : uint8_t
{
Number,
Memory,
Percentage
};
struct QueuePlotConfig
{
uint64_t name; // ptr
uint8_t type;
};
struct QueueParamSetup
{
uint32_t idx;
uint64_t name; // ptr
uint8_t isBool;
int32_t val;
};
struct QueueCpuTopology
{
uint32_t package;
uint32_t core;
uint32_t thread;
};
struct QueueHeader
{
union
{
QueueType type;
uint8_t idx;
};
};
struct QueueItem
{
QueueHeader hdr;
union
{
QueueThreadContext threadCtx;
QueueZoneBegin zoneBegin;
QueueZoneBeginLean zoneBeginLean;
QueueZoneEnd zoneEnd;
QueueZoneValidation zoneValidation;
QueueZoneValue zoneValue;
QueueStringTransfer stringTransfer;
QueueFrameMark frameMark;
QueueFrameImage frameImage;
QueueFrameImage frameImageLean;
QueueSourceLocation srcloc;
QueueZoneText zoneText;
QueueLockAnnounce lockAnnounce;
QueueLockTerminate lockTerminate;
QueueLockWait lockWait;
QueueLockObtain lockObtain;
QueueLockRelease lockRelease;
QueueLockMark lockMark;
QueueLockName lockName;
QueuePlotData plotData;
QueueMessage message;
QueueMessageColor messageColor;
QueueGpuNewContext gpuNewContext;
QueueGpuZoneBegin gpuZoneBegin;
QueueGpuZoneEnd gpuZoneEnd;
QueueGpuTime gpuTime;
QueueMemAlloc memAlloc;
QueueMemFree memFree;
QueueCallstackMemory callstackMemory;
QueueCallstack callstack;
QueueCallstackAlloc callstackAlloc;
QueueCallstackSample callstackSample;
QueueCallstackSampleLean callstackSampleLean;
QueueCallstackFrameSize callstackFrameSize;
QueueCallstackFrame callstackFrame;
QueueSymbolInformation symbolInformation;
QueueCodeInformation codeInformation;
QueueCrashReport crashReport;
QueueSysTime sysTime;
QueueContextSwitch contextSwitch;
QueueThreadWakeup threadWakeup;
QueueTidToPid tidToPid;
QueuePlotConfig plotConfig;
QueueParamSetup paramSetup;
QueueCpuTopology cpuTopology;
};
};
#pragma pack()
enum { QueueItemSize = sizeof( QueueItem ) };
static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ) + sizeof( QueueZoneText ),
sizeof( QueueHeader ) + sizeof( QueueZoneText ), // zone name
sizeof( QueueHeader ) + sizeof( QueueMessage ),
sizeof( QueueHeader ) + sizeof( QueueMessageColor ),
sizeof( QueueHeader ) + sizeof( QueueMessage ), // callstack
sizeof( QueueHeader ) + sizeof( QueueMessageColor ), // callstack
sizeof( QueueHeader ) + sizeof( QueueMessage ), // app info
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), // allocated source location, not for network transfer
sizeof( QueueHeader ) + sizeof( QueueZoneBeginLean ), // lean allocated source location
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), // allocated source location, callstack, not for network transfer
sizeof( QueueHeader ) + sizeof( QueueZoneBeginLean ), // lean allocated source location, callstack
sizeof( QueueHeader ) + sizeof( QueueCallstackMemory ), // not for network transfer
sizeof( QueueHeader ), // lean callstack memory
sizeof( QueueHeader ) + sizeof( QueueCallstack ), // not for network transfer
sizeof( QueueHeader ), // lean callstack
sizeof( QueueHeader ) + sizeof( QueueCallstackAlloc ), // not for network transfer
sizeof( QueueHeader ), // lean callstack alloc
sizeof( QueueHeader ) + sizeof( QueueCallstackSample ), // not for network transfer
sizeof( QueueHeader ) + sizeof( QueueCallstackSampleLean ),
sizeof( QueueHeader ) + sizeof( QueueFrameImage ), // not for network transfer
sizeof( QueueHeader ) + sizeof( QueueFrameImageLean ),
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ),
sizeof( QueueHeader ) + sizeof( QueueZoneBegin ), // callstack
sizeof( QueueHeader ) + sizeof( QueueZoneEnd ),
sizeof( QueueHeader ) + sizeof( QueueLockWait ),
sizeof( QueueHeader ) + sizeof( QueueLockObtain ),
sizeof( QueueHeader ) + sizeof( QueueLockRelease ),
sizeof( QueueHeader ) + sizeof( QueueLockWait ), // shared
sizeof( QueueHeader ) + sizeof( QueueLockObtain ), // shared
sizeof( QueueHeader ) + sizeof( QueueLockRelease ), // shared
sizeof( QueueHeader ) + sizeof( QueueLockName ),
sizeof( QueueHeader ) + sizeof( QueueMemAlloc ),
sizeof( QueueHeader ) + sizeof( QueueMemFree ),
sizeof( QueueHeader ) + sizeof( QueueMemAlloc ), // callstack
sizeof( QueueHeader ) + sizeof( QueueMemFree ), // callstack
sizeof( QueueHeader ) + sizeof( QueueGpuZoneBegin ),
sizeof( QueueHeader ) + sizeof( QueueGpuZoneBegin ), // callstack
sizeof( QueueHeader ) + sizeof( QueueGpuZoneEnd ),
sizeof( QueueHeader ) + sizeof( QueueGpuZoneBegin ), // serial
sizeof( QueueHeader ) + sizeof( QueueGpuZoneBegin ), // serial, callstack
sizeof( QueueHeader ) + sizeof( QueueGpuZoneEnd ), // serial
sizeof( QueueHeader ) + sizeof( QueuePlotData ),
sizeof( QueueHeader ) + sizeof( QueueContextSwitch ),
sizeof( QueueHeader ) + sizeof( QueueThreadWakeup ),
sizeof( QueueHeader ) + sizeof( QueueGpuTime ),
// above items must be first
sizeof( QueueHeader ), // terminate
sizeof( QueueHeader ), // keep alive
sizeof( QueueHeader ) + sizeof( QueueThreadContext ),
sizeof( QueueHeader ), // crash
sizeof( QueueHeader ) + sizeof( QueueCrashReport ),
sizeof( QueueHeader ) + sizeof( QueueZoneValidation ),
sizeof( QueueHeader ) + sizeof( QueueZoneValue ),
sizeof( QueueHeader ) + sizeof( QueueFrameMark ), // continuous frames
sizeof( QueueHeader ) + sizeof( QueueFrameMark ), // start
sizeof( QueueHeader ) + sizeof( QueueFrameMark ), // end
sizeof( QueueHeader ) + sizeof( QueueSourceLocation ),
sizeof( QueueHeader ) + sizeof( QueueLockAnnounce ),
sizeof( QueueHeader ) + sizeof( QueueLockTerminate ),
sizeof( QueueHeader ) + sizeof( QueueLockMark ),
sizeof( QueueHeader ) + sizeof( QueueMessage ), // literal
sizeof( QueueHeader ) + sizeof( QueueMessageColor ), // literal
sizeof( QueueHeader ) + sizeof( QueueMessage ), // literal, callstack
sizeof( QueueHeader ) + sizeof( QueueMessageColor ), // literal, callstack
sizeof( QueueHeader ) + sizeof( QueueGpuNewContext ),
sizeof( QueueHeader ) + sizeof( QueueCallstackFrameSize ),
sizeof( QueueHeader ) + sizeof( QueueCallstackFrame ),
sizeof( QueueHeader ) + sizeof( QueueSymbolInformation ),
sizeof( QueueHeader ) + sizeof( QueueCodeInformation ),
sizeof( QueueHeader ) + sizeof( QueueSysTime ),
sizeof( QueueHeader ) + sizeof( QueueTidToPid ),
sizeof( QueueHeader ) + sizeof( QueuePlotConfig ),
sizeof( QueueHeader ) + sizeof( QueueParamSetup ),
sizeof( QueueHeader ), // param pingback
sizeof( QueueHeader ) + sizeof( QueueCpuTopology ),
// keep all QueueStringTransfer below
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // string data
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // thread name
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // custom string data
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // plot name
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // allocated source location payload
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // callstack payload
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // callstack alloc payload
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // frame name
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // frame image data
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // external name
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // external thread name
sizeof( QueueHeader ) + sizeof( QueueStringTransfer ), // symbol code
};
static_assert( QueueItemSize == 32, "Queue item size not 32 bytes" );
static_assert( sizeof( QueueDataSize ) / sizeof( size_t ) == (uint8_t)QueueType::NUM_TYPES, "QueueDataSize mismatch" );
static_assert( sizeof( void* ) <= sizeof( uint64_t ), "Pointer size > 8 bytes" );
static_assert( sizeof( void* ) == sizeof( uintptr_t ), "Pointer size != uintptr_t" );
}
#endif

View File

@ -1,239 +0,0 @@
#if defined _MSC_VER || defined __CYGWIN__ || defined _WIN32
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# ifndef NOMINMAX
# define NOMINMAX
# endif
#endif
#ifdef _MSC_VER
# pragma warning(disable:4996)
#endif
#if defined _WIN32 || defined __CYGWIN__
# include <windows.h>
#else
# include <pthread.h>
# include <string.h>
# include <unistd.h>
#endif
#ifdef __linux__
# ifdef __ANDROID__
# include <sys/types.h>
# else
# include <sys/syscall.h>
# endif
# include <fcntl.h>
#elif defined __FreeBSD__
# include <sys/thr.h>
#elif defined __NetBSD__ || defined __DragonFly__
# include <sys/lwp.h>
#endif
#ifdef __MINGW32__
# define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include "TracySystem.hpp"
#if defined _WIN32 || defined __CYGWIN__
extern "C" typedef HRESULT (WINAPI *t_SetThreadDescription)( HANDLE, PCWSTR );
extern "C" typedef HRESULT (WINAPI *t_GetThreadDescription)( HANDLE, PWSTR* );
#endif
#ifdef TRACY_ENABLE
# include <atomic>
# include "TracyAlloc.hpp"
#endif
namespace tracy
{
namespace detail
{
TRACY_API uint64_t GetThreadHandleImpl()
{
#if defined _WIN32 || defined __CYGWIN__
static_assert( sizeof( decltype( GetCurrentThreadId() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
return uint64_t( GetCurrentThreadId() );
#elif defined __APPLE__
uint64_t id;
pthread_threadid_np( pthread_self(), &id );
return id;
#elif defined __ANDROID__
return (uint64_t)gettid();
#elif defined __linux__
return (uint64_t)syscall( SYS_gettid );
#elif defined __FreeBSD__
long id;
thr_self( &id );
return id;
#elif defined __NetBSD__
return _lwp_self();
#elif defined __DragonFly__
return lwp_gettid();
#elif defined __OpenBSD__
return getthrid();
#else
static_assert( sizeof( decltype( pthread_self() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
return uint64_t( pthread_self() );
#endif
}
}
#ifdef TRACY_ENABLE
struct ThreadNameData
{
uint64_t id;
const char* name;
ThreadNameData* next;
};
std::atomic<ThreadNameData*>& GetThreadNameData();
TRACY_API void InitRPMallocThread();
#endif
TRACY_API void SetThreadName( const char* name )
{
#if defined _WIN32 || defined __CYGWIN__
static auto _SetThreadDescription = (t_SetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "SetThreadDescription" );
if( _SetThreadDescription )
{
wchar_t buf[256];
mbstowcs( buf, name, 256 );
_SetThreadDescription( GetCurrentThread(), buf );
}
else
{
# if defined _MSC_VER
const DWORD MS_VC_EXCEPTION=0x406D1388;
# pragma pack( push, 8 )
struct THREADNAME_INFO
{
DWORD dwType;
LPCSTR szName;
DWORD dwThreadID;
DWORD dwFlags;
};
# pragma pack(pop)
DWORD ThreadId = GetCurrentThreadId();
THREADNAME_INFO info;
info.dwType = 0x1000;
info.szName = name;
info.dwThreadID = ThreadId;
info.dwFlags = 0;
__try
{
RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info );
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
}
# endif
}
#elif defined _GNU_SOURCE && !defined __EMSCRIPTEN__ && !defined __CYGWIN__
{
const auto sz = strlen( name );
if( sz <= 15 )
{
pthread_setname_np( pthread_self(), name );
}
else
{
char buf[16];
memcpy( buf, name, 15 );
buf[15] = '\0';
pthread_setname_np( pthread_self(), buf );
}
}
#endif
#ifdef TRACY_ENABLE
{
InitRPMallocThread();
const auto sz = strlen( name );
char* buf = (char*)tracy_malloc( sz+1 );
memcpy( buf, name, sz );
buf[sz] = '\0';
auto data = (ThreadNameData*)tracy_malloc( sizeof( ThreadNameData ) );
data->id = detail::GetThreadHandleImpl();
data->name = buf;
data->next = GetThreadNameData().load( std::memory_order_relaxed );
while( !GetThreadNameData().compare_exchange_weak( data->next, data, std::memory_order_release, std::memory_order_relaxed ) ) {}
}
#endif
}
TRACY_API const char* GetThreadName( uint64_t id )
{
static char buf[256];
#ifdef TRACY_ENABLE
auto ptr = GetThreadNameData().load( std::memory_order_relaxed );
while( ptr )
{
if( ptr->id == id )
{
return ptr->name;
}
ptr = ptr->next;
}
#else
# if defined _WIN32 || defined __CYGWIN__
static auto _GetThreadDescription = (t_GetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetThreadDescription" );
if( _GetThreadDescription )
{
auto hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, (DWORD)id );
if( hnd != 0 )
{
PWSTR tmp;
_GetThreadDescription( hnd, &tmp );
auto ret = wcstombs( buf, tmp, 256 );
CloseHandle( hnd );
if( ret != 0 )
{
return buf;
}
}
}
# elif defined __linux__
int cs, fd;
char path[32];
# ifdef __ANDROID__
int tid = gettid();
# else
int tid = (int) syscall( SYS_gettid );
# endif
snprintf( path, sizeof( path ), "/proc/self/task/%d/comm", tid );
sprintf( buf, "%" PRIu64, id );
# ifndef __ANDROID__
pthread_setcancelstate( PTHREAD_CANCEL_DISABLE, &cs );
# endif
if ( ( fd = open( path, O_RDONLY ) ) > 0) {
int len = read( fd, buf, 255 );
if( len > 0 )
{
buf[len] = 0;
if( len > 1 && buf[len-1] == '\n' )
{
buf[len-1] = 0;
}
}
close( fd );
}
# ifndef __ANDROID__
pthread_setcancelstate( cs, 0 );
# endif
return buf;
# endif
#endif
sprintf( buf, "%" PRIu64, id );
return buf;
}
}

View File

@ -1,30 +0,0 @@
#ifndef __TRACYSYSTEM_HPP__
#define __TRACYSYSTEM_HPP__
#include <stdint.h>
#include "TracyApi.h"
namespace tracy
{
namespace detail
{
TRACY_API uint64_t GetThreadHandleImpl();
}
#ifdef TRACY_ENABLE
TRACY_API uint64_t GetThreadHandle();
#else
static inline uint64_t GetThreadHandle()
{
return detail::GetThreadHandleImpl();
}
#endif
TRACY_API void SetThreadName( const char* name );
TRACY_API const char* GetThreadName( uint64_t id );
}
#endif

29
csvexport/CMakeLists.txt Normal file
View File

@ -0,0 +1,29 @@
cmake_minimum_required(VERSION 3.16)
option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF)
set(NO_STATISTICS OFF)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake)
set(CMAKE_CXX_STANDARD 20)
project(
tracy-csvexport
LANGUAGES C CXX
VERSION ${TRACY_VERSION_STRING}
)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake)
set(PROGRAM_FILES
src/csvexport.cpp
)
add_executable(${PROJECT_NAME} ${PROGRAM_FILES} ${COMMON_FILES} ${SERVER_FILES})
target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyGetOpt)
set_property(DIRECTORY ${CMAKE_CURRENT_LIST_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})

454
csvexport/src/csvexport.cpp Normal file
View File

@ -0,0 +1,454 @@
#ifdef _WIN32
# include <windows.h>
#endif
#include <algorithm>
#include <cctype>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <stdint.h>
#include "../../server/TracyFileRead.hpp"
#include "../../server/TracyWorker.hpp"
#include "../../getopt/getopt.h"
void print_usage_exit(int e)
{
fprintf(stderr, "Extract statistics from a trace to a CSV format\n");
fprintf(stderr, "Usage:\n");
fprintf(stderr, " extract [OPTION...] <trace file>\n");
fprintf(stderr, "\n");
fprintf(stderr, " -h, --help Print usage\n");
fprintf(stderr, " -f, --filter arg Filter zone names (default: "")\n");
fprintf(stderr, " -s, --sep arg CSV separator (default: ,)\n");
fprintf(stderr, " -c, --case Case sensitive filtering\n");
fprintf(stderr, " -e, --self Get self times\n");
fprintf(stderr, " -u, --unwrap Report each cpu zone event\n");
fprintf(stderr, " -g, --gpu Report each gpu zone event\n" );
fprintf(stderr, " -m, --messages Report only messages\n");
fprintf(stderr, " -p, --plot Report plot data (only with -u)\n");
exit(e);
}
struct Args {
const char* filter;
const char* separator;
const char* trace_file;
bool case_sensitive;
bool self_time;
bool unwrap;
bool show_gpu;
bool unwrapMessages;
bool plot;
};
Args parse_args(int argc, char** argv)
{
if (argc == 1)
{
print_usage_exit(1);
}
Args args = { "", ",", "", false, false, false, false, false, false };
struct option long_opts[] = {
{ "help", no_argument, NULL, 'h' },
{ "filter", optional_argument, NULL, 'f' },
{ "sep", optional_argument, NULL, 's' },
{ "case", no_argument, NULL, 'c' },
{ "self", no_argument, NULL, 'e' },
{ "unwrap", no_argument, NULL, 'u' },
{ "gpu", no_argument, NULL, 'g' },
{ "messages", no_argument, NULL, 'm' },
{ "plot", no_argument, NULL, 'p' },
{ NULL, 0, NULL, 0 }
};
int c;
while ((c = getopt_long(argc, argv, "hf:s:ceugmp", long_opts, NULL)) != -1)
{
switch (c)
{
case 'h':
print_usage_exit(0);
break;
case 'f':
args.filter = optarg;
break;
case 's':
args.separator = optarg;
break;
case 'c':
args.case_sensitive = true;
break;
case 'e':
args.self_time = true;
break;
case 'u':
args.unwrap = true;
break;
case 'g':
args.show_gpu = true;
break;
case 'm':
args.unwrapMessages = true;
break;
case 'p':
args.plot = true;
break;
default:
print_usage_exit(1);
break;
}
}
if (argc != optind + 1)
{
print_usage_exit(1);
}
args.trace_file = argv[optind];
return args;
}
bool is_substring(
const char* term,
const char* s,
bool case_sensitive = false
){
auto new_term = std::string(term);
auto new_s = std::string(s);
if (!case_sensitive) {
std::transform(
new_term.begin(),
new_term.end(),
new_term.begin(),
[](unsigned char c){ return std::tolower(c); }
);
std::transform(
new_s.begin(),
new_s.end(),
new_s.begin(),
[](unsigned char c){ return std::tolower(c); }
);
}
return new_s.find(new_term) != std::string::npos;
}
const char* get_name(int32_t id, const tracy::Worker& worker)
{
auto& srcloc = worker.GetSourceLocation(id);
return worker.GetString(srcloc.name.active ? srcloc.name : srcloc.function);
}
template <typename T>
std::string join(const T& v, const char* sep) {
std::ostringstream s;
for (const auto& i : v) {
if (&i != &v[0]) {
s << sep;
}
s << i;
}
return s.str();
}
// From TracyView.cpp
int64_t GetZoneChildTimeFast(
const tracy::Worker& worker,
const tracy::ZoneEvent& zone
){
int64_t time = 0;
if( zone.HasChildren() )
{
auto& children = worker.GetZoneChildren( zone.Child() );
if( children.is_magic() )
{
auto& vec = *(tracy::Vector<tracy::ZoneEvent>*)&children;
for( auto& v : vec )
{
assert( v.IsEndValid() );
time += v.End() - v.Start();
}
}
else
{
for( auto& v : children )
{
assert( v->IsEndValid() );
time += v->End() - v->Start();
}
}
}
return time;
}
int main(int argc, char** argv)
{
#ifdef _WIN32
if (!AttachConsole(ATTACH_PARENT_PROCESS))
{
AllocConsole();
SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), 0x07);
}
#endif
Args args = parse_args(argc, argv);
auto f = std::unique_ptr<tracy::FileRead>(
tracy::FileRead::Open(args.trace_file)
);
if (!f)
{
fprintf(stderr, "Could not open file %s\n", args.trace_file);
return 1;
}
auto worker = tracy::Worker(*f);
if (args.unwrapMessages)
{
const auto& msgs = worker.GetMessages();
if (msgs.size() > 0)
{
std::vector<const char*> columnsForMessages;
columnsForMessages = {
"MessageName", "total_ns"
};
std::string headerForMessages = join(columnsForMessages, args.separator);
printf("%s\n", headerForMessages.data());
for(auto& it : msgs)
{
std::vector<std::string> values(columnsForMessages.size());
values[0] = worker.GetString(it->ref);
values[1] = std::to_string(it->time);
std::string row = join(values, args.separator);
printf("%s\n", row.data());
}
}
else
{
printf("There are currently no messages!\n");
}
return 0;
}
while (!worker.AreSourceLocationZonesReady())
{
std::this_thread::sleep_for(std::chrono::milliseconds(10));
}
if (args.show_gpu)
{
auto& gpu_slz = worker.GetGpuSourceLocationZones();
tracy::Vector<decltype( gpu_slz.begin() )> gpu_slz_selected;
gpu_slz_selected.reserve( gpu_slz.size() );
uint32_t total_cnt = 0;
for (auto it = gpu_slz.begin(); it != gpu_slz.end(); ++it)
{
if (it->second.total != 0)
{
++total_cnt;
if (args.filter[0] == '\0')
{
gpu_slz_selected.push_back_no_space_check( it );
}
else
{
auto name = get_name( it->first, worker );
if (is_substring( args.filter, name, args.case_sensitive))
{
gpu_slz_selected.push_back_no_space_check( it );
}
}
}
}
std::vector<const char*> columns;
columns = {"name", "src_file", "Time from start of program", "GPU execution time"};
std::string header = join(columns, args.separator);
printf("%s\n", header.data());
const auto last_time = worker.GetLastTime();
for (auto& it : gpu_slz_selected)
{
std::vector<std::string> values( columns.size() );
values[0] = get_name( it->first, worker );
const auto& srcloc = worker.GetSourceLocation( it->first );
values[1] = worker.GetString( srcloc.file );
const auto& zone_data = it->second;
for (const auto& zone_thread_data : zone_data.zones)
{
tracy::GpuEvent* gpu_event = zone_thread_data.Zone();
const auto start = gpu_event->GpuStart();
const auto end = gpu_event->GpuEnd();
values[2] = std::to_string( start );
auto timespan = end - start;
values[3] = std::to_string( timespan );
std::string row = join( values, args.separator );
printf( "%s\n", row.data() );
}
}
return 0;
}
auto& slz = worker.GetSourceLocationZones();
tracy::Vector<decltype(slz.begin())> slz_selected;
slz_selected.reserve(slz.size());
uint32_t total_cnt = 0;
for(auto it = slz.begin(); it != slz.end(); ++it)
{
if(it->second.total != 0)
{
++total_cnt;
if(args.filter[0] == '\0')
{
slz_selected.push_back_no_space_check(it);
}
else
{
auto name = get_name(it->first, worker);
if(is_substring(args.filter, name, args.case_sensitive))
{
slz_selected.push_back_no_space_check(it);
}
}
}
}
std::vector<const char*> columns;
if (args.unwrap)
{
columns = {
"name", "src_file", "src_line", "ns_since_start", "exec_time_ns", "thread", "value"
};
}
else
{
columns = {
"name", "src_file", "src_line", "total_ns", "total_perc",
"counts", "mean_ns", "min_ns", "max_ns", "std_ns"
};
}
std::string header = join(columns, args.separator);
printf("%s\n", header.data());
const auto last_time = worker.GetLastTime();
for(auto& it : slz_selected)
{
std::vector<std::string> values(columns.size());
values[0] = get_name(it->first, worker);
const auto& srcloc = worker.GetSourceLocation(it->first);
values[1] = worker.GetString(srcloc.file);
values[2] = std::to_string(srcloc.line);
const auto& zone_data = it->second;
if (args.unwrap)
{
int i = 0;
for (const auto& zone_thread_data : zone_data.zones) {
const auto zone_event = zone_thread_data.Zone();
const auto tId = zone_thread_data.Thread();
const auto start = zone_event->Start();
const auto end = zone_event->End();
values[3] = std::to_string(start);
auto timespan = end - start;
if (args.self_time) {
timespan -= GetZoneChildTimeFast(worker, *zone_event);
}
values[4] = std::to_string(timespan);
values[5] = std::to_string(tId);
if (worker.HasZoneExtra(*zone_event)) {
const auto& text = worker.GetZoneExtra(*zone_event).text;
if (text.Active()) {
values[6] = worker.GetString(text);
}
}
std::string row = join(values, args.separator);
printf("%s\n", row.data());
}
}
else
{
const auto time = args.self_time ? zone_data.selfTotal : zone_data.total;
values[3] = std::to_string(time);
values[4] = std::to_string(100. * time / last_time);
values[5] = std::to_string(zone_data.zones.size());
const auto avg = (args.self_time ? zone_data.selfTotal : zone_data.total)
/ zone_data.zones.size();
values[6] = std::to_string(avg);
const auto tmin = args.self_time ? zone_data.selfMin : zone_data.min;
const auto tmax = args.self_time ? zone_data.selfMax : zone_data.max;
values[7] = std::to_string(tmin);
values[8] = std::to_string(tmax);
const auto sz = zone_data.zones.size();
const auto ss = zone_data.sumSq
- 2. * zone_data.total * avg
+ avg * avg * sz;
double std = 0;
if( sz > 1 )
std = sqrt(ss / (sz - 1));
values[9] = std::to_string(std);
std::string row = join(values, args.separator);
printf("%s\n", row.data());
}
}
if(args.plot && args.unwrap)
{
auto& plots = worker.GetPlots();
for(const auto& plot : plots)
{
std::vector<std::string> values(columns.size());
values[0] = worker.GetString(plot->name);
for(const auto& val : plot->data)
{
if (args.unwrap)
{
values[3] = std::to_string(val.time.Val());
values[6] = std::to_string(val.val);
}
std::string row = join(values, args.separator);
printf("%s\n", row.data());
}
}
}
return 0;
}

View File

@ -1,370 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
id="svg8"
version="1.1"
viewBox="0 0 139.17125 37.041668"
height="140"
width="526.00159">
<defs
id="defs2">
<marker
style="overflow:visible"
id="marker6660"
refX="0"
refY="0"
orient="auto">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path6658" />
</marker>
<marker
style="overflow:visible"
id="marker6158"
refX="0"
refY="0"
orient="auto">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path6156" />
</marker>
<marker
style="overflow:visible"
id="Arrow1Send"
refX="0"
refY="0"
orient="auto">
<path
transform="matrix(-0.2,0,0,-0.2,-1.2,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path4694" />
</marker>
<marker
style="overflow:visible"
id="marker5984"
refX="0"
refY="0"
orient="auto">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path5982" />
</marker>
<marker
orient="auto"
refY="0"
refX="0"
id="marker5482"
style="overflow:visible">
<path
id="path5480"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.4,0,0,-0.4,-4,0)" />
</marker>
<marker
orient="auto"
refY="0"
refX="0"
id="marker5472"
style="overflow:visible">
<path
id="path5470"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.4,0,0,-0.4,-4,0)" />
</marker>
<marker
style="overflow:visible"
id="marker5378"
refX="0"
refY="0"
orient="auto">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path5376" />
</marker>
<marker
style="overflow:visible"
id="marker5308"
refX="0"
refY="0"
orient="auto">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path5306" />
</marker>
<marker
style="overflow:visible"
id="Arrow1Mend"
refX="0"
refY="0"
orient="auto">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path4688" />
</marker>
<marker
orient="auto"
refY="0"
refX="0"
id="marker5170"
style="overflow:visible">
<path
id="path5168"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
</marker>
<marker
orient="auto"
refY="0"
refX="0"
id="marker4963"
style="overflow:visible">
<path
id="path4961"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
transform="matrix(-0.8,0,0,-0.8,-10,0)" />
</marker>
<marker
style="overflow:visible"
id="marker6158-2"
refX="0"
refY="0"
orient="auto">
<path
transform="matrix(-0.4,0,0,-0.4,-4,0)"
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1"
d="M 0,0 5,-5 -12.5,0 5,5 Z"
id="path6156-2" />
</marker>
</defs>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-18.388332,-17.864582)"
id="layer1">
<g
id="g4666">
<rect
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4607"
width="17.197916"
height="6.614583"
x="18.520834"
y="20.510416" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="20.968229"
y="24.869841"
id="text4611"><tspan
id="tspan4609"
x="20.968229"
y="24.869841"
style="stroke-width:0.26458332px">Thread 1</tspan></text>
</g>
<g
id="g4661">
<rect
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4607-4"
width="17.197916"
height="6.6145835"
x="18.520834"
y="32.416668" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458349px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="20.979254"
y="36.776093"
id="text4611-8"><tspan
id="tspan4609-9"
x="20.979254"
y="36.776093"
style="stroke-width:0.26458332px">Thread 2</tspan></text>
</g>
<g
id="g4671">
<rect
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect4607-8"
width="17.197916"
height="6.6145835"
x="18.520832"
y="44.322918" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458349px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="20.951002"
y="48.682343"
id="text4611-89"><tspan
id="tspan4609-6"
x="20.951002"
y="48.682343"
style="stroke-width:0.26458332px">Thread 3</tspan></text>
</g>
<g
id="g5096">
<ellipse
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4644"
cx="67.775978"
cy="36.3787"
rx="10.583333"
ry="4.6302085" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:2.82222223px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="67.733261"
y="35.623535"
id="text4648"><tspan
id="tspan4646"
x="67.733261"
y="35.623535"
style="text-align:center;text-anchor:middle;stroke-width:0.26458332px">Tracy</tspan><tspan
x="67.733261"
y="39.151314"
style="text-align:center;text-anchor:middle;stroke-width:0.26458332px"
id="tspan4650">client</tspan></text>
</g>
<path
id="path4673"
d="m 37.041666,24.479166 19.84375,7.937502"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker5472)" />
<path
id="path4675"
d="m 37.041666,46.968751 19.84375,-6.614584"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker5482)" />
<path
id="path4677"
d="M 37.041667,36.385417 H 55.5625"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker5378)" />
<path
id="path5059"
d="M 84.666667,17.864582 V 54.90625"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:1.05833327, 2.11666654;stroke-dashoffset:0;stroke-opacity:1" />
<g
id="g5106">
<ellipse
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4644-1"
cx="101.98283"
cy="36.56768"
rx="10.583333"
ry="4.6302085" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:2.82222223px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="101.90772"
y="35.812515"
id="text4648-2"><tspan
id="tspan4646-5"
x="101.90772"
y="35.812515"
style="text-align:center;text-anchor:middle;stroke-width:0.26458332px">Tracy</tspan><tspan
x="101.90772"
y="39.340294"
style="text-align:center;text-anchor:middle;stroke-width:0.26458332px"
id="tspan4650-1">server</tspan></text>
</g>
<path
id="path5108"
d="M 79.375,37.708333 H 89.958333"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6660)" />
<path
id="path5110"
d="M 89.958333,35.0625 H 79.375"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker5308)" />
<g
transform="translate(-2.64619,-1.3704153)"
id="g6152">
<ellipse
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="path6114"
cx="128.98439"
cy="33.692333"
rx="4.6302085"
ry="1.2756696" />
<path
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
d="m 124.36251,41.677042 c -0.004,0.01582 -0.007,0.03168 -0.008,0.04754 5.3e-4,0.704384 2.07327,1.275328 4.62995,1.275373 2.55689,3.5e-5 4.62988,-0.570931 4.63048,-1.275373 -10e-4,-0.01585 -0.003,-0.03171 -0.006,-0.04754"
id="path6114-1" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 124.35417,33.739583 v 8.021022"
id="path6138" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 133.61458,33.739582 v 8.051744"
id="path6140" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="126.89217"
y="39.409225"
id="text6144"><tspan
id="tspan6142"
x="126.89217"
y="39.409225"
style="stroke-width:0.26458332px">DB</tspan></text>
</g>
<path
id="path6154"
d="m 113.77082,36.385418 h 6.61459"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6158)" />
<g
transform="translate(2.6458333,1.2715659e-6)"
id="g6241">
<rect
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
id="rect6232"
width="17.197916"
height="5.291667"
x="137.58333"
y="33.739582" />
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:2.82222223px;line-height:6.61458302px;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="140.8851"
y="37.164005"
id="text6236"><tspan
id="tspan6234"
x="140.8851"
y="37.164005"
style="stroke-width:0.26458332px">Display</tspan></text>
</g>
<path
id="path6154-3"
d="m 132.29166,36.385417 h 6.61459"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#marker6158-2)" />
</g>
</svg>

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 KiB

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 250 KiB

BIN
doc/profiler3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

706
dtl/Diff.hpp Normal file
View File

@ -0,0 +1,706 @@
/**
dtl -- Diff Template Library
In short, Diff Template Library is distributed under so called "BSD license",
Copyright (c) 2015 Tatsuhiko Kubo <cubicdaiya@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* If you use this library, you must include dtl.hpp only. */
#ifndef DTL_DIFF_H
#define DTL_DIFF_H
namespace dtl {
/**
* diff class template
* sequence must support random_access_iterator.
*/
template <typename elem, typename sequence = vector< elem >, typename comparator = Compare< elem > >
class Diff
{
private :
dtl_typedefs(elem, sequence)
sequence A;
sequence B;
size_t M;
size_t N;
size_t delta;
size_t offset;
long long *fp;
long long editDistance;
Lcs< elem > lcs;
Ses< elem > ses;
editPath path;
editPathCordinates pathCordinates;
bool swapped;
bool huge;
bool trivial;
bool editDistanceOnly;
uniHunkVec uniHunks;
comparator cmp;
long long ox;
long long oy;
public :
Diff () {}
Diff (const sequence& a,
const sequence& b) : A(a), B(b), ses(false) {
init();
}
Diff (const sequence& a,
const sequence& b,
bool deletesFirst) : A(a), B(b), ses(deletesFirst) {
init();
}
Diff (const sequence& a,
const sequence& b,
const comparator& comp) : A(a), B(b), ses(false), cmp(comp) {
init();
}
Diff (const sequence& a,
const sequence& b,
bool deleteFirst,
const comparator& comp) : A(a), B(b), ses(deleteFirst), cmp(comp) {
init();
}
~Diff() {}
long long getEditDistance () const {
return editDistance;
}
Lcs< elem > getLcs () const {
return lcs;
}
elemVec getLcsVec () const {
return lcs.getSequence();
}
Ses< elem > getSes () const {
return ses;
}
uniHunkVec getUniHunks () const {
return uniHunks;
}
/* These should be deprecated */
bool isHuge () const {
return huge;
}
void onHuge () {
this->huge = true;
}
void offHuge () {
this->huge = false;
}
bool isUnserious () const {
return trivial;
}
void onUnserious () {
this->trivial = true;
}
void offUnserious () {
this->trivial = false;
}
void onOnlyEditDistance () {
this->editDistanceOnly = true;
}
/* These are the replacements for the above */
bool hugeEnabled () const {
return huge;
}
void enableHuge () {
this->huge = true;
}
void disableHuge () {
this->huge = false;
}
bool trivialEnabled () const {
return trivial;
}
void enableTrivial () {
this->trivial = true;
}
void disableTrivial () {
this->trivial = false;
}
void editDistanceOnlyEnabled () {
this->editDistanceOnly = true;
}
/**
* patching with Unified Format Hunks
*/
sequence uniPatch (const sequence& seq) {
elemList seqLst(seq.begin(), seq.end());
sesElemVec shunk;
sesElemVec_iter vsesIt;
elemList_iter lstIt = seqLst.begin();
long long inc_dec_total = 0;
long long gap = 1;
for (uniHunkVec_iter it=uniHunks.begin();it!=uniHunks.end();++it) {
joinSesVec(shunk, it->common[0]);
joinSesVec(shunk, it->change);
joinSesVec(shunk, it->common[1]);
it->a += inc_dec_total;
inc_dec_total += it->inc_dec_count;
for (long long i=0;i<it->a - gap;++i) {
++lstIt;
}
gap = it->a + it->b + it->inc_dec_count;
vsesIt = shunk.begin();
while (vsesIt!=shunk.end()) {
switch (vsesIt->second.type) {
case SES_ADD :
seqLst.insert(lstIt, vsesIt->first);
break;
case SES_DELETE :
if (lstIt != seqLst.end()) {
lstIt = seqLst.erase(lstIt);
}
break;
case SES_COMMON :
if (lstIt != seqLst.end()) {
++lstIt;
}
break;
default :
// no fall-through
break;
}
++vsesIt;
}
shunk.clear();
}
sequence patchedSeq(seqLst.begin(), seqLst.end());
return patchedSeq;
}
/**
* patching with Shortest Edit Script (SES)
*/
sequence patch (const sequence& seq) const {
sesElemVec sesSeq = ses.getSequence();
elemList seqLst(seq.begin(), seq.end());
elemList_iter lstIt = seqLst.begin();
for (sesElemVec_iter sesIt=sesSeq.begin();sesIt!=sesSeq.end();++sesIt) {
switch (sesIt->second.type) {
case SES_ADD :
seqLst.insert(lstIt, sesIt->first);
break;
case SES_DELETE :
lstIt = seqLst.erase(lstIt);
break;
case SES_COMMON :
++lstIt;
break;
default :
// no through
break;
}
}
sequence patchedSeq(seqLst.begin(), seqLst.end());
return patchedSeq;
}
/**
* compose Longest Common Subsequence and Shortest Edit Script.
* The algorithm implemented here is based on "An O(NP) Sequence Comparison Algorithm"
* described by Sun Wu, Udi Manber and Gene Myers
*/
void compose() {
if (isHuge()) {
pathCordinates.reserve(MAX_CORDINATES_SIZE);
}
ox = 0;
oy = 0;
long long p = -1;
fp = new long long[M + N + 3];
fill(&fp[0], &fp[M + N + 3], -1);
path = editPath(M + N + 3);
fill(path.begin(), path.end(), -1);
ONP:
do {
++p;
for (long long k=-p;k<=static_cast<long long>(delta)-1;++k) {
fp[k+offset] = snake(k, fp[k-1+offset]+1, fp[k+1+offset]);
}
for (long long k=static_cast<long long>(delta)+p;k>=static_cast<long long>(delta)+1;--k) {
fp[k+offset] = snake(k, fp[k-1+offset]+1, fp[k+1+offset]);
}
fp[delta+offset] = snake(static_cast<long long>(delta), fp[delta-1+offset]+1, fp[delta+1+offset]);
} while (fp[delta+offset] != static_cast<long long>(N) && pathCordinates.size() < MAX_CORDINATES_SIZE);
editDistance += static_cast<long long>(delta) + 2 * p;
long long r = path[delta+offset];
P cordinate;
editPathCordinates epc(0);
// recording edit distance only
if (editDistanceOnly) {
delete[] this->fp;
return;
}
while(r != -1) {
cordinate.x = pathCordinates[(size_t)r].x;
cordinate.y = pathCordinates[(size_t)r].y;
epc.push_back(cordinate);
r = pathCordinates[(size_t)r].k;
}
// record Longest Common Subsequence & Shortest Edit Script
if (!recordSequence(epc)) {
pathCordinates.resize(0);
epc.resize(0);
p = -1;
goto ONP;
}
delete[] this->fp;
}
/**
* print difference between A and B as an SES
*/
template < typename stream >
void printSES (stream& out) const {
sesElemVec ses_v = ses.getSequence();
for_each(ses_v.begin(), ses_v.end(), ChangePrinter< sesElem, stream >(out));
}
void printSES (ostream& out = cout) const {
printSES< ostream >(out);
}
/**
* print differences given an SES
*/
template < typename stream >
static void printSES (const Ses< elem >& s, stream& out) {
sesElemVec ses_v = s.getSequence();
for_each(ses_v.begin(), ses_v.end(), ChangePrinter< sesElem, stream >(out));
}
static void printSES (const Ses< elem >& s, ostream& out = cout) {
printSES< ostream >(s, out);
}
/**
* print difference between A and B as an SES with custom printer
*/
template < typename stream, template < typename SEET, typename STRT > class PT >
void printSES (stream& out) const {
sesElemVec ses_v = ses.getSequence ();
for_each (ses_v.begin (), ses_v.end(), PT < sesElem, stream > (out));
}
/**
* store difference between A and B as an SES with custom storage
*/
template < typename storedData, template < typename SEET, typename STRT > class ST >
void storeSES(storedData& sd) const {
sesElemVec ses_v = ses.getSequence();
for_each(ses_v.begin(), ses_v.end(), ST < sesElem, storedData >(sd));
}
/**
* print difference between A and B in the Unified Format
*/
template < typename stream >
void printUnifiedFormat (stream& out) const {
for_each(uniHunks.begin(), uniHunks.end(), UniHunkPrinter< sesElem, stream >(out));
}
void printUnifiedFormat (ostream& out = cout) const {
printUnifiedFormat< ostream >(out);
}
/**
* print unified format difference with given unified format hunks
*/
template < typename stream >
static void printUnifiedFormat (const uniHunkVec& hunks, stream& out) {
for_each(hunks.begin(), hunks.end(), UniHunkPrinter< sesElem >(out));
}
static void printUnifiedFormat (const uniHunkVec& hunks, ostream& out = cout) {
printUnifiedFormat< ostream >(hunks, out);
}
/**
* compose Unified Format Hunks from Shortest Edit Script
*/
void composeUnifiedHunks () {
sesElemVec common[2];
sesElemVec change;
sesElemVec ses_v = ses.getSequence();
long long l_cnt = 1;
long long length = distance(ses_v.begin(), ses_v.end());
long long middle = 0;
bool isMiddle, isAfter;
elemInfo einfo;
long long a, b, c, d; // @@ -a,b +c,d @@
long long inc_dec_count = 0;
uniHunk< sesElem > hunk;
sesElemVec adds;
sesElemVec deletes;
isMiddle = isAfter = false;
a = b = c = d = 0;
for (sesElemVec_iter it=ses_v.begin();it!=ses_v.end();++it, ++l_cnt) {
einfo = it->second;
switch (einfo.type) {
case SES_ADD :
middle = 0;
++inc_dec_count;
adds.push_back(*it);
if (!isMiddle) isMiddle = true;
if (isMiddle) ++d;
if (l_cnt >= length) {
joinSesVec(change, deletes);
joinSesVec(change, adds);
isAfter = true;
}
break;
case SES_DELETE :
middle = 0;
--inc_dec_count;
deletes.push_back(*it);
if (!isMiddle) isMiddle = true;
if (isMiddle) ++b;
if (l_cnt >= length) {
joinSesVec(change, deletes);
joinSesVec(change, adds);
isAfter = true;
}
break;
case SES_COMMON :
++b;++d;
if (common[1].empty() && adds.empty() && deletes.empty() && change.empty()) {
if (static_cast<long long>(common[0].size()) < DTL_CONTEXT_SIZE) {
if (a == 0 && c == 0) {
if (!wasSwapped()) {
a = einfo.beforeIdx;
c = einfo.afterIdx;
} else {
a = einfo.afterIdx;
c = einfo.beforeIdx;
}
}
common[0].push_back(*it);
} else {
rotate(common[0].begin(), common[0].begin() + 1, common[0].end());
common[0].pop_back();
common[0].push_back(*it);
++a;++c;
--b;--d;
}
}
if (isMiddle && !isAfter) {
++middle;
joinSesVec(change, deletes);
joinSesVec(change, adds);
change.push_back(*it);
if (middle >= DTL_SEPARATE_SIZE || l_cnt >= length) {
isAfter = true;
}
adds.clear();
deletes.clear();
}
break;
default :
// no through
break;
}
// compose unified format hunk
if (isAfter && !change.empty()) {
sesElemVec_iter cit = it;
long long cnt = 0;
for (long long i=0;i<DTL_SEPARATE_SIZE && (cit != ses_v.end());++i, ++cit) {
if (cit->second.type == SES_COMMON) {
++cnt;
}
}
if (cnt < DTL_SEPARATE_SIZE && l_cnt < length) {
middle = 0;
isAfter = false;
continue;
}
if (static_cast<long long>(common[0].size()) >= DTL_SEPARATE_SIZE) {
long long c0size = static_cast<long long>(common[0].size());
rotate(common[0].begin(),
common[0].begin() + (size_t)c0size - DTL_SEPARATE_SIZE,
common[0].end());
for (long long i=0;i<c0size - DTL_SEPARATE_SIZE;++i) {
common[0].pop_back();
}
a += c0size - DTL_SEPARATE_SIZE;
c += c0size - DTL_SEPARATE_SIZE;
}
if (a == 0) ++a;
if (c == 0) ++c;
if (wasSwapped()) swap(a, c);
hunk.a = a;
hunk.b = b;
hunk.c = c;
hunk.d = d;
hunk.common[0] = common[0];
hunk.change = change;
hunk.common[1] = common[1];
hunk.inc_dec_count = inc_dec_count;
uniHunks.push_back(hunk);
isMiddle = false;
isAfter = false;
common[0].clear();
common[1].clear();
adds.clear();
deletes.clear();
change.clear();
a = b = c = d = middle = inc_dec_count = 0;
}
}
}
/**
* compose ses from stream
*/
template <typename stream>
static Ses< elem > composeSesFromStream (stream& st)
{
elem line;
Ses< elem > ret;
long long x_idx, y_idx;
x_idx = y_idx = 1;
while (getline(st, line)) {
elem mark(line.begin(), line.begin() + 1);
elem e(line.begin() + 1, line.end());
if (mark == SES_MARK_DELETE) {
ret.addSequence(e, x_idx, 0, SES_DELETE);
++x_idx;
} else if (mark == SES_MARK_ADD) {
ret.addSequence(e, y_idx, 0, SES_ADD);
++y_idx;
} else if (mark == SES_MARK_COMMON) {
ret.addSequence(e, x_idx, y_idx, SES_COMMON);
++x_idx;
++y_idx;
}
}
return ret;
}
private :
/**
* initialize
*/
void init () {
M = distance(A.begin(), A.end());
N = distance(B.begin(), B.end());
if (M < N) {
swapped = false;
} else {
swap(A, B);
swap(M, N);
swapped = true;
}
editDistance = 0;
delta = N - M;
offset = M + 1;
huge = false;
trivial = false;
editDistanceOnly = false;
fp = NULL;
}
/**
* search shortest path and record the path
*/
long long snake(const long long& k, const long long& above, const long long& below) {
long long r = above > below ? path[(size_t)k-1+offset] : path[(size_t)k+1+offset];
long long y = max(above, below);
long long x = y - k;
while ((size_t)x < M && (size_t)y < N && (swapped ? cmp.impl(B[(size_t)y], A[(size_t)x]) : cmp.impl(A[(size_t)x], B[(size_t)y]))) {
++x;++y;
}
path[(size_t)k+offset] = static_cast<long long>(pathCordinates.size());
if (!editDistanceOnly) {
P p;
p.x = x;p.y = y;p.k = r;
pathCordinates.push_back(p);
}
return y;
}
/**
* record SES and LCS
*/
bool recordSequence (const editPathCordinates& v) {
sequence_const_iter x(A.begin());
sequence_const_iter y(B.begin());
long long x_idx, y_idx; // line number for Unified Format
long long px_idx, py_idx; // cordinates
bool complete = false;
x_idx = y_idx = 1;
px_idx = py_idx = 0;
for (size_t i=v.size()-1;!complete;--i) {
while(px_idx < v[i].x || py_idx < v[i].y) {
if (v[i].y - v[i].x > py_idx - px_idx) {
if (!wasSwapped()) {
ses.addSequence(*y, 0, y_idx + oy, SES_ADD);
} else {
ses.addSequence(*y, y_idx + oy, 0, SES_DELETE);
}
++y;
++y_idx;
++py_idx;
} else if (v[i].y - v[i].x < py_idx - px_idx) {
if (!wasSwapped()) {
ses.addSequence(*x, x_idx + ox, 0, SES_DELETE);
} else {
ses.addSequence(*x, 0, x_idx + ox, SES_ADD);
}
++x;
++x_idx;
++px_idx;
} else {
if (!wasSwapped()) {
lcs.addSequence(*x);
ses.addSequence(*x, x_idx + ox, y_idx + oy, SES_COMMON);
} else {
lcs.addSequence(*y);
ses.addSequence(*y, y_idx + oy, x_idx + ox, SES_COMMON);
}
++x;
++y;
++x_idx;
++y_idx;
++px_idx;
++py_idx;
}
}
if (i == 0) complete = true;
}
if (x_idx > static_cast<long long>(M) && y_idx > static_cast<long long>(N)) {
// all recording succeeded
} else {
// trivial difference
if (trivialEnabled()) {
if (!wasSwapped()) {
recordOddSequence(x_idx, M, x, SES_DELETE);
recordOddSequence(y_idx, N, y, SES_ADD);
} else {
recordOddSequence(x_idx, M, x, SES_ADD);
recordOddSequence(y_idx, N, y, SES_DELETE);
}
return true;
}
// nontrivial difference
sequence A_(A.begin() + (size_t)x_idx - 1, A.end());
sequence B_(B.begin() + (size_t)y_idx - 1, B.end());
A = A_;
B = B_;
M = distance(A.begin(), A.end());
N = distance(B.begin(), B.end());
delta = N - M;
offset = M + 1;
delete[] fp;
fp = new long long[M + N + 3];
fill(&fp[0], &fp[M + N + 3], -1);
fill(path.begin(), path.end(), -1);
ox = x_idx - 1;
oy = y_idx - 1;
return false;
}
return true;
}
/**
* record odd sequence in SES
*/
void inline recordOddSequence (long long idx, long long length, sequence_const_iter it, const edit_t et) {
while(idx < length){
ses.addSequence(*it, idx, 0, et);
++it;
++idx;
++editDistance;
}
ses.addSequence(*it, idx, 0, et);
++editDistance;
}
/**
* join SES vectors
*/
void inline joinSesVec (sesElemVec& s1, sesElemVec& s2) const {
if (!s2.empty()) {
for (sesElemVec_iter vit=s2.begin();vit!=s2.end();++vit) {
s1.push_back(*vit);
}
}
}
/**
* check if the sequences have been swapped
*/
bool inline wasSwapped () const {
return swapped;
}
};
}
#endif // DTL_DIFF_H

245
dtl/Diff3.hpp Normal file
View File

@ -0,0 +1,245 @@
/**
dtl -- Diff Template Library
In short, Diff Template Library is distributed under so called "BSD license",
Copyright (c) 2015 Tatsuhiko Kubo <cubicdaiya@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* If you use this library, you must include dtl.hpp only. */
#ifndef DTL_DIFF3_H
#define DTL_DIFF3_H
namespace dtl {
/**
* diff3 class template
* sequence must support random_access_iterator.
*/
template <typename elem, typename sequence = vector< elem >, typename comparator = Compare< elem > >
class Diff3
{
private:
dtl_typedefs(elem, sequence)
sequence A;
sequence B;
sequence C;
sequence S;
Diff< elem, sequence, comparator > diff_ba;
Diff< elem, sequence, comparator > diff_bc;
bool conflict;
elem csepabegin;
elem csepa;
elem csepaend;
public :
Diff3 () {}
Diff3 (const sequence& a,
const sequence& b,
const sequence& c) : A(a), B(b), C(c),
diff_ba(b, a), diff_bc(b, c),
conflict(false) {}
~Diff3 () {}
bool isConflict () const {
return conflict;
}
sequence getMergedSequence () const {
return S;
}
/**
* merge changes B and C into A
*/
bool merge () {
if (diff_ba.getEditDistance() == 0) { // A == B
if (diff_bc.getEditDistance() == 0) { // A == B == C
S = B;
return true;
}
S = C;
return true;
} else { // A != B
if (diff_bc.getEditDistance() == 0) { // A != B == C
S = A;
return true;
} else { // A != B != C
S = merge_();
if (isConflict()) { // conflict occured
return false;
}
}
}
return true;
}
/**
* compose differences
*/
void compose () {
diff_ba.compose();
diff_bc.compose();
}
private :
/**
* merge implementation
*/
sequence merge_ () {
elemVec seq;
Ses< elem > ses_ba = diff_ba.getSes();
Ses< elem > ses_bc = diff_bc.getSes();
sesElemVec ses_ba_v = ses_ba.getSequence();
sesElemVec ses_bc_v = ses_bc.getSequence();
sesElemVec_iter ba_it = ses_ba_v.begin();
sesElemVec_iter bc_it = ses_bc_v.begin();
sesElemVec_iter ba_end = ses_ba_v.end();
sesElemVec_iter bc_end = ses_bc_v.end();
while (!isEnd(ba_end, ba_it) || !isEnd(bc_end, bc_it)) {
while (true) {
if (!isEnd(ba_end, ba_it) &&
!isEnd(bc_end, bc_it) &&
ba_it->first == bc_it->first &&
ba_it->second.type == SES_COMMON &&
bc_it->second.type == SES_COMMON) {
// do nothing
} else {
break;
}
if (!isEnd(ba_end, ba_it)) seq.push_back(ba_it->first);
else if (!isEnd(bc_end, bc_it)) seq.push_back(bc_it->first);
forwardUntilEnd(ba_end, ba_it);
forwardUntilEnd(bc_end, bc_it);
}
if (isEnd(ba_end, ba_it) || isEnd(bc_end, bc_it)) break;
if ( ba_it->second.type == SES_COMMON
&& bc_it->second.type == SES_DELETE) {
forwardUntilEnd(ba_end, ba_it);
forwardUntilEnd(bc_end, bc_it);
} else if (ba_it->second.type == SES_COMMON &&
bc_it->second.type == SES_ADD) {
seq.push_back(bc_it->first);
forwardUntilEnd(bc_end, bc_it);
} else if (ba_it->second.type == SES_DELETE &&
bc_it->second.type == SES_COMMON) {
forwardUntilEnd(ba_end, ba_it);
forwardUntilEnd(bc_end, bc_it);
} else if (ba_it->second.type == SES_DELETE &&
bc_it->second.type == SES_DELETE) {
if (ba_it->first == bc_it->first) {
forwardUntilEnd(ba_end, ba_it);
forwardUntilEnd(bc_end, bc_it);
} else {
// conflict
conflict = true;
return B;
}
} else if (ba_it->second.type == SES_DELETE &&
bc_it->second.type == SES_ADD) {
// conflict
conflict = true;
return B;
} else if (ba_it->second.type == SES_ADD &&
bc_it->second.type == SES_COMMON) {
seq.push_back(ba_it->first);
forwardUntilEnd(ba_end, ba_it);
} else if (ba_it->second.type == SES_ADD &&
bc_it->second.type == SES_DELETE) {
// conflict
conflict = true;
return B;
} else if (ba_it->second.type == SES_ADD &&
bc_it->second.type == SES_ADD) {
if (ba_it->first == bc_it->first) {
seq.push_back(ba_it->first);
forwardUntilEnd(ba_end, ba_it);
forwardUntilEnd(bc_end, bc_it);
} else {
// conflict
conflict = true;
return B;
}
}
}
if (isEnd(ba_end, ba_it)) {
addDecentSequence(bc_end, bc_it, seq);
} else if (isEnd(bc_end, bc_it)) {
addDecentSequence(ba_end, ba_it, seq);
}
sequence mergedSeq(seq.begin(), seq.end());
return mergedSeq;
}
/**
* join elem vectors
*/
void inline joinElemVec (elemVec& s1, elemVec& s2) const {
if (!s2.empty()) {
for (elemVec_iter vit=s2.begin();vit!=s2.end();++vit) {
s1.push_back(*vit);
}
}
}
/**
* check if sequence is at end
*/
template <typename T_iter>
bool inline isEnd (const T_iter& end, const T_iter& it) const {
return it == end ? true : false;
}
/**
* increment iterator until iterator is at end
*/
template <typename T_iter>
void inline forwardUntilEnd (const T_iter& end, T_iter& it) const {
if (!isEnd(end, it)) ++it;
}
/**
* add elements whose SES's type is ADD
*/
void inline addDecentSequence (const sesElemVec_iter& end, sesElemVec_iter& it, elemVec& seq) const {
while (!isEnd(end, it)) {
if (it->second.type == SES_ADD) seq.push_back(it->first);
++it;
}
}
};
}
#endif // DTL_DIFF3_H

55
dtl/Lcs.hpp Normal file
View File

@ -0,0 +1,55 @@
/**
dtl -- Diff Template Library
In short, Diff Template Library is distributed under so called "BSD license",
Copyright (c) 2015 Tatsuhiko Kubo <cubicdaiya@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* If you use this library, you must include dtl.hpp only. */
#ifndef DTL_LCS_H
#define DTL_LCS_H
namespace dtl {
/**
* Longest Common Subsequence template class
*/
template <typename elem>
class Lcs : public Sequence< elem >
{
public :
Lcs () {}
~Lcs () {}
};
}
#endif // DTL_LCS_H

65
dtl/Sequence.hpp Normal file
View File

@ -0,0 +1,65 @@
/**
dtl -- Diff Template Library
In short, Diff Template Library is distributed under so called "BSD license",
Copyright (c) 2015 Tatsuhiko Kubo <cubicdaiya@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* If you use this library, you must include dtl.hpp only. */
#ifndef DTL_SEQUENCE_H
#define DTL_SEQUENCE_H
namespace dtl {
/**
* sequence class template
*/
template <typename elem>
class Sequence
{
public :
typedef vector< elem > elemVec;
Sequence () {}
virtual ~Sequence () {}
elemVec getSequence () const {
return sequence;
}
void addSequence (elem e) {
sequence.push_back(e);
}
protected :
elemVec sequence;
};
}
#endif // DTL_SEQUENCE_H

132
dtl/Ses.hpp Normal file
View File

@ -0,0 +1,132 @@
/**
dtl -- Diff Template Library
In short, Diff Template Library is distributed under so called "BSD license",
Copyright (c) 2015 Tatsuhiko Kubo <cubicdaiya@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* If you use this library, you must include dtl.hpp only. */
#ifndef DTL_SES_H
#define DTL_SES_H
namespace dtl {
/**
* Shortest Edit Script template class
*/
template <typename elem>
class Ses : public Sequence< elem >
{
private :
typedef pair< elem, elemInfo > sesElem;
typedef vector< sesElem > sesElemVec;
public :
Ses () : onlyAdd(true), onlyDelete(true), onlyCopy(true), deletesFirst(false) {
nextDeleteIdx = 0;
}
Ses (bool moveDel) : onlyAdd(true), onlyDelete(true), onlyCopy(true), deletesFirst(moveDel) {
nextDeleteIdx = 0;
}
~Ses () {}
bool isOnlyAdd () const {
return onlyAdd;
}
bool isOnlyDelete () const {
return onlyDelete;
}
bool isOnlyCopy () const {
return onlyCopy;
}
bool isOnlyOneOperation () const {
return isOnlyAdd() || isOnlyDelete() || isOnlyCopy();
}
bool isChange () const {
return !onlyCopy;
}
using Sequence< elem >::addSequence;
void addSequence (elem e, long long beforeIdx, long long afterIdx, const edit_t type) {
elemInfo info;
info.beforeIdx = beforeIdx;
info.afterIdx = afterIdx;
info.type = type;
sesElem pe(e, info);
if (!deletesFirst) {
sequence.push_back(pe);
}
switch (type) {
case SES_DELETE:
onlyCopy = false;
onlyAdd = false;
if (deletesFirst) {
sequence.insert(sequence.begin() + nextDeleteIdx, pe);
nextDeleteIdx++;
}
break;
case SES_COMMON:
onlyAdd = false;
onlyDelete = false;
if (deletesFirst) {
sequence.push_back(pe);
nextDeleteIdx = sequence.size();
}
break;
case SES_ADD:
onlyDelete = false;
onlyCopy = false;
if (deletesFirst) {
sequence.push_back(pe);
}
break;
}
}
sesElemVec getSequence () const {
return sequence;
}
private :
sesElemVec sequence;
bool onlyAdd;
bool onlyDelete;
bool onlyCopy;
bool deletesFirst;
size_t nextDeleteIdx;
};
}
#endif // DTL_SES_H

47
dtl/dtl.hpp Normal file
View File

@ -0,0 +1,47 @@
/**
dtl -- Diff Template Library
In short, Diff Template Library is distributed under so called "BSD license",
Copyright (c) 2015 Tatsuhiko Kubo <cubicdaiya@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef DTL_H
#define DTL_H
#include "variables.hpp"
#include "functors.hpp"
#include "Sequence.hpp"
#include "Lcs.hpp"
#include "Ses.hpp"
#include "Diff.hpp"
#include "Diff3.hpp"
#endif // DTL_H

151
dtl/functors.hpp Normal file
View File

@ -0,0 +1,151 @@
/**
dtl -- Diff Template Library
In short, Diff Template Library is distributed under so called "BSD license",
Copyright (c) 2015 Tatsuhiko Kubo <cubicdaiya@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* If you use this library, you must include dtl.hpp only. */
#ifndef DTL_FUNCTORS_H
#define DTL_FUNCTORS_H
namespace dtl {
/**
* printer class template
*/
template <typename sesElem, typename stream = ostream >
class Printer
{
public :
Printer () : out_(cout) {}
Printer (stream& out) : out_(out) {}
virtual ~Printer () {}
virtual void operator() (const sesElem& se) const = 0;
protected :
stream& out_;
};
/**
* common element printer class template
*/
template <typename sesElem, typename stream = ostream >
class CommonPrinter : public Printer < sesElem, stream >
{
public :
CommonPrinter () : Printer < sesElem, stream > () {}
CommonPrinter (stream& out) : Printer < sesElem, stream > (out) {}
~CommonPrinter () {}
void operator() (const sesElem& se) const {
this->out_ << SES_MARK_COMMON << se.first << endl;
}
};
/**
* ses element printer class template
*/
template <typename sesElem, typename stream = ostream >
class ChangePrinter : public Printer < sesElem, stream >
{
public :
ChangePrinter () : Printer < sesElem, stream > () {}
ChangePrinter (stream& out) : Printer < sesElem, stream > (out) {}
~ChangePrinter () {}
void operator() (const sesElem& se) const {
switch (se.second.type) {
case SES_ADD:
this->out_ << SES_MARK_ADD << se.first << endl;
break;
case SES_DELETE:
this->out_ << SES_MARK_DELETE << se.first << endl;
break;
case SES_COMMON:
this->out_ << SES_MARK_COMMON << se.first << endl;
break;
}
}
};
/**
* unified format element printer class template
*/
template <typename sesElem, typename stream = ostream >
class UniHunkPrinter
{
public :
UniHunkPrinter () : out_(cout) {}
UniHunkPrinter (stream& out) : out_(out) {}
~UniHunkPrinter () {}
void operator() (const uniHunk< sesElem >& hunk) const {
out_ << "@@"
<< " -" << hunk.a << "," << hunk.b
<< " +" << hunk.c << "," << hunk.d
<< " @@" << endl;
for_each(hunk.common[0].begin(), hunk.common[0].end(), CommonPrinter< sesElem, stream >(out_));
for_each(hunk.change.begin(), hunk.change.end(), ChangePrinter< sesElem, stream >(out_));
for_each(hunk.common[1].begin(), hunk.common[1].end(), CommonPrinter< sesElem, stream >(out_));
}
private :
stream& out_;
};
/**
* storage class template
*/
template <typename sesElem, typename storedData >
class Storage
{
public:
Storage(storedData& sd) : storedData_(sd) {}
virtual ~Storage() {}
virtual void operator() (const sesElem& se) const = 0;
protected:
storedData& storedData_;
};
/**
* compare class template
*/
template <typename elem>
class Compare
{
public :
Compare () {}
virtual ~Compare () {}
virtual inline bool impl (const elem& e1, const elem& e2) const {
return e1 == e2;
}
};
}
#endif // DTL_FUNCTORS_H

142
dtl/variables.hpp Normal file
View File

@ -0,0 +1,142 @@
/**
dtl -- Diff Template Library
In short, Diff Template Library is distributed under so called "BSD license",
Copyright (c) 2015 Tatsuhiko Kubo <cubicdaiya@gmail.com>
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the authors nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* If you use this library, you must include dtl.hpp only. */
#ifndef DTL_VARIABLES_H
#define DTL_VARIABLES_H
#include <vector>
#include <list>
#include <string>
#include <algorithm>
#include <iostream>
namespace dtl {
using std::vector;
using std::string;
using std::pair;
using std::ostream;
using std::list;
using std::for_each;
using std::distance;
using std::fill;
using std::cout;
using std::endl;
using std::rotate;
using std::swap;
using std::max;
/**
* version string
*/
const string version = "1.20";
/**
* type of edit for SES
*/
typedef int edit_t;
const edit_t SES_DELETE = -1;
const edit_t SES_COMMON = 0;
const edit_t SES_ADD = 1;
/**
* mark of SES
*/
#define SES_MARK_DELETE "-"
#define SES_MARK_COMMON " "
#define SES_MARK_ADD "+"
/**
* info for Unified Format
*/
typedef struct eleminfo {
long long beforeIdx; // index of prev sequence
long long afterIdx; // index of after sequence
edit_t type; // type of edit(Add, Delete, Common)
bool operator==(const eleminfo& other) const{
return (this->beforeIdx == other.beforeIdx && this->afterIdx == other.afterIdx && this->type == other.type);
}
} elemInfo;
const long long DTL_SEPARATE_SIZE = 3;
const long long DTL_CONTEXT_SIZE = 3;
/**
* cordinate for registering route
*/
typedef struct Point {
long long x; // x cordinate
long long y; // y cordinate
long long k; // vertex
} P;
/**
* limit of cordinate size
*/
const unsigned long long MAX_CORDINATES_SIZE = 2000000;
typedef vector< long long > editPath;
typedef vector< P > editPathCordinates;
/**
* Structure of Unified Format Hunk
*/
template <typename sesElem>
struct uniHunk {
long long a, b, c, d; // @@ -a,b +c,d @@
vector< sesElem > common[2]; // anteroposterior commons on changes
vector< sesElem > change; // changes
long long inc_dec_count; // count of increace and decrease
};
#define dtl_typedefs(elem, sequence) \
typedef pair< elem, elemInfo > sesElem; \
typedef vector< sesElem > sesElemVec; \
typedef vector< uniHunk< sesElem > > uniHunkVec; \
typedef list< elem > elemList; \
typedef vector< elem > elemVec; \
typedef typename uniHunkVec::iterator uniHunkVec_iter; \
typedef typename sesElemVec::iterator sesElemVec_iter; \
typedef typename elemList::iterator elemList_iter; \
typedef typename sequence::iterator sequence_iter; \
typedef typename sequence::const_iterator sequence_const_iter; \
typedef typename elemVec::iterator elemVec_iter;
}
#endif // DTL_VARIABLES_H

View File

@ -1,14 +1,17 @@
cmake_minimum_required(VERSION 3.0) cmake_minimum_required(VERSION 3.10)
project(OpenCLVectorAdd) project(OpenCLVectorAdd)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(OpenCL REQUIRED) find_package(OpenCL REQUIRED)
add_executable(OpenCLVectorAdd OpenCLVectorAdd.cpp) add_executable(OpenCLVectorAdd OpenCLVectorAdd.cpp)
add_library(TracyClient STATIC ../../TracyClient.cpp add_library(TracyClient STATIC ../../public/TracyClient.cpp
../../TracyOpenCL.hpp) ../../public/tracy/TracyOpenCL.hpp)
target_include_directories(TracyClient PUBLIC ../../) target_include_directories(TracyClient PUBLIC ../../public/tracy)
target_compile_definitions(TracyClient PUBLIC TRACY_ENABLE=1) target_compile_definitions(TracyClient PUBLIC TRACY_ENABLE=1)
target_link_libraries(OpenCLVectorAdd PUBLIC OpenCL::OpenCL TracyClient) target_link_libraries(OpenCLVectorAdd PUBLIC OpenCL::OpenCL TracyClient ${CMAKE_DL_LIBS} Threads::Threads)

View File

@ -3,6 +3,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <numeric> #include <numeric>
#include <math.h>
#include <CL/cl.h> #include <CL/cl.h>
@ -104,8 +105,8 @@ int main()
hostB.resize(N); hostB.resize(N);
hostC.resize(N); hostC.resize(N);
std::iota(std::begin(hostA), std::end(hostA), 0); std::iota(std::begin(hostA), std::end(hostA), 0.0f);
std::iota(std::begin(hostB), std::end(hostB), 0); std::iota(std::begin(hostB), std::end(hostB), 0.0f);
} }
{ {
@ -123,7 +124,7 @@ int main()
ZoneScopedN("Write Buffer A"); ZoneScopedN("Write Buffer A");
TracyCLZoneS(tracyCLCtx, "Write BufferA", 5); TracyCLZoneS(tracyCLCtx, "Write BufferA", 5);
CL_ASSERT(clEnqueueWriteBuffer(commandQueue, bufferA, CL_TRUE, 0, N * sizeof(float), hostA.data(), 0, nullptr, &writeBufferAEvent)); CL_ASSERT(clEnqueueWriteBuffer(commandQueue, bufferA, CL_FALSE, 0, N * sizeof(float), hostA.data(), 0, nullptr, &writeBufferAEvent));
TracyCLZoneSetEvent(writeBufferAEvent); TracyCLZoneSetEvent(writeBufferAEvent);
} }
@ -131,33 +132,44 @@ int main()
ZoneScopedN("Write Buffer B"); ZoneScopedN("Write Buffer B");
TracyCLZone(tracyCLCtx, "Write BufferB"); TracyCLZone(tracyCLCtx, "Write BufferB");
CL_ASSERT(clEnqueueWriteBuffer(commandQueue, bufferB, CL_TRUE, 0, N * sizeof(float), hostB.data(), 0, nullptr, &writeBufferBEvent)); CL_ASSERT(clEnqueueWriteBuffer(commandQueue, bufferB, CL_FALSE, 0, N * sizeof(float), hostB.data(), 0, nullptr, &writeBufferBEvent));
TracyCLZoneSetEvent(writeBufferBEvent); TracyCLZoneSetEvent(writeBufferBEvent);
} }
} }
for (int i = 0; i < 10; ++i) cl_int clN = static_cast<cl_int>(N);
const int numFrames = 10;
const int launchsPerFrame = 10;
constexpr int numLaunchs = numFrames * launchsPerFrame;
std::vector<cl_event> kernelLaunchEvts;
kernelLaunchEvts.reserve(numLaunchs);
for (int i = 0; i < numFrames; ++i)
{ {
ZoneScopedN("VectorAdd Kernel Launch"); FrameMark;
TracyCLZoneC(tracyCLCtx, "VectorAdd Kernel", tracy::Color::Blue4); for (int j = 0; j < launchsPerFrame; ++j) {
ZoneScopedN("VectorAdd Kernel Launch");
TracyCLZoneC(tracyCLCtx, "VectorAdd Kernel", tracy::Color::Blue4);
CL_ASSERT(clSetKernelArg(vectorAddKernel, 0, sizeof(cl_mem), &bufferC)); CL_ASSERT(clSetKernelArg(vectorAddKernel, 0, sizeof(cl_mem), &bufferC));
CL_ASSERT(clSetKernelArg(vectorAddKernel, 1, sizeof(cl_mem), &bufferA)); CL_ASSERT(clSetKernelArg(vectorAddKernel, 1, sizeof(cl_mem), &bufferA));
CL_ASSERT(clSetKernelArg(vectorAddKernel, 2, sizeof(cl_mem), &bufferB)); CL_ASSERT(clSetKernelArg(vectorAddKernel, 2, sizeof(cl_mem), &bufferB));
CL_ASSERT(clSetKernelArg(vectorAddKernel, 3, sizeof(int), &static_cast<int>(N))); CL_ASSERT(clSetKernelArg(vectorAddKernel, 3, sizeof(cl_int), &clN));
cl_event vectorAddKernelEvent; cl_event vectorAddKernelEvent;
CL_ASSERT(clEnqueueNDRangeKernel(commandQueue, vectorAddKernel, 1, nullptr, &N, nullptr, 0, nullptr, &vectorAddKernelEvent)); CL_ASSERT(clEnqueueNDRangeKernel(commandQueue, vectorAddKernel, 1, nullptr, &N, nullptr, 0, nullptr, &vectorAddKernelEvent));
TracyCLZoneSetEvent(vectorAddKernelEvent);
CL_ASSERT(clWaitForEvents(1, &vectorAddKernelEvent)); CL_ASSERT(clRetainEvent(vectorAddKernelEvent));
kernelLaunchEvts.push_back(vectorAddKernelEvent);
TracyCLZoneSetEvent(vectorAddKernelEvent); std::cout << "VectorAdd Kernel Enqueued" << std::endl;
}
cl_ulong kernelStartTime, kernelEndTime; {
CL_ASSERT(clGetEventProfilingInfo(vectorAddKernelEvent, CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &kernelStartTime, nullptr)); // Wait frame events to be finished
CL_ASSERT(clGetEventProfilingInfo(vectorAddKernelEvent, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &kernelEndTime, nullptr)); ZoneScopedN("clFinish");
std::cout << "VectorAdd Kernel Elapsed: " << ((kernelEndTime - kernelStartTime) / 1000) << " us" << std::endl; CL_ASSERT(clFinish(commandQueue));
}
// You should collect on each 'frame' ends, so that streaming can be achieved.
TracyCLCollect(tracyCLCtx);
} }
{ {
@ -170,7 +182,25 @@ int main()
} }
CL_ASSERT(clFinish(commandQueue)); CL_ASSERT(clFinish(commandQueue));
std::vector<float> durations(kernelLaunchEvts.size());
for (int i=0; i<kernelLaunchEvts.size(); i++) {
cl_event evt = kernelLaunchEvts[i];
cl_ulong start;
cl_ulong end;
CL_ASSERT(clGetEventProfilingInfo(evt, CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &start, nullptr));
CL_ASSERT(clGetEventProfilingInfo(evt, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &end, nullptr));
CL_ASSERT(clReleaseEvent(evt));
durations[i] = (end - start) * 0.001f;
std::cout << "VectorAdd Kernel " << i << " tooks " << static_cast<int>(durations[i]) << "us" << std::endl;
};
float avg = std::accumulate(durations.cbegin(), durations.cend(), 0.0f) / durations.size();
float stddev2 = std::accumulate(durations.cbegin(), durations.cend(), 0.0f, [avg](const float& acc, const float& v) {
auto d = v - avg;
return acc + d*d;
}) / (durations.size() - 1.0f);
std::cout << "VectorAdd runtime avg: " << avg << "us, std: " << sqrt(stddev2) << "us over " << numLaunchs << " runs." << std::endl;
// User should ensure all events are finished, in this case, collect after the clFinish will do the trick.
TracyCLCollect(tracyCLCtx); TracyCLCollect(tracyCLCtx);
{ {

View File

@ -8,7 +8,7 @@
#endif #endif
#include <atomic> #include <atomic>
#include "../../../Tracy.hpp" #include "../../../public/tracy/Tracy.hpp"
// 46 spheres (2 emissive) when enabled; 9 spheres (1 emissive) when disabled // 46 spheres (2 emissive) when enabled; 9 spheres (1 emissive) when disabled
#define DO_BIG_SCENE 1 #define DO_BIG_SCENE 1

View File

@ -1,7 +1,7 @@
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15 # Visual Studio Version 16
VisualStudioVersion = 15.0.27130.2036 VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpu", "TestCpu.vcxproj", "{4F84B756-87F5-4B92-827B-DA087DAE1900}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestCpu", "TestCpu.vcxproj", "{4F84B756-87F5-4B92-827B-DA087DAE1900}"
EndProject EndProject

View File

@ -29,26 +29,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
@ -91,6 +91,7 @@
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<CallingConvention>VectorCall</CallingConvention> <CallingConvention>VectorCall</CallingConvention>
<FloatingPointModel>Fast</FloatingPointModel> <FloatingPointModel>Fast</FloatingPointModel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
@ -107,6 +108,7 @@
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
<CallingConvention>VectorCall</CallingConvention> <CallingConvention>VectorCall</CallingConvention>
<FloatingPointModel>Fast</FloatingPointModel> <FloatingPointModel>Fast</FloatingPointModel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
@ -159,7 +161,7 @@
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\..\..\TracyClient.cpp" /> <ClCompile Include="..\..\..\public\TracyClient.cpp" />
<ClCompile Include="..\Source\enkiTS\TaskScheduler.cpp" /> <ClCompile Include="..\Source\enkiTS\TaskScheduler.cpp" />
<ClCompile Include="..\Source\enkiTS\TaskScheduler_c.cpp" /> <ClCompile Include="..\Source\enkiTS\TaskScheduler_c.cpp" />
<ClCompile Include="..\Source\Maths.cpp" /> <ClCompile Include="..\Source\Maths.cpp" />

View File

@ -14,7 +14,7 @@
<ClCompile Include="..\Source\Maths.cpp"> <ClCompile Include="..\Source\Maths.cpp">
<Filter>Source</Filter> <Filter>Source</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\..\TracyClient.cpp" /> <ClCompile Include="..\..\..\public\TracyClient.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Filter Include="Source"> <Filter Include="Source">

View File

@ -15,7 +15,8 @@
#include "CompiledVertexShader.h" #include "CompiledVertexShader.h"
#include "CompiledPixelShader.h" #include "CompiledPixelShader.h"
#include "../../../Tracy.hpp" #include "../../../public/tracy/Tracy.hpp"
#include "../../../public/tracy/TracyD3D11.hpp"
static HINSTANCE g_HInstance; static HINSTANCE g_HInstance;
static HWND g_Wnd; static HWND g_Wnd;
@ -44,6 +45,7 @@ static ID3D11UnorderedAccessView *g_BackbufferUAV, *g_BackbufferUAV2;
static ID3D11SamplerState* g_SamplerLinear; static ID3D11SamplerState* g_SamplerLinear;
static ID3D11RasterizerState* g_RasterState; static ID3D11RasterizerState* g_RasterState;
static int g_BackbufferIndex; static int g_BackbufferIndex;
static tracy::D3D11Ctx *g_tracyCtx;
#if DO_COMPUTE_GPU #if DO_COMPUTE_GPU
@ -215,6 +217,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE, _In_ LPWSTR,
else else
{ {
RenderFrame(); RenderFrame();
TracyD3D11Collect(g_tracyCtx);
if( --framesLeft == 0 ) break; if( --framesLeft == 0 ) break;
} }
} }
@ -271,6 +274,7 @@ static int s_FrameCount = 0;
static void RenderFrame() static void RenderFrame()
{ {
ZoneScoped; ZoneScoped;
TracyD3D11Zone(g_tracyCtx, "RenderFrame");
LARGE_INTEGER time1; LARGE_INTEGER time1;
@ -541,6 +545,10 @@ static HRESULT InitD3DDevice()
vp.TopLeftY = 0; vp.TopLeftY = 0;
g_D3D11Ctx->RSSetViewports(1, &vp); g_D3D11Ctx->RSSetViewports(1, &vp);
g_tracyCtx = TracyD3D11Context(g_D3D11Device, g_D3D11Ctx);
const char* tracyD3D11CtxName = "D3D11";
TracyD3D11ContextName(g_tracyCtx, tracyD3D11CtxName, (uint16_t)strlen(tracyD3D11CtxName));
return S_OK; return S_OK;
} }
@ -548,6 +556,8 @@ static void ShutdownD3DDevice()
{ {
ZoneScoped; ZoneScoped;
if (g_tracyCtx) TracyD3D11Destroy(g_tracyCtx);
if (g_D3D11Ctx) g_D3D11Ctx->ClearState(); if (g_D3D11Ctx) g_D3D11Ctx->ClearState();
if (g_D3D11RenderTarget) g_D3D11RenderTarget->Release(); if (g_D3D11RenderTarget) g_D3D11RenderTarget->Release();

30
examples/fibers.cpp Normal file
View File

@ -0,0 +1,30 @@
// g++ fibers.cpp ../public/TracyClient.cpp -I../public/tracy -DTRACY_ENABLE -DTRACY_FIBERS -lpthread -ldl
#include <thread>
#include <unistd.h>
#include "Tracy.hpp"
#include "TracyC.h"
const char* fiber = "job1";
TracyCZoneCtx zone;
int main()
{
std::thread t1( [] {
TracyFiberEnter( fiber );
TracyCZone( ctx, 1 );
zone = ctx;
sleep( 1 );
TracyFiberLeave;
});
t1.join();
std::thread t2( [] {
TracyFiberEnter( fiber );
sleep( 1 );
TracyCZoneEnd( zone );
TracyFiberLeave;
});
t2.join();
}

64
extra/color-hot.cpp Normal file
View File

@ -0,0 +1,64 @@
#include <algorithm>
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <math.h>
inline float linear2sRGB( float v )
{
float s1 = sqrt( v );
float s2 = sqrt( s1 );
float s3 = sqrt( s2 );
return 0.585122381f * s1 + 0.783140355f * s2 - 0.368262736f * s3;
}
float lerp( float v0, float v1, float t )
{
return ( 1-t ) * v0 + t * v1;
}
inline float sRGB2linear( float v )
{
return v * ( v * ( v * 0.305306011f + 0.682171111f ) + 0.012522878f );
}
int main()
{
int c0 = 0x3333FF;
int c1 = 0x33FF33;
uint32_t t[256] = {};
float r0 = ( c0 & 0xFF ) / 255.f;
float r1 = ( c1 & 0xFF ) / 255.f;
float g0 = ( ( c0 >> 8 ) & 0xFF ) / 255.f;
float g1 = ( ( c1 >> 8 ) & 0xFF ) / 255.f;
float b0 = ( ( c0 >> 16 ) & 0xFF ) / 255.f;
float b1 = ( ( c1 >> 16 ) & 0xFF ) / 255.f;
for( int i=0; i<256; i++ )
{
float m = i / 255.f;
float rf = linear2sRGB( lerp( sRGB2linear( r0 ), sRGB2linear( r1 ), m ) );
float gf = linear2sRGB( lerp( sRGB2linear( g0 ), sRGB2linear( g1 ), m ) );
float bf = linear2sRGB( lerp( sRGB2linear( b0 ), sRGB2linear( b1 ), m ) );
int r = (int)std::clamp( rf * 255.f, 0.f, 255.f );
int g = (int)std::clamp( gf * 255.f, 0.f, 255.f );
int b = (int)std::clamp( bf * 255.f, 0.f, 255.f );
t[i] = 0xFF000000 | ( b << 16 ) | ( g << 8 ) | r;
}
printf( "uint32_t GoodnessColor[256] = {\n" );
for( int i=0; i<256; i += 8 )
{
printf( " " );
for( int j=i; j<i+8; j++ )
{
printf( " 0x%X,", t[j] );
}
printf( "\n" );
}
printf( "};\n" );
}

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/tracy">
<comment>Tracy Profiler trace file</comment>
<comment xml:lang="pl">Zrzut sesji profilera Tracy</comment>
<icon name="application-tracy"/>
<magic>
<match type="string" value="tlZ\x04" offset="0"/>
<match type="string" value="tZst" offset="0"/>
<match type="string" value="tr\xFDP" offset="0"/>
</magic>
<glob pattern="*.tracy"/>
</mime-type>
</mime-info>

View File

@ -0,0 +1,13 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=Tracy Profiler
GenericName=Code profiler
GenericName[pl]=Profiler kodu
Comment=Examine code to see where it is slow
Comment[pl]=Znajdowanie wolno wykonującego się kodu
Exec=/usr/bin/tracy %f
Icon=tracy
Terminal=false
Categories=Development;Profiling;
MimeType=application/tracy;

30
extra/git-ref.py Normal file
View File

@ -0,0 +1,30 @@
#!/bin/env python3
import filecmp
import subprocess
import sys
import os
out = "GitRef.hpp"
tmp = f"{out}.tmp"
if len(sys.argv) > 1:
rev = sys.argv[1]
else:
rev = "HEAD"
try:
ref = subprocess.run(["git", "rev-parse", "--short", rev], check=True, capture_output=True).stdout.decode().strip()
except subprocess.CalledProcessError:
ref = "unknown"
if not os.path.exists(out):
with open(out, "w") as f:
print(f"#pragma once\n\nnamespace tracy {{ static inline const char* GitRef = \"{ref}\"; }}", file=f)
else:
with open(tmp, "w") as f:
print(f"#pragma once\n\nnamespace tracy {{ static inline const char* GitRef = \"{ref}\"; }}", file=f)
if not filecmp.cmp(out, tmp, shallow=False):
os.replace(tmp, out)
else:
os.unlink(tmp)

50
extra/identify.cpp Normal file
View File

@ -0,0 +1,50 @@
// g++ identify.cpp -lpthread ../public/common/tracy_lz4.cpp ../zstd/common/*.c ../zstd/decompress/*.c ../zstd/decompress/huf_decompress_amd64.S
#include <memory>
#include <stdint.h>
#include <stdio.h>
#include "../server/TracyFileRead.hpp"
#include "../public/common/TracyVersion.hpp"
static const uint8_t FileHeader[8] { 't', 'r', 'a', 'c', 'y', tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch };
enum { FileHeaderMagic = 5 };
int main( int argc, char** argv )
{
if( argc != 2 )
{
fprintf( stderr, "Usage: %s trace\n", argv[0] );
return -1;
}
try
{
std::unique_ptr<tracy::FileRead> f( tracy::FileRead::Open( argv[1] ) );
if( !f )
{
fprintf( stderr, "%s: Cannot open!\n", argv[1] );
return -2;
}
uint8_t hdr[8];
f->Read( hdr, sizeof( hdr ) );
if( memcmp( FileHeader, hdr, FileHeaderMagic ) != 0 )
{
fprintf( stderr, "%s: Bad header!\n", argv[1] );
return -3;
}
printf( "%s: %i.%i.%i\n", argv[1], hdr[FileHeaderMagic], hdr[FileHeaderMagic+1], hdr[FileHeaderMagic+2] );
}
catch( const tracy::NotTracyDump& )
{
fprintf( stderr, "%s: Not a tracy dump!\n", argv[1] );
return -4;
}
catch( const tracy::FileReadError& )
{
fprintf( stderr, "%s: File read error!\n", argv[1] );
return -5;
}
}

26
extra/make-build.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh
rm -rf tracy-build
mkdir tracy-build
./update-meson-version.sh
if [ ! -f vswhere.exe ]; then
wget https://github.com/microsoft/vswhere/releases/download/2.8.4/vswhere.exe
fi
MSVC=`./vswhere.exe -property installationPath -version '[17.0,17.999]' | head -n 1`
MSVC=`wslpath "$MSVC" | tr -d '\r'`
MSBUILD=$MSVC/MSBuild/Current/Bin/MSBuild.exe
for i in capture csvexport import-chrome update; do
echo $i...
"$MSBUILD" ../$i/build/win32/$i.sln /t:Clean /p:Configuration=Release /p:Platform=x64 /noconsolelogger /nologo -m
"$MSBUILD" ../$i/build/win32/$i.sln /t:Build /p:Configuration=Release /p:Platform=x64 /noconsolelogger /nologo -m
cp ../$i/build/win32/x64/Release/$i.exe tracy-build/
done
echo profiler...
"$MSBUILD" ../profiler/build/win32/Tracy.sln /t:Clean /p:Configuration=Release /p:Platform=x64 /noconsolelogger /nologo -m
"$MSBUILD" ../profiler/build/win32/Tracy.sln /t:Build /p:Configuration=Release /p:Platform=x64 /noconsolelogger /nologo -m
cp ../profiler/build/win32/x64/Release/Tracy.exe tracy-build/

154
extra/natvis.py Normal file
View File

@ -0,0 +1,154 @@
import lldb
def VectorSummary(value, dict):
v = value.GetNonSyntheticValue()
size = v.GetChildMemberWithName('m_size').GetValueAsUnsigned()
capacityVal = v.GetChildMemberWithName('m_capacity').GetValueAsUnsigned()
capacity = 1 << capacityVal if capacityVal < 63 else 'read-only'
magic = bool(v.GetChildMemberWithName('m_magic').GetValueAsUnsigned())
return f'{{size={size}, capacity={capacity}, magic={magic}}}'
def ShortPtrSummary(value, dict):
val = value.GetNonSyntheticValue()
ptr = val.GetChildMemberWithName('m_ptr')
type = val.GetType().GetTemplateArgumentType(0)
p0 = ptr.GetChildAtIndex(0).GetValueAsUnsigned()
p1 = ptr.GetChildAtIndex(1).GetValueAsUnsigned()
p2 = ptr.GetChildAtIndex(2).GetValueAsUnsigned()
p3 = ptr.GetChildAtIndex(3).GetValueAsUnsigned()
p4 = ptr.GetChildAtIndex(4).GetValueAsUnsigned()
p5 = ptr.GetChildAtIndex(5).GetValueAsUnsigned()
#return '0x{0:02x}{1:02x}{2:02x}{3:02x}{4:02x}{5:02x}'.format(p5, p4, p3, p2, p1, p0)
return value.CreateValueFromAddress('m_ptr', p0 | (p1 << 8) | (p2 << 16) | (p3 << 24) | (p4 << 32) | (p5 << 40), type)
class ShortPtrPrinter:
def __init__(self, val, dict):
self.val = val
self.type = self.val.GetType().GetTemplateArgumentType(0)
def update(self):
ptr = self.val.GetChildMemberWithName('m_ptr')
p0 = ptr.GetChildAtIndex(0).GetValueAsUnsigned()
p1 = ptr.GetChildAtIndex(1).GetValueAsUnsigned()
p2 = ptr.GetChildAtIndex(2).GetValueAsUnsigned()
p3 = ptr.GetChildAtIndex(3).GetValueAsUnsigned()
p4 = ptr.GetChildAtIndex(4).GetValueAsUnsigned()
p5 = ptr.GetChildAtIndex(5).GetValueAsUnsigned()
self.ptr = p0 | (p1 << 8) | (p2 << 16) | (p3 << 24) | (p4 << 32) | (p5 << 40)
def num_children(self):
return 1
def get_child_index(self, name):
return int(name.lstrip('[').rstrip(']'))
def get_child_at_index(self, index):
return self.val.CreateValueFromAddress('m_ptr', self.ptr, self.type)
class VectorPrinter:
def __init__(self, val, dict):
self.val = val
self.magic = bool(val.GetChildMemberWithName('m_magic').GetValueAsUnsigned())
if self.magic:
self.type = val.GetType().GetTemplateArgumentType(0).GetTemplateArgumentType(0)
else:
self.type = val.GetType().GetTemplateArgumentType(0)
self.stride = self.type.GetByteSize()
def update(self):
ptr = self.val.GetChildMemberWithName('m_ptr').GetChildMemberWithName('m_ptr')
p0 = ptr.GetChildAtIndex(0).GetValueAsUnsigned()
p1 = ptr.GetChildAtIndex(1).GetValueAsUnsigned()
p2 = ptr.GetChildAtIndex(2).GetValueAsUnsigned()
p3 = ptr.GetChildAtIndex(3).GetValueAsUnsigned()
p4 = ptr.GetChildAtIndex(4).GetValueAsUnsigned()
p5 = ptr.GetChildAtIndex(5).GetValueAsUnsigned()
self.ptr = p0 | (p1 << 8) | (p2 << 16) | (p3 << 24) | (p4 << 32) | (p5 << 40)
self.size = self.val.GetChildMemberWithName('m_size').GetValueAsUnsigned()
def num_children(self):
return self.size
def get_child_index(self, name):
return int(name.lstrip('[').rstrip(']'))
def get_child_at_index(self, index):
return self.val.CreateValueFromAddress('[%d]' % index, self.ptr + index * self.stride, self.type)
def Int24Summary(value, dict):
val = value.GetNonSyntheticValue().GetChildMemberWithName('m_val')
p0 = val.GetChildAtIndex(0).GetValueAsUnsigned()
p1 = val.GetChildAtIndex(1).GetValueAsUnsigned()
p2 = val.GetChildAtIndex(2).GetValueAsUnsigned()
return p0 | (p1 << 8) | (p2 << 16)
def Int48Summary(value, dict):
val = value.GetNonSyntheticValue().GetChildMemberWithName('m_val')
p0 = val.GetChildAtIndex(0).GetValueAsUnsigned()
p1 = val.GetChildAtIndex(1).GetValueAsUnsigned()
p2 = val.GetChildAtIndex(2).GetValueAsUnsigned()
p3 = val.GetChildAtIndex(3).GetValueAsUnsigned()
p4 = val.GetChildAtIndex(4).GetValueAsUnsigned()
p5 = val.GetChildAtIndex(5).GetValueAsUnsigned()
return p0 | (p1 << 8) | (p2 << 16) | (p3 << 24) | (p4 << 32) | (p5 << 40)
class ZoneEventPrinter:
def __init__(self, val, dict):
self.val = val
def update(self):
_start_srcloc = self.val.GetChildMemberWithName('_start_srcloc').GetValueAsUnsigned()
_child2 = self.val.GetChildMemberWithName('_child2').GetValueAsUnsigned()
_end_child1 = self.val.GetChildMemberWithName('_end_child1').GetValueAsUnsigned()
self.extra = self.val.GetChildMemberWithName('extra').GetValueAsUnsigned()
self.start = _start_srcloc >> 16
self.end = _end_child1 >> 16
self.srcloc = _start_srcloc & 0xffff
self.child = ((_end_child1 & 0xffff) << 16) | _child2
def num_children(self):
return 5
def get_child_index(self, name):
if name == 'start':
return 0
if name == 'end':
return 1
if name == 'srcloc':
return 2
if name == 'child':
return 3
if name == 'extra':
return 4
return -1
def get_child_at_index(self, index):
if index == 0:
return self.val.CreateValueFromExpression('start', f'int64_t x = {self.start}; x')
if index == 1:
return self.val.CreateValueFromExpression('end', f'int64_t x = {self.end}; x')
if index == 2:
return self.val.CreateValueFromExpression('srcloc', f'int16_t x = {self.srcloc}; x')
if index == 3:
return self.val.CreateValueFromExpression('child', f'int32_t x = {self.child}; x')
if index == 4:
return self.val.CreateValueFromExpression('extra', f'uint32_t x = {self.extra}; x')
def RobinHoodSummary(value, dict):
val = value.GetNonSyntheticValue()
size = val.GetChildMemberWithName('mNumElements').GetValueAsUnsigned()
mask = val.GetChildMemberWithName('mMask').GetValueAsUnsigned()
return f'{{size={size}, load={float(size) / (mask+1)}}}'
def __lldb_init_module(debugger, dict):
lldb.formatters.Logger._lldb_formatters_debug_level = 2
debugger.HandleCommand('type summary add -w tracy -F natvis.VectorSummary -x ^tracy::Vector<.+>')
debugger.HandleCommand('type summary add -w tracy -F natvis.ShortPtrSummary -x ^tracy::short_ptr<.+>')
debugger.HandleCommand('type summary add -w tracy -F natvis.Int24Summary -x ^tracy::Int24')
debugger.HandleCommand('type summary add -w tracy -F natvis.Int48Summary -x ^tracy::Int48')
debugger.HandleCommand('type summary add -w tracy -F natvis.RobinHoodSummary -x ^tracy::detail::Table<.*>')
debugger.HandleCommand('type synthetic add -w tracy -l natvis.VectorPrinter -x ^tracy::Vector<.+>')
debugger.HandleCommand('type synthetic add -w tracy -l natvis.ShortPtrPrinter -x ^tracy::short_ptr<.+>')
debugger.HandleCommand('type synthetic add -w tracy -l natvis.ZoneEventPrinter -x ^tracy::ZoneEvent')
debugger.HandleCommand('type summary add -w tracy -x ^tracy::ZoneEvent --summary-string "start = ${var.start}, end = ${var.end}, srcloc = ${var.srcloc}, child = ${var.child}, extra = ${var.extra}"')
debugger.HandleCommand('type category enable tracy')

View File

@ -1,4 +0,0 @@
#!/bin/sh
clang tracy_systrace.c -s -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -fno-stack-protector -Wl,-z,norelro -Wl,--build-id=none -nostdlib -ldl -o tracy_systrace
strip --strip-all -R .note.gnu.gold-version -R .comment -R .note -R .note.gnu.build-id -R .note.ABI-tag -R .eh_frame -R .eh_frame_hdr -R .gnu.hash -R .gnu.version -R .got tracy_systrace
sstrip -z tracy_systrace

View File

@ -1,53 +0,0 @@
#include <fcntl.h>
#include <poll.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#include <dlfcn.h>
enum { BufSize = 64*1024 };
typedef int (*open_t)( const char*, int, ... );
typedef void (*exit_t)( int );
typedef int (*poll_t)( struct pollfd*, nfds_t, int timeout );
typedef int (*nanosleep_t)( const struct timespec*, struct timespec* );
typedef ssize_t (*read_t)( int, void*, size_t );
typedef ssize_t (*write_t)( int, const void*, size_t );
void _start()
{
void* libc = dlopen( "libc.so", RTLD_LAZY );
open_t sym_open = dlsym( libc, "open" );
exit_t sym_exit = dlsym( libc, "exit" );
poll_t sym_poll = dlsym( libc, "poll" );
nanosleep_t sym_nanosleep = dlsym( libc, "nanosleep" );
read_t sym_read = dlsym( libc, "read" );
write_t sym_write = dlsym( libc, "write" );
char buf[BufSize];
int kernelFd = sym_open( "/sys/kernel/debug/tracing/trace_pipe", O_RDONLY );
if( kernelFd < 0 ) sym_exit( 0 );
struct pollfd pfd;
pfd.fd = kernelFd;
pfd.events = POLLIN | POLLERR;
struct timespec sleepTime;
sleepTime.tv_sec = 0;
sleepTime.tv_nsec = 1000 * 1000 * 10;
for(;;)
{
while( sym_poll( &pfd, 1, 0 ) <= 0 ) sym_nanosleep( &sleepTime, NULL );
const int rd = sym_read( kernelFd, buf, BufSize );
if( rd <= 0 ) break;
sym_write( STDOUT_FILENO, buf, rd );
}
sym_exit( 0 );
}

View File

@ -22,6 +22,7 @@ struct AsmVar
struct AsmOp struct AsmOp
{ {
int id; int id;
int descId;
int numVariants; int numVariants;
const AsmVar*const* variant; const AsmVar*const* variant;
}; };
@ -35,6 +36,7 @@ struct MicroArchitecture
extern const char* MicroArchitectureList[]; extern const char* MicroArchitectureList[];
extern const char* PortList[]; extern const char* PortList[];
extern const char* OpsList[]; extern const char* OpsList[];
extern const char* OpDescList[];
extern const char* IsaList[]; extern const char* IsaList[];
extern const MicroArchitecture* const MicroArchitectureData[]; extern const MicroArchitecture* const MicroArchitectureData[];

View File

@ -53,6 +53,7 @@ struct Variant
struct Op struct Op
{ {
std::vector<Variant> var; std::vector<Variant> var;
int desc;
}; };
struct UArch struct UArch
@ -81,6 +82,7 @@ int main()
auto root = doc.child( "root" ); auto root = doc.child( "root" );
Dictionary ops; Dictionary ops;
Dictionary opsdesc;
Dictionary uarchs; Dictionary uarchs;
Dictionary ports; Dictionary ports;
Dictionary isas; Dictionary isas;
@ -94,6 +96,7 @@ int main()
{ {
assert( strcmp( op.name(), "instruction" ) == 0 ); assert( strcmp( op.name(), "instruction" ) == 0 );
auto opstr = op.attribute( "asm" ).value(); auto opstr = op.attribute( "asm" ).value();
auto opdesc = op.attribute( "summary" ).value();
bool magic = false; bool magic = false;
if( opstr[0] == '{' ) if( opstr[0] == '{' )
{ {
@ -125,6 +128,7 @@ int main()
} }
} }
const auto opidx = ops.Get( opstr ); const auto opidx = ops.Get( opstr );
const auto opdescidx = opsdesc.Get( opdesc );
int isaSet = isas.Get( op.attribute( "isa-set" ).value() ); int isaSet = isas.Get( op.attribute( "isa-set" ).value() );
@ -151,8 +155,13 @@ int main()
if( uav.size() <= uaidx ) uav.emplace_back( UArch {} ); if( uav.size() <= uaidx ) uav.emplace_back( UArch {} );
auto& uai = uav[uaidx]; auto& uai = uav[uaidx];
auto& opi = uai.ops[opidx]; auto& opi = uai.ops[opidx];
opi.desc = opdescidx;
float tp = -1;
if( measurement.attribute( "TP" ) ) tp = atof( measurement.attribute( "TP" ).value() );
else if( measurement.attribute( "TP_ports" ) ) tp = atof( measurement.attribute( "TP_ports" ).value() );
else if( measurement.attribute( "TP_unrolled" ) ) tp = atof( measurement.attribute( "TP_unrolled" ).value() );
float tp = measurement.attribute( "TP" ) ? atof( measurement.attribute( "TP" ).value() ) : -1;
int portid = measurement.attribute( "ports" ) ? ports.Get( measurement.attribute( "ports" ).value() ) : -1; int portid = measurement.attribute( "ports" ) ? ports.Get( measurement.attribute( "ports" ).value() ) : -1;
int uops = measurement.attribute( "uops" ) ? atoi( measurement.attribute( "uops" ).value() ) : -1; int uops = measurement.attribute( "uops" ) ? atoi( measurement.attribute( "uops" ).value() ) : -1;
assert( tp != -1 && uops != -1 ); assert( tp != -1 && uops != -1 );
@ -224,6 +233,13 @@ int main()
} }
printf( "};\n\n" ); printf( "};\n\n" );
printf( "const char* OpDescList[]={\n" );
for( auto& v : opsdesc.strlist )
{
printf( "\"%s\",\n", v.c_str() );
}
printf( "};\n\n" );
printf( "#define V static constexpr AsmVar\n" ); printf( "#define V static constexpr AsmVar\n" );
printf( "#define A static constexpr AsmVar const*\n\n" ); printf( "#define A static constexpr AsmVar const*\n\n" );
@ -269,7 +285,7 @@ int main()
for( auto it = ua.ops.begin(); it != ua.ops.end(); ++it ) for( auto it = ua.ops.begin(); it != ua.ops.end(); ++it )
{ {
auto& op = *it; auto& op = *it;
printf( "O x%x_%x={%i,%i,y%x_%x};\n", uaidx, op.first, op.first, (int)op.second.var.size(), uaidx, op.first ); printf( "O x%x_%x={%i,%i,%i,y%x_%x};\n", uaidx, op.first, op.first, op.second.desc, (int)op.second.var.size(), uaidx, op.first );
opsort.emplace_back( it ); opsort.emplace_back( it );
} }
std::sort( opsort.begin(), opsort.end(), []( const auto& l, const auto& r ) { return l->first < r->first; } ); std::sort( opsort.begin(), opsort.end(), []( const auto& l, const auto& r ) { return l->first < r->first; } );

13
extra/update-meson-version.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
version_header="../public/common/TracyVersion.hpp"
major=$(grep -o -E 'Major = [0-9]+' "$version_header" | awk -F '= ' '{print $2}')
minor=$(grep -o -E 'Minor = [0-9]+' "$version_header" | awk -F '= ' '{print $2}')
patch=$(grep -o -E 'Patch = [0-9]+' "$version_header" | awk -F '= ' '{print $2}')
version="${major}.${minor}.${patch}"
# the extension is required for macOS's outdated sed
sed -i.bak "s/version: '[0-9]*\.[0-9]*\.[0-9]*'/version: '$version'/g" ../meson.build
rm ../meson.build.bak

11
extra/version.cpp Normal file
View File

@ -0,0 +1,11 @@
#include <stdint.h>
#include <stdio.h>
#include "../server/TracyFileHeader.hpp"
#include "../public/common/TracyVersion.hpp"
int main()
{
const auto ver = uint32_t( tracy::FileVersion( tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch ) );
fwrite( &ver, 1, 4, stdout );
}

67
extra/zigzag.svg Normal file
View File

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="32"
height="32"
viewBox="0 0 8.4666665 8.4666666"
version="1.1"
id="svg5"
inkscape:export-filename="zigzag.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96"
inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
sodipodi:docname="zigzag.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:showpageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#505050"
inkscape:document-units="px"
showgrid="true"
showguides="true"
inkscape:zoom="26.808186"
inkscape:cx="14.603748"
inkscape:cy="18.893483"
inkscape:window-width="3840"
inkscape:window-height="2054"
inkscape:window-x="-11"
inkscape:window-y="-11"
inkscape:window-maximized="1"
inkscape:current-layer="layer1">
<inkscape:grid
type="xygrid"
id="grid132"
originx="0"
originy="0" />
<sodipodi:guide
position="3.7041666,4.2333333"
orientation="0,-1"
id="guide742"
inkscape:locked="false" />
<sodipodi:guide
position="4.2333333,4.2333333"
orientation="1,0"
id="guide744"
inkscape:locked="false" />
</sodipodi:namedview>
<defs
id="defs2" />
<g
inkscape:label="Warstwa 1"
inkscape:groupmode="layer"
id="layer1">
<path
style="fill:none;stroke:#ffffff;stroke-width:0.79374999;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1;stroke-dasharray:none;paint-order:normal;stroke-dashoffset:0"
d="M -0.79374999,5.0270833 2.1166666,2.1166666 6.3499999,6.3499999 9.2604166,3.4395833"
id="path800" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
extra/zigzag01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

BIN
extra/zigzag02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 B

BIN
extra/zigzag04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 B

BIN
extra/zigzag08.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

Some files were not shown because too many files have changed in this diff Show More