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

Compare commits

...

1426 Commits
v0.9 ... 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
433 changed files with 204815 additions and 292959 deletions

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'
...

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,44 +0,0 @@
name: gcc
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macOS-latest]
steps:
- uses: actions/checkout@v2
- name: Install linux libraries
if: ${{ matrix.os == 'ubuntu-22.04' }}
run: sudo apt-get update && sudo apt-get -y install libglfw3-dev libdbus-1-dev libcapstone-dev libtbb-dev libdebuginfod-dev
- name: Install macos libraries
if: ${{ matrix.os == 'macOS-latest' }}
run: brew install capstone tbb pkg-config glfw
- name: Profiler GUI
run: make -j`nproc` -C profiler/build/unix debug release
- name: Update utility
run: make -j`nproc` -C update/build/unix debug release
- name: Capture utility
run: make -j`nproc` -C capture/build/unix debug release
- name: Csvexport utility
run: make -j`nproc` -C csvexport/build/unix debug release
- name: Import-chrome utility
run: make -j`nproc` -C import-chrome/build/unix debug release
- name: Library
run: make -j`nproc` -C library/unix debug release
- name: Test application
run: |
make -j`nproc` -C test
make -j`nproc` -C test clean
make -j`nproc` -C test TRACYFLAGS=-DTRACY_ON_DEMAND
make -j`nproc` -C test clean
make -j`nproc` -C test TRACYFLAGS="-DTRACY_DELAYED_INIT -DTRACY_MANUAL_LIFETIME"

View File

@ -12,17 +12,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Fix stupidity
run: |
cp AUTHORS AUTHORS.
cp LICENSE LICENSE.
- name: Compile LaTeX
uses: xu-cheng/latex-action@v2
uses: xu-cheng/latex-action@v3
with:
working_directory: manual
root_file: tracy.tex
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: manual
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,72 +0,0 @@
name: MSVC
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build-with-vcpkg-integration:
runs-on: windows-2022
steps:
- uses: actions/checkout@v2
- uses: microsoft/setup-msbuild@v1.0.2
- name: Integrate vcpkg
run: vcpkg integrate install
- 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: Csvexport utility Debug
run: msbuild .\csvexport\build\win32\csvexport.vcxproj /property:Configuration=Debug /property:Platform=x64
- name: Csvexport utility Release
run: msbuild .\csvexport\build\win32\csvexport.vcxproj /property:Configuration=Release /property:Platform=x64
- name: Import-chrome utility Debug
run: msbuild .\import-chrome\build\win32\import-chrome.vcxproj /property:Configuration=Debug /property:Platform=x64
- name: Import-chrome utility Release
run: msbuild .\import-chrome\build\win32\import-chrome.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 import-chrome\build\win32\x64\Release\import-chrome.exe bin
copy csvexport\build\win32\x64\Release\csvexport.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
build-without-vcpkg-integration:
runs-on: windows-2022
env:
VCPKG_ROOT: ''
steps:
- uses: actions/checkout@v2
- uses: microsoft/setup-msbuild@v1.0.2
- name: Install vcpkg dependencies
run: vcpkg/install_vcpkg_dependencies.bat
- name: Profiler GUI Release
run: msbuild .\profiler\build\win32\Tracy.vcxproj /property:Configuration=Release /property:Platform=x64
- name: Capture utility Release
run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Release /property:Platform=x64

20
.gitignore vendored
View File

@ -1,10 +1,4 @@
.vs
*.opendb
*.db
*.vcxproj.user
x64
Release
Debug
_build
_compiler
tools/*
@ -12,6 +6,7 @@ tools/*
*.o
*.so
*.swp
*.obj
imgui.ini
test/tracy_test
test/tracy_test.exe
@ -24,19 +19,18 @@ manual/t*.synctex.gz
manual/t*.toc
manual/t*.bbl
manual/t*.blg
manual/t*.fdb_latexmk
manual/t*.fls
profiler/build/win32/packages
profiler/build/win32/Tracy.aps
# include the vcpkg install script but not the files it produces
vcpkg/*
!vcpkg/install_vcpkg_dependencies.bat
/vcpkg_installed
.deps/
.dirstamp
.vscode/
/_*/**
/**/__pycache__/**
extra/vswhere.exe
extra/tracy-build
/.cache
.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>

View File

@ -1,17 +0,0 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/include/freetype2"
],
"defines": [],
"compilerPath": "/usr/bin/clang++",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}

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"
]
}

55
.vscode/launch.json vendored
View File

@ -1,58 +1,13 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Profiler GUI",
"name": "Launch",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/profiler/build/unix/Tracy-debug",
"program": "${command:cmake.launchTargetPath}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"preLaunchTask": "Build Profiler GUI",
"console": "internalConsole",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Launch capture tool",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/capture/build/unix/capture-debug",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"preLaunchTask": "Build capture tool"
},
{
"name": "Launch update tool",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/update/build/unix/update-debug",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"preLaunchTask": "Build update tool"
},
{
"name": "Launch test application",
"type": "lldb",
"request": "launch",
"program": "${workspaceFolder}/test/tracy_test",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/test",
"environment": [],
"externalConsole": false,
"preLaunchTask": "Build test application"
},
"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"],
}

88
.vscode/tasks.json vendored
View File

@ -1,88 +0,0 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build Profiler GUI",
"type": "shell",
"command": "CC=clang CXX=clang++ make debug -C profiler/build/unix -j `nproc`",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"close": true
}
},
{
"label": "Build capture tool",
"type": "shell",
"command": "CC=clang CXX=clang++ make debug -C capture/build/unix -j `nproc`",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"close": true
}
},
{
"label": "Build csvexport tool",
"type": "shell",
"command": "CC=clang CXX=clang++ make debug -C csvexport/build/unix -j `nproc`",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"close": true
}
},
{
"label": "Build import-chrome tool",
"type": "shell",
"command": "CC=clang CXX=clang++ make debug -C import-chrome/build/unix -j `nproc`",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Build update tool",
"type": "shell",
"command": "CC=clang CXX=clang++ make debug -C update/build/unix -j `nproc`",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"close": true
}
},
{
"label": "Build client library",
"type": "shell",
"command": "CC=clang CXX=clang++ make debug -C library/unix -j `nproc`",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"close": true
}
},
{
"label": "Build test application",
"type": "shell",
"command": "CC=clang CXX=clang++ make OPTFLAGS=-DTRACY_VERBOSE\\ -fno-omit-frame-pointer\\ -march=native\\ -g -C test -j `nproc`",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"close": true
}
}
]
}

20
AUTHORS
View File

@ -1,20 +0,0 @@
Bartosz Taudul <wolf@nereid.pl>
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)
Simonas Kazlauskas <git@kazlauskas.me> (OSX CI, external bindings)
Jakub Žádník <kubouch@gmail.com> (csvexport utility)
Andrey Voroshilov <andrew.voroshilov@gmail.com> (multi-DLL fixes)
Benoit Jacob <benoitjacob@google.com> (Android improvements)
David Farrel <dafarrel@adobe.com> (Direct3D 11 support)
Terence Rokop <rokopt@sharpears.net> (Non-reentrant zones)
Lukas Berbuer <lukas.berbuer@gmail.com> (CMake integration)
Xavier Bouchoux <xavierb@gmail.com> (sample data in find zone)
Balazs Kovacsics <kovab93@gmail.com> (Universal Windows Platform)

View File

@ -1,27 +1,52 @@
cmake_minimum_required(VERSION 3.10)
project(Tracy LANGUAGES CXX)
# 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)
set(DEFAULT_STATIC OFF)
else()
set(DEFAULT_STATIC ON)
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(TRACY_STATIC)
set(TRACY_VISIBILITY "STATIC")
if(LTO_SUPPORTED)
set(TRACY_VISIBILITY "OBJECT")
elseif(TRACY_STATIC)
set(TRACY_VISIBILITY "STATIC")
else()
set(TRACY_VISIBILITY "SHARED")
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>)
@ -32,8 +57,22 @@ target_link_libraries(
${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")
if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang")
target_link_libraries(TracyClient PUBLIC ws2_32 dbghelp)
endif()
@ -42,7 +81,24 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
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})
@ -56,7 +112,7 @@ endmacro()
set_option(TRACY_ENABLE "Enable profiling" ON)
set_option(TRACY_ON_DEMAND "On-demand profiling" OFF)
set_option(TRACY_CALLSTACK "Enfore callstack collection for tracy regions" 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)
@ -70,11 +126,27 @@ 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)
@ -84,6 +156,11 @@ 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
@ -98,9 +175,11 @@ 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
@ -109,6 +188,7 @@ set(client_includes
${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)
@ -134,14 +214,58 @@ install(TARGETS TracyClient
EXPORT TracyConfig
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE 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)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/tracy)
install(FILES ${client_includes}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/client)
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/client)
install(FILES ${common_includes}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/common)
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 TracyConfig.cmake
DESTINATION share/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
3-clause BSD license.
Copyright (c) 2017-2022, Bartosz Taudul <wolf@nereid.pl>
Copyright (c) 2017-2025, Bartosz Taudul <wolf@nereid.pl>
All rights reserved.
Redistribution and use in source and binary forms, with or without

283
NEWS
View File

@ -2,6 +2,289 @@ 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
here.
vx.xx.x (xxxx-xx-xx)
--------------------
- 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)
-------------------

View File

@ -4,7 +4,7 @@
### A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications.
Tracy supports profiling CPU (Direct support is provided for C, C++, and Lua integration. At the same time, third-party bindings to many other languages exist on the internet, such as Rust, Zig, C#, OCaml, Odin, etc.), GPU (All major graphic APIs: OpenGL, Vulkan, Direct3D 11/12, OpenCL.), memory allocations, locks, context switches, automatically attribute screenshots to captured frames, and much 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.
- [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
@ -17,6 +17,8 @@ Tracy supports profiling CPU (Direct support is provided for C, C++, and Lua int
![](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)
[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)

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,16 +0,0 @@
all: release
debug:
@+make -f debug.mk all
release:
@+make -f release.mk all
clean:
@+make -f build.mk clean
db: clean
@bear -- $(MAKE) -f debug.mk all
@mv -f compile_commands.json ../../../
.PHONY: all clean debug release db

View File

@ -1,12 +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 := ../../../getopt/getopt.c
include ../../../common/src-from-vcxproj.mk
include ../../../common/unix.mk

View File

@ -1,6 +0,0 @@
CFLAGS := -g3 -Wall
DEFINES := -DDEBUG
BUILD := debug
include ../../../common/unix-debug.mk
include build.mk

View File

@ -1,9 +0,0 @@
CFLAGS := -O3
ifndef TRACY_NO_LTO
CFLAGS += -flto
endif
DEFINES := -DNDEBUG
BUILD := release
include ../../../common/unix-release.mk
include build.mk

View File

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
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,210 +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|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|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</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|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 />
<PropertyGroup Label="Vcpkg">
<VcpkgEnableManifest>true</VcpkgEnableManifest>
</PropertyGroup>
<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>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include;$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include\capstone;$(VcpkgManifestRoot)\vcpkg_installed\$(VcpkgTriplet)\$(VcpkgTriplet)\include\capstone;$(VcpkgRoot)\installed\$(VcpkgTriplet)\include\capstone</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\debug\lib</AdditionalLibraryDirectories>
</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>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include;$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include\capstone;$(VcpkgManifestRoot)\vcpkg_installed\$(VcpkgTriplet)\$(VcpkgTriplet)\include\capstone;$(VcpkgRoot)\installed\$(VcpkgTriplet)\include\capstone</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\getopt\getopt.c" />
<ClCompile Include="..\..\..\public\common\TracySocket.cpp" />
<ClCompile Include="..\..\..\public\common\TracyStackFrames.cpp" />
<ClCompile Include="..\..\..\public\common\TracySystem.cpp" />
<ClCompile Include="..\..\..\public\common\tracy_lz4.cpp" />
<ClCompile Include="..\..\..\public\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\common\debug.c" />
<ClCompile Include="..\..\..\zstd\common\entropy_common.c" />
<ClCompile Include="..\..\..\zstd\common\error_private.c" />
<ClCompile Include="..\..\..\zstd\common\fse_decompress.c" />
<ClCompile Include="..\..\..\zstd\common\pool.c" />
<ClCompile Include="..\..\..\zstd\common\threading.c" />
<ClCompile Include="..\..\..\zstd\common\xxhash.c" />
<ClCompile Include="..\..\..\zstd\common\zstd_common.c" />
<ClCompile Include="..\..\..\zstd\compress\fse_compress.c" />
<ClCompile Include="..\..\..\zstd\compress\hist.c" />
<ClCompile Include="..\..\..\zstd\compress\huf_compress.c" />
<ClCompile Include="..\..\..\zstd\compress\zstdmt_compress.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_compress.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_literals.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_sequences.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_superblock.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_double_fast.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_fast.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_lazy.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_ldm.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_opt.c" />
<ClCompile Include="..\..\..\zstd\decompress\huf_decompress.c" />
<ClCompile Include="..\..\..\zstd\decompress\zstd_ddict.c" />
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress.c" />
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress_block.c" />
<ClCompile Include="..\..\..\zstd\dictBuilder\cover.c" />
<ClCompile Include="..\..\..\zstd\dictBuilder\divsufsort.c" />
<ClCompile Include="..\..\..\zstd\dictBuilder\fastcover.c" />
<ClCompile Include="..\..\..\zstd\dictBuilder\zdict.c" />
<ClCompile Include="..\..\src\capture.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\getopt\getopt.h" />
<ClInclude Include="..\..\..\public\common\TracyAlign.hpp" />
<ClInclude Include="..\..\..\public\common\TracyAlloc.hpp" />
<ClInclude Include="..\..\..\public\common\TracyApi.h" />
<ClInclude Include="..\..\..\public\common\TracyColor.hpp" />
<ClInclude Include="..\..\..\public\common\TracyForceInline.hpp" />
<ClInclude Include="..\..\..\public\common\TracyMutex.hpp" />
<ClInclude Include="..\..\..\public\common\TracyProtocol.hpp" />
<ClInclude Include="..\..\..\public\common\TracyQueue.hpp" />
<ClInclude Include="..\..\..\public\common\TracySocket.hpp" />
<ClInclude Include="..\..\..\public\common\TracyStackFrames.hpp" />
<ClInclude Include="..\..\..\public\common\TracySystem.hpp" />
<ClInclude Include="..\..\..\public\common\TracyUwp.hpp" />
<ClInclude Include="..\..\..\public\common\TracyYield.hpp" />
<ClInclude Include="..\..\..\public\common\tracy_lz4.hpp" />
<ClInclude Include="..\..\..\public\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\common\bitstream.h" />
<ClInclude Include="..\..\..\zstd\common\compiler.h" />
<ClInclude Include="..\..\..\zstd\common\cpu.h" />
<ClInclude Include="..\..\..\zstd\common\debug.h" />
<ClInclude Include="..\..\..\zstd\common\error_private.h" />
<ClInclude Include="..\..\..\zstd\common\fse.h" />
<ClInclude Include="..\..\..\zstd\common\huf.h" />
<ClInclude Include="..\..\..\zstd\common\mem.h" />
<ClInclude Include="..\..\..\zstd\common\pool.h" />
<ClInclude Include="..\..\..\zstd\common\portability_macros.h" />
<ClInclude Include="..\..\..\zstd\common\threading.h" />
<ClInclude Include="..\..\..\zstd\common\xxhash.h" />
<ClInclude Include="..\..\..\zstd\common\zstd_deps.h" />
<ClInclude Include="..\..\..\zstd\common\zstd_internal.h" />
<ClInclude Include="..\..\..\zstd\common\zstd_trace.h" />
<ClInclude Include="..\..\..\zstd\compress\clevels.h" />
<ClInclude Include="..\..\..\zstd\compress\hist.h" />
<ClInclude Include="..\..\..\zstd\compress\zstdmt_compress.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_internal.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_literals.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_sequences.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_superblock.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_cwksp.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_double_fast.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_fast.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_lazy.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm_geartab.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_opt.h" />
<ClInclude Include="..\..\..\zstd\decompress\zstd_ddict.h" />
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_block.h" />
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_internal.h" />
<ClInclude Include="..\..\..\zstd\dictBuilder\cover.h" />
<ClInclude Include="..\..\..\zstd\dictBuilder\divsufsort.h" />
<ClInclude Include="..\..\..\zstd\zdict.h" />
<ClInclude Include="..\..\..\zstd\zstd.h" />
<ClInclude Include="..\..\..\zstd\zstd_errors.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\zstd\decompress\huf_decompress_amd64.S" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,371 +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="getopt">
<UniqueIdentifier>{ee9737d2-69c7-44da-b9c7-539d18f9d4b4}</UniqueIdentifier>
</Filter>
<Filter Include="zstd">
<UniqueIdentifier>{f201463b-5e69-46fe-bdfc-1b5eed86c7f7}</UniqueIdentifier>
</Filter>
<Filter Include="zstd\common">
<UniqueIdentifier>{7e93ae33-6543-4bca-b05b-50818dbf24cc}</UniqueIdentifier>
</Filter>
<Filter Include="zstd\compress">
<UniqueIdentifier>{3b0c32f5-9efb-4503-9394-5ab95909fb1c}</UniqueIdentifier>
</Filter>
<Filter Include="zstd\decompress">
<UniqueIdentifier>{c1f99170-d904-4af1-8010-0a3ded5736c8}</UniqueIdentifier>
</Filter>
<Filter Include="zstd\dictBuilder">
<UniqueIdentifier>{456e6786-ea57-42b8-ae38-829cd2d918bd}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<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="..\..\..\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="..\..\..\server\TracyMmap.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyTextureCompression.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\getopt\getopt.c">
<Filter>getopt</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\debug.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\entropy_common.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\error_private.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\fse_decompress.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\pool.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\threading.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\xxhash.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\zstd_common.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\fse_compress.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\hist.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\huf_compress.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_compress.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_literals.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_sequences.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_superblock.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_double_fast.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_fast.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_lazy.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_ldm.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_opt.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstdmt_compress.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\decompress\huf_decompress.c">
<Filter>zstd\decompress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\decompress\zstd_ddict.c">
<Filter>zstd\decompress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress.c">
<Filter>zstd\decompress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress_block.c">
<Filter>zstd\decompress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\dictBuilder\cover.c">
<Filter>zstd\dictBuilder</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\dictBuilder\divsufsort.c">
<Filter>zstd\dictBuilder</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\dictBuilder\fastcover.c">
<Filter>zstd\dictBuilder</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\dictBuilder\zdict.c">
<Filter>zstd\dictBuilder</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\tracy_lz4.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\tracy_lz4hc.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\TracySocket.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\TracyStackFrames.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\TracySystem.cpp">
<Filter>common</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<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="..\..\..\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="..\..\..\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>
<ClInclude Include="..\..\..\getopt\getopt.h">
<Filter>getopt</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_errors.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\bitstream.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\compiler.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\cpu.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\debug.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\error_private.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\fse.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\huf.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\mem.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\pool.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\threading.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\xxhash.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\zstd_deps.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\zstd_internal.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\zstd_trace.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\hist.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_internal.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_literals.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_sequences.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_superblock.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_cwksp.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_double_fast.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_fast.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_lazy.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm_geartab.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_opt.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstdmt_compress.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\decompress\zstd_ddict.h">
<Filter>zstd\decompress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_block.h">
<Filter>zstd\decompress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_internal.h">
<Filter>zstd\decompress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\dictBuilder\cover.h">
<Filter>zstd\dictBuilder</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\dictBuilder\divsufsort.h">
<Filter>zstd\dictBuilder</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zdict.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\portability_macros.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\clevels.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\tracy_lz4.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\tracy_lz4hc.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyAlign.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyAlloc.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyApi.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyColor.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyForceInline.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyMutex.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyProtocol.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyQueue.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracySocket.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyStackFrames.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracySystem.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyUwp.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyYield.hpp">
<Filter>common</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\zstd\decompress\huf_decompress_amd64.S">
<Filter>zstd\decompress</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -21,6 +21,7 @@
#include "../../server/TracyFileWrite.hpp"
#include "../../server/TracyMemory.hpp"
#include "../../server/TracyPrint.hpp"
#include "../../server/TracySysUtil.hpp"
#include "../../server/TracyWorker.hpp"
#ifdef _WIN32
@ -61,6 +62,7 @@ bool IsStdoutATerminal() { return s_isStdoutATerminal; }
#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"
@ -90,7 +92,7 @@ void AnsiPrintf( const char* ansiEscape, const char* format, ... ) {
[[noreturn]] void Usage()
{
printf( "Usage: capture -o output.tracy [-a address] [-p port] [-f] [-s seconds]\n" );
printf( "Usage: capture -o output.tracy [-a address] [-p port] [-f] [-s seconds] [-m memlimit]\n" );
exit( 1 );
}
@ -111,9 +113,10 @@ int main( int argc, char** argv )
const char* output = nullptr;
int port = 8086;
int seconds = -1;
int64_t memoryLimit = -1;
int c;
while( ( c = getopt( argc, argv, "a:o:p:fs:" ) ) != -1 )
while( ( c = getopt( argc, argv, "a:o:p:fs:m:" ) ) != -1 )
{
switch( c )
{
@ -130,7 +133,10 @@ int main( int argc, char** argv )
overwrite = true;
break;
case 's':
seconds = atoi (optarg);
seconds = atoi(optarg);
break;
case 'm':
memoryLimit = std::clamp( atoll( optarg ), 1ll, 999ll ) * tracy::GetPhysicalMemorySize() / 100;
break;
default:
Usage();
@ -158,8 +164,8 @@ int main( int argc, char** argv )
printf( "Connecting to %s:%i...", address, port );
fflush( stdout );
tracy::Worker worker( address, port );
while( !worker.IsConnected() )
tracy::Worker worker( address, port, memoryLimit );
while( !worker.HasData() )
{
const auto handshake = worker.GetHandshakeStatus();
if( handshake == tracy::HandshakeProtocolMismatch )
@ -179,7 +185,6 @@ int main( int argc, char** argv )
}
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() ) );
#ifdef _WIN32
@ -191,6 +196,7 @@ int main( int argc, char** argv )
sigaction( SIGINT, &sigint, &oldsigint );
#endif
const auto firstTime = worker.GetFirstTime();
auto& lock = worker.GetMbpsDataLock();
const auto t0 = std::chrono::high_resolution_clock::now();
@ -232,11 +238,16 @@ int main( int argc, char** argv )
AnsiPrintf( ANSI_YELLOW ANSI_BOLD, "%7.2f Mbps", mbps / compRatio );
printf( " | ");
AnsiPrintf( ANSI_YELLOW, "Tx: ");
AnsiPrintf( ANSI_GREEN, "%s", tracy::MemSizeToString( netTotal ) );
AnsiPrintf( ANSI_GREEN, "%s", tracy::MemSizeToString( netTotal ) );
printf( " | ");
AnsiPrintf( ANSI_RED ANSI_BOLD, "%s", tracy::MemSizeToString( tracy::memUsage ) );
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() ) );
AnsiPrintf( ANSI_RED, "%s", tracy::TimeToString( worker.GetLastTime() - firstTime ) );
fflush( stdout );
}
@ -265,7 +276,7 @@ int main( int argc, char** argv )
}
if( fd.callstack != 0 )
{
AnsiPrintf( ANSI_BOLD, "\n%sFailure callstack:%s\n" );
AnsiPrintf( ANSI_BOLD, "\nFailure callstack:\n" );
auto& cs = worker.GetCallstack( fd.callstack );
int fidx = 0;
for( auto& entry : cs )
@ -332,10 +343,10 @@ int main( int argc, char** argv )
}
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() ) );
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 )
{
worker.Write( *f, false );

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,21 +0,0 @@
# Extract the actual list of source files from a sibling Visual Studio project.
# Ensure these are simply-substituted variables, without changing their values.
SRC := $(SRC)
SRC2 := $(SRC2)
SRC3 := $(SRC3)
SRC4 := $(SRC4)
# Paths here are relative to the directory in which make was invoked, not to
# this file, so ../win32/$(PROJECT).vcxproj refers to the Visual Studio project
# of whichever tool is including this makefile fragment.
BASE := $(shell grep -E 'ClCompile.*cpp"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
BASE2 := $(shell grep -E 'ClCompile.*c"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
BASE4 := $(shell grep -E 'None.*S"' ../win32/$(PROJECT).vcxproj | sed -e 's/.*\"\(.*\)\".*/\1/' | sed -e 's@\\@/@g')
# The tool-specific makefile may request that certain files be omitted.
SRC += $(filter-out $(FILTER),$(BASE))
SRC2 += $(filter-out $(FILTER),$(BASE2))
SRC3 += $(filter-out $(FILTER),$(BASE3))
SRC4 += $(filter-out $(FILTER),$(BASE4))

View File

@ -1,15 +0,0 @@
ARCH := $(shell uname -m)
ifeq (1,$(shell $(CC) --version | grep clang > /dev/null && echo 1 || echo 0))
ifeq (1,$(shell ld.mold --version > /dev/null 2> /dev/null && echo 1 || echo 0))
LDFLAGS := -fuse-ld=mold
endif
endif
ifndef TRACY_NO_ISA_EXTENSIONS
ifneq (,$(filter $(ARCH),aarch64 arm64))
CFLAGS += -mcpu=native
else
CFLAGS += -march=native
endif
endif

View File

@ -1,19 +0,0 @@
ARCH := $(shell uname -m)
ifeq (0,$(shell $(CC) --version | grep clang > /dev/null && echo 1 || echo 0))
CFLAGS += -s
else
ifeq (1,$(shell ld.mold --version > /dev/null 2> /dev/null && echo 1 || echo 0))
LDFLAGS := -s -fuse-ld=mold
else
LDFLAGS := -s
endif
endif
ifndef TRACY_NO_ISA_EXTENSIONS
ifneq (,$(filter $(ARCH),aarch64 arm64))
CFLAGS += -mcpu=native
else
CFLAGS += -march=native
endif
endif

View File

@ -1,84 +0,0 @@
# Common code needed by most Tracy Unix Makefiles.
# Ensure these are simply-substituted variables, without changing their values.
LIBS := $(LIBS)
ifndef NO_TBB
# Tracy does not use TBB directly, but the implementation of parallel algorithms
# in some versions of libstdc++ depends on TBB. When it does, you must
# explicitly link against -ltbb.
#
# Some distributions have pgk-config files for TBB, others don't.
ifeq (0,$(shell pkg-config --libs tbb >/dev/null 2>&1; echo $$?))
LIBS += $(shell pkg-config --libs tbb)
else ifeq (0,$(shell ld -ltbb -o /dev/null 2>/dev/null; echo $$?))
LIBS += -ltbb
endif
endif
OBJDIRBASE := obj/$(BUILD)
OBJDIR := $(OBJDIRBASE)/o/o/o
OBJ := $(addprefix $(OBJDIR)/,$(SRC:%.cpp=%.o))
OBJ2 := $(addprefix $(OBJDIR)/,$(SRC2:%.c=%.o))
OBJ3 := $(addprefix $(OBJDIR)/,$(SRC3:%.m=%.o))
OBJ4 := $(addprefix $(OBJDIR)/,$(SRC4:%.S=%.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 $@.$$$$
$(OBJDIR)/%.o: %.m
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
$(OBJDIR)/%.d : %.m
@echo Resolving dependencies of $<
@mkdir -p $(@D)
@$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.m=.o) $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
$(OBJDIR)/%.o: %.S
$(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
$(OBJDIR)/%.d : %.S
@echo Resolving dependencies of $<
@mkdir -p $(@D)
@$(CC) -MM $(INCLUDES) $(CFLAGS) $(DEFINES) $< > $@.$$$$; \
sed 's,.*\.o[ :]*,$(OBJDIR)/$(<:.m=.o) $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
ifeq (yes,$(SHARED_LIBRARY))
$(IMAGE): $(OBJ) $(OBJ2) $(OBJ4)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(DEFINES) $(OBJ) $(OBJ2) $(OBJ4) $(LIBS) -shared -o $@
else
$(IMAGE): $(OBJ) $(OBJ2) $(OBJ3) $(OBJ4)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(DEFINES) $(OBJ) $(OBJ2) $(OBJ3) $(OBJ4) $(LIBS) -o $@
endif
ifneq "$(MAKECMDGOALS)" "clean"
-include $(addprefix $(OBJDIR)/,$(SRC:.cpp=.d)) $(addprefix $(OBJDIR)/,$(SRC2:.c=.d)) $(addprefix $(OBJDIR)/,$(SRC3:.m=.d)) $(addprefix $(OBJDIR)/,$(SRC4:.S=.d))
endif
clean:
rm -rf $(OBJDIRBASE) $(IMAGE)*
.PHONY: clean all

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})

View File

@ -1,16 +0,0 @@
all: release
debug:
@+make -f debug.mk all
release:
@+make -f release.mk all
clean:
@+make -f build.mk clean
db: clean
@bear -- $(MAKE) -f debug.mk all
@mv -f compile_commands.json ../../../
.PHONY: all clean debug release db

View File

@ -1,12 +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 := csvexport
IMAGE := $(PROJECT)-$(BUILD)
FILTER :=
include ../../../common/src-from-vcxproj.mk
include ../../../common/unix.mk

View File

@ -1,6 +0,0 @@
CFLAGS := -g3 -Wall
DEFINES := -DDEBUG
BUILD := debug
include ../../../common/unix-debug.mk
include build.mk

View File

@ -1,9 +0,0 @@
CFLAGS := -O3
ifndef TRACY_NO_LTO
CFLAGS += -flto
endif
DEFINES := -DNDEBUG
BUILD := release
include ../../../common/unix-release.mk
include build.mk

View File

@ -1,25 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30907.101
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "csvexport", "csvexport.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,210 +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|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|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</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|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 />
<PropertyGroup Label="Vcpkg">
<VcpkgEnableManifest>true</VcpkgEnableManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<ConformanceMode>true</ConformanceMode>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<PreprocessorDefinitions>_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>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include;$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include\capstone;$(VcpkgManifestRoot)\vcpkg_installed\$(VcpkgTriplet)\$(VcpkgTriplet)\include\capstone;$(VcpkgRoot)\installed\$(VcpkgTriplet)\include\capstone</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\debug\lib</AdditionalLibraryDirectories>
</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>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>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include;$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\include\capstone;$(VcpkgManifestRoot)\vcpkg_installed\$(VcpkgTriplet)\$(VcpkgTriplet)\include\capstone;$(VcpkgRoot)\installed\$(VcpkgTriplet)\include\capstone</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>ws2_32.lib;capstone.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(ProjectDir)..\..\..\vcpkg_installed\$(VcpkgTriplet)\lib</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\getopt\getopt.c" />
<ClCompile Include="..\..\..\public\common\TracySocket.cpp" />
<ClCompile Include="..\..\..\public\common\TracyStackFrames.cpp" />
<ClCompile Include="..\..\..\public\common\TracySystem.cpp" />
<ClCompile Include="..\..\..\public\common\tracy_lz4.cpp" />
<ClCompile Include="..\..\..\public\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\common\debug.c" />
<ClCompile Include="..\..\..\zstd\common\entropy_common.c" />
<ClCompile Include="..\..\..\zstd\common\error_private.c" />
<ClCompile Include="..\..\..\zstd\common\fse_decompress.c" />
<ClCompile Include="..\..\..\zstd\common\pool.c" />
<ClCompile Include="..\..\..\zstd\common\threading.c" />
<ClCompile Include="..\..\..\zstd\common\xxhash.c" />
<ClCompile Include="..\..\..\zstd\common\zstd_common.c" />
<ClCompile Include="..\..\..\zstd\compress\fse_compress.c" />
<ClCompile Include="..\..\..\zstd\compress\hist.c" />
<ClCompile Include="..\..\..\zstd\compress\huf_compress.c" />
<ClCompile Include="..\..\..\zstd\compress\zstdmt_compress.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_compress.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_literals.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_sequences.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_superblock.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_double_fast.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_fast.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_lazy.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_ldm.c" />
<ClCompile Include="..\..\..\zstd\compress\zstd_opt.c" />
<ClCompile Include="..\..\..\zstd\decompress\huf_decompress.c" />
<ClCompile Include="..\..\..\zstd\decompress\zstd_ddict.c" />
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress.c" />
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress_block.c" />
<ClCompile Include="..\..\..\zstd\dictBuilder\cover.c" />
<ClCompile Include="..\..\..\zstd\dictBuilder\divsufsort.c" />
<ClCompile Include="..\..\..\zstd\dictBuilder\fastcover.c" />
<ClCompile Include="..\..\..\zstd\dictBuilder\zdict.c" />
<ClCompile Include="..\..\src\csvexport.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\..\getopt\getopt.h" />
<ClInclude Include="..\..\..\public\common\TracyAlign.hpp" />
<ClInclude Include="..\..\..\public\common\TracyAlloc.hpp" />
<ClInclude Include="..\..\..\public\common\TracyApi.h" />
<ClInclude Include="..\..\..\public\common\TracyColor.hpp" />
<ClInclude Include="..\..\..\public\common\TracyForceInline.hpp" />
<ClInclude Include="..\..\..\public\common\TracyMutex.hpp" />
<ClInclude Include="..\..\..\public\common\TracyProtocol.hpp" />
<ClInclude Include="..\..\..\public\common\TracyQueue.hpp" />
<ClInclude Include="..\..\..\public\common\TracySocket.hpp" />
<ClInclude Include="..\..\..\public\common\TracyStackFrames.hpp" />
<ClInclude Include="..\..\..\public\common\TracySystem.hpp" />
<ClInclude Include="..\..\..\public\common\TracyUwp.hpp" />
<ClInclude Include="..\..\..\public\common\TracyYield.hpp" />
<ClInclude Include="..\..\..\public\common\tracy_lz4.hpp" />
<ClInclude Include="..\..\..\public\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\common\bitstream.h" />
<ClInclude Include="..\..\..\zstd\common\compiler.h" />
<ClInclude Include="..\..\..\zstd\common\cpu.h" />
<ClInclude Include="..\..\..\zstd\common\debug.h" />
<ClInclude Include="..\..\..\zstd\common\error_private.h" />
<ClInclude Include="..\..\..\zstd\common\fse.h" />
<ClInclude Include="..\..\..\zstd\common\huf.h" />
<ClInclude Include="..\..\..\zstd\common\mem.h" />
<ClInclude Include="..\..\..\zstd\common\pool.h" />
<ClInclude Include="..\..\..\zstd\common\portability_macros.h" />
<ClInclude Include="..\..\..\zstd\common\threading.h" />
<ClInclude Include="..\..\..\zstd\common\xxhash.h" />
<ClInclude Include="..\..\..\zstd\common\zstd_deps.h" />
<ClInclude Include="..\..\..\zstd\common\zstd_internal.h" />
<ClInclude Include="..\..\..\zstd\common\zstd_trace.h" />
<ClInclude Include="..\..\..\zstd\compress\clevels.h" />
<ClInclude Include="..\..\..\zstd\compress\hist.h" />
<ClInclude Include="..\..\..\zstd\compress\zstdmt_compress.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_internal.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_literals.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_sequences.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_superblock.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_cwksp.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_double_fast.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_fast.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_lazy.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm_geartab.h" />
<ClInclude Include="..\..\..\zstd\compress\zstd_opt.h" />
<ClInclude Include="..\..\..\zstd\decompress\zstd_ddict.h" />
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_block.h" />
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_internal.h" />
<ClInclude Include="..\..\..\zstd\dictBuilder\cover.h" />
<ClInclude Include="..\..\..\zstd\dictBuilder\divsufsort.h" />
<ClInclude Include="..\..\..\zstd\zdict.h" />
<ClInclude Include="..\..\..\zstd\zstd.h" />
<ClInclude Include="..\..\..\zstd\zstd_errors.h" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\zstd\decompress\huf_decompress_amd64.S" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,371 +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="getopt">
<UniqueIdentifier>{ee9737d2-69c7-44da-b9c7-539d18f9d4b4}</UniqueIdentifier>
</Filter>
<Filter Include="zstd">
<UniqueIdentifier>{44ea1742-0fd9-40ba-879c-031868509600}</UniqueIdentifier>
</Filter>
<Filter Include="zstd\common">
<UniqueIdentifier>{2d065bba-d78e-4e44-87f7-b44cf3248260}</UniqueIdentifier>
</Filter>
<Filter Include="zstd\compress">
<UniqueIdentifier>{a19ca3bc-2a17-49c5-a0d9-5916213de774}</UniqueIdentifier>
</Filter>
<Filter Include="zstd\decompress">
<UniqueIdentifier>{d4181058-2198-4931-ae31-b7eda0312458}</UniqueIdentifier>
</Filter>
<Filter Include="zstd\dictBuilder">
<UniqueIdentifier>{873c22fe-b4d7-480d-ad67-48271296f4c1}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\server\TracyMemory.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyWorker.cpp">
<Filter>server</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="..\..\..\server\TracyMmap.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\server\TracyTextureCompression.cpp">
<Filter>server</Filter>
</ClCompile>
<ClCompile Include="..\..\..\getopt\getopt.c">
<Filter>getopt</Filter>
</ClCompile>
<ClCompile Include="..\..\src\csvexport.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\debug.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\entropy_common.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\error_private.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\fse_decompress.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\pool.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\threading.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\xxhash.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\common\zstd_common.c">
<Filter>zstd\common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\decompress\huf_decompress.c">
<Filter>zstd\decompress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\decompress\zstd_ddict.c">
<Filter>zstd\decompress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress.c">
<Filter>zstd\decompress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\decompress\zstd_decompress_block.c">
<Filter>zstd\decompress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\fse_compress.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\hist.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\huf_compress.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_compress.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_literals.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_sequences.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_compress_superblock.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_double_fast.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_fast.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_lazy.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_ldm.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstd_opt.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\compress\zstdmt_compress.c">
<Filter>zstd\compress</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\dictBuilder\cover.c">
<Filter>zstd\dictBuilder</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\dictBuilder\divsufsort.c">
<Filter>zstd\dictBuilder</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\dictBuilder\fastcover.c">
<Filter>zstd\dictBuilder</Filter>
</ClCompile>
<ClCompile Include="..\..\..\zstd\dictBuilder\zdict.c">
<Filter>zstd\dictBuilder</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\tracy_lz4.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\tracy_lz4hc.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\TracySocket.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\TracyStackFrames.cpp">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="..\..\..\public\common\TracySystem.cpp">
<Filter>common</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<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="..\..\..\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="..\..\..\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>
<ClInclude Include="..\..\..\getopt\getopt.h">
<Filter>getopt</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zstd_errors.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\bitstream.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\compiler.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\cpu.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\debug.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\error_private.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\fse.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\huf.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\mem.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\pool.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\threading.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\xxhash.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\zstd_deps.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\zstd_internal.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\zstd_trace.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\decompress\zstd_ddict.h">
<Filter>zstd\decompress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_block.h">
<Filter>zstd\decompress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\decompress\zstd_decompress_internal.h">
<Filter>zstd\decompress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\hist.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_internal.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_literals.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_sequences.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_compress_superblock.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_cwksp.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_double_fast.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_fast.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_lazy.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_ldm_geartab.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstd_opt.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\zstdmt_compress.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\zdict.h">
<Filter>zstd</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\dictBuilder\cover.h">
<Filter>zstd\dictBuilder</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\dictBuilder\divsufsort.h">
<Filter>zstd\dictBuilder</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\common\portability_macros.h">
<Filter>zstd\common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\zstd\compress\clevels.h">
<Filter>zstd\compress</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\tracy_lz4.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\tracy_lz4hc.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyAlign.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyAlloc.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyApi.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyColor.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyForceInline.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyMutex.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyProtocol.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyQueue.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracySocket.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyStackFrames.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracySystem.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyUwp.hpp">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="..\..\..\public\common\TracyYield.hpp">
<Filter>common</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\..\zstd\decompress\huf_decompress_amd64.S">
<Filter>zstd\decompress</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -28,7 +28,10 @@ void print_usage_exit(int e)
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 zone event\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);
}
@ -40,6 +43,9 @@ struct Args {
bool case_sensitive;
bool self_time;
bool unwrap;
bool show_gpu;
bool unwrapMessages;
bool plot;
};
Args parse_args(int argc, char** argv)
@ -49,7 +55,7 @@ Args parse_args(int argc, char** argv)
print_usage_exit(1);
}
Args args = { "", ",", "", false, false, false };
Args args = { "", ",", "", false, false, false, false, false, false };
struct option long_opts[] = {
{ "help", no_argument, NULL, 'h' },
@ -58,11 +64,14 @@ Args parse_args(int argc, char** argv)
{ "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:ceu", long_opts, NULL)) != -1)
while ((c = getopt_long(argc, argv, "hf:s:ceugmp", long_opts, NULL)) != -1)
{
switch (c)
{
@ -84,6 +93,15 @@ Args parse_args(int argc, char** argv)
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;
@ -198,11 +216,105 @@ int main(int argc, char** argv)
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());
@ -232,7 +344,7 @@ int main(int argc, char** argv)
if (args.unwrap)
{
columns = {
"name", "src_file", "src_line", "ns_since_start", "exec_time_ns"
"name", "src_file", "src_line", "ns_since_start", "exec_time_ns", "thread", "value"
};
}
else
@ -263,6 +375,7 @@ int main(int argc, char** argv)
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();
@ -273,6 +386,13 @@ int main(int argc, char** argv)
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());
@ -299,7 +419,9 @@ int main(int argc, char** argv)
const auto ss = zone_data.sumSq
- 2. * zone_data.total * avg
+ avg * avg * sz;
const auto std = sqrt(ss / (sz - 1));
double std = 0;
if( sz > 1 )
std = sqrt(ss / (sz - 1));
values[9] = std::to_string(std);
std::string row = join(values, args.separator);
@ -307,5 +429,26 @@ int main(int argc, char** argv)
}
}
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: 261 KiB

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 KiB

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

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,9 +1,9 @@
#include <algorithm>
#include <iostream>
#include <cassert>
#include <string>
#include <vector>
#include <numeric>
#include <math.h>
#include <CL/cl.h>

View File

@ -7,6 +7,7 @@
<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>

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)

2
extra/make-build.sh Normal file → Executable file
View File

@ -3,6 +3,8 @@
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

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')

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

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

BIN
extra/zigzag16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

BIN
extra/zigzag32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012-2017, Kim Grasman <kim.grasman@gmail.com>
* Copyright (c) 2012-2023, Kim Grasman <kim.grasman@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -159,6 +159,7 @@ int getopt_long(int argc, char* const argv[], const char* optstring,
const struct option* match = NULL;
int num_matches = 0;
size_t argument_name_length = 0;
size_t option_length = 0;
const char* current_argument = NULL;
int retval = -1;
@ -175,6 +176,16 @@ int getopt_long(int argc, char* const argv[], const char* optstring,
current_argument = argv[optind] + 2;
argument_name_length = strcspn(current_argument, "=");
for (; o->name; ++o) {
/* Check for exact match first. */
option_length = strlen(o->name);
if (option_length == argument_name_length &&
strncmp(o->name, current_argument, option_length) == 0) {
match = o;
num_matches = 1;
break;
}
/* If not exact, count the number of abbreviated matches. */
if (strncmp(o->name, current_argument, argument_name_length) == 0) {
match = o;
++num_matches;

View File

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2012-2017, Kim Grasman <kim.grasman@gmail.com>
* Copyright (c) 2012-2023, Kim Grasman <kim.grasman@gmail.com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without

View File

@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2014-2022 Omar Cornut
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,129 +0,0 @@
//-----------------------------------------------------------------------------
// COMPILE-TIME OPTIONS FOR DEAR IMGUI
// Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure.
// You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions.
//-----------------------------------------------------------------------------
// A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it)
// B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template.
//-----------------------------------------------------------------------------
// You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp
// files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures.
// Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts.
// Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using.
//-----------------------------------------------------------------------------
#pragma once
//---- Define assertion handler. Defaults to calling assert().
// If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement.
//#define IM_ASSERT(_EXPR) MyAssert(_EXPR)
//#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts
//---- Define attributes of all API symbols declarations, e.g. for DLL under Windows
// Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility.
// DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions()
// for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details.
//#define IMGUI_API __declspec( dllexport )
//#define IMGUI_API __declspec( dllimport )
//---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names.
//#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
//#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions.
//---- Disable all of Dear ImGui or don't implement standard windows/tools.
// It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp.
//#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty.
//#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty.
//#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowStackToolWindow() will be empty (this was called IMGUI_DISABLE_METRICS_WINDOW before 1.88).
//---- Don't implement some functions to reduce linkage requirements.
//#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a)
//#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW)
//#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a)
//#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime).
//#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default).
//#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf)
//#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself.
//#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies)
//#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function.
//#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions().
//#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available
//---- Include imgui_user.h at the end of imgui.h as a convenience
//#define IMGUI_INCLUDE_IMGUI_USER_H
//---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another)
//#define IMGUI_USE_BGRA_PACKED_COLOR
//---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...)
//#define IMGUI_USE_WCHAR32
//---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version
// By default the embedded implementations are declared static and not available outside of Dear ImGui sources files.
//#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h"
//#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h"
//#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if enabled
//#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION
//#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
//---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined)
// Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by stb_sprintf.h.
//#define IMGUI_USE_STB_SPRINTF
//---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui)
// Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided).
// On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'.
//#define IMGUI_ENABLE_FREETYPE
//---- Use stb_truetype to build and rasterize the font atlas (default)
// The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend.
//#define IMGUI_ENABLE_STB_TRUETYPE
//---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4.
// This will be inlined as part of ImVec2 and ImVec4 class declarations.
/*
#define IM_VEC2_CLASS_EXTRA \
constexpr ImVec2(const MyVec2& f) : x(f.x), y(f.y) {} \
operator MyVec2() const { return MyVec2(x,y); }
#define IM_VEC4_CLASS_EXTRA \
constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \
operator MyVec4() const { return MyVec4(x,y,z,w); }
*/
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
// Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer.
// 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;
//typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data);
//#define ImDrawCallback MyImDrawCallback
//---- Debug Tools: Macro to break in Debugger
// (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.)
//#define IM_DEBUG_BREAK IM_ASSERT(0)
//#define IM_DEBUG_BREAK __debugbreak()
//---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(),
// (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.)
// This adds a small runtime cost which is why it is not enabled by default.
//#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
//---- Debug Tools: Enable slower asserts
//#define IMGUI_DEBUG_PARANOID
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
/*
namespace ImGui
{
void MyFunction(const char* name, const MyMatrix44& v);
}
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,627 +0,0 @@
// [DEAR IMGUI]
// This is a slightly modified version of stb_rect_pack.h 1.01.
// Grep for [DEAR IMGUI] to find the changes.
//
// stb_rect_pack.h - v1.01 - public domain - rectangle packing
// Sean Barrett 2014
//
// Useful for e.g. packing rectangular textures into an atlas.
// Does not do rotation.
//
// Before #including,
//
// #define STB_RECT_PACK_IMPLEMENTATION
//
// in the file that you want to have the implementation.
//
// Not necessarily the awesomest packing method, but better than
// the totally naive one in stb_truetype (which is primarily what
// this is meant to replace).
//
// Has only had a few tests run, may have issues.
//
// More docs to come.
//
// No memory allocations; uses qsort() and assert() from stdlib.
// Can override those by defining STBRP_SORT and STBRP_ASSERT.
//
// This library currently uses the Skyline Bottom-Left algorithm.
//
// Please note: better rectangle packers are welcome! Please
// implement them to the same API, but with a different init
// function.
//
// Credits
//
// Library
// Sean Barrett
// Minor features
// Martins Mozeiko
// github:IntellectualKitty
//
// Bugfixes / warning fixes
// Jeremy Jaussaud
// Fabian Giesen
//
// Version history:
//
// 1.01 (2021-07-11) always use large rect mode, expose STBRP__MAXVAL in public section
// 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles
// 0.99 (2019-02-07) warning fixes
// 0.11 (2017-03-03) return packing success/fail result
// 0.10 (2016-10-25) remove cast-away-const to avoid warnings
// 0.09 (2016-08-27) fix compiler warnings
// 0.08 (2015-09-13) really fix bug with empty rects (w=0 or h=0)
// 0.07 (2015-09-13) fix bug with empty rects (w=0 or h=0)
// 0.06 (2015-04-15) added STBRP_SORT to allow replacing qsort
// 0.05: added STBRP_ASSERT to allow replacing assert
// 0.04: fixed minor bug in STBRP_LARGE_RECTS support
// 0.01: initial release
//
// LICENSE
//
// See end of file for license information.
//////////////////////////////////////////////////////////////////////////////
//
// INCLUDE SECTION
//
#ifndef STB_INCLUDE_STB_RECT_PACK_H
#define STB_INCLUDE_STB_RECT_PACK_H
#define STB_RECT_PACK_VERSION 1
#ifdef STBRP_STATIC
#define STBRP_DEF static
#else
#define STBRP_DEF extern
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct stbrp_context stbrp_context;
typedef struct stbrp_node stbrp_node;
typedef struct stbrp_rect stbrp_rect;
typedef int stbrp_coord;
#define STBRP__MAXVAL 0x7fffffff
// Mostly for internal use, but this is the maximum supported coordinate value.
STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
// Assign packed locations to rectangles. The rectangles are of type
// 'stbrp_rect' defined below, stored in the array 'rects', and there
// are 'num_rects' many of them.
//
// Rectangles which are successfully packed have the 'was_packed' flag
// set to a non-zero value and 'x' and 'y' store the minimum location
// on each axis (i.e. bottom-left in cartesian coordinates, top-left
// if you imagine y increasing downwards). Rectangles which do not fit
// have the 'was_packed' flag set to 0.
//
// You should not try to access the 'rects' array from another thread
// while this function is running, as the function temporarily reorders
// the array while it executes.
//
// To pack into another rectangle, you need to call stbrp_init_target
// again. To continue packing into the same rectangle, you can call
// this function again. Calling this multiple times with multiple rect
// arrays will probably produce worse packing results than calling it
// a single time with the full rectangle array, but the option is
// available.
//
// The function returns 1 if all of the rectangles were successfully
// packed and 0 otherwise.
struct stbrp_rect
{
// reserved for your use:
int id;
// input:
stbrp_coord w, h;
// output:
stbrp_coord x, y;
int was_packed; // non-zero if valid packing
}; // 16 bytes, nominally
STBRP_DEF void stbrp_init_target (stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes);
// Initialize a rectangle packer to:
// pack a rectangle that is 'width' by 'height' in dimensions
// using temporary storage provided by the array 'nodes', which is 'num_nodes' long
//
// You must call this function every time you start packing into a new target.
//
// There is no "shutdown" function. The 'nodes' memory must stay valid for
// the following stbrp_pack_rects() call (or calls), but can be freed after
// the call (or calls) finish.
//
// Note: to guarantee best results, either:
// 1. make sure 'num_nodes' >= 'width'
// or 2. call stbrp_allow_out_of_mem() defined below with 'allow_out_of_mem = 1'
//
// If you don't do either of the above things, widths will be quantized to multiples
// of small integers to guarantee the algorithm doesn't run out of temporary storage.
//
// If you do #2, then the non-quantized algorithm will be used, but the algorithm
// may run out of temporary storage and be unable to pack some rectangles.
STBRP_DEF void stbrp_setup_allow_out_of_mem (stbrp_context *context, int allow_out_of_mem);
// Optionally call this function after init but before doing any packing to
// change the handling of the out-of-temp-memory scenario, described above.
// If you call init again, this will be reset to the default (false).
STBRP_DEF void stbrp_setup_heuristic (stbrp_context *context, int heuristic);
// Optionally select which packing heuristic the library should use. Different
// heuristics will produce better/worse results for different data sets.
// If you call init again, this will be reset to the default.
enum
{
STBRP_HEURISTIC_Skyline_default=0,
STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default,
STBRP_HEURISTIC_Skyline_BF_sortHeight
};
//////////////////////////////////////////////////////////////////////////////
//
// the details of the following structures don't matter to you, but they must
// be visible so you can handle the memory allocations for them
struct stbrp_node
{
stbrp_coord x,y;
stbrp_node *next;
};
struct stbrp_context
{
int width;
int height;
int align;
int init_mode;
int heuristic;
int num_nodes;
stbrp_node *active_head;
stbrp_node *free_head;
stbrp_node extra[2]; // we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2'
};
#ifdef __cplusplus
}
#endif
#endif
//////////////////////////////////////////////////////////////////////////////
//
// IMPLEMENTATION SECTION
//
#ifdef STB_RECT_PACK_IMPLEMENTATION
#ifndef STBRP_SORT
#include <stdlib.h>
#define STBRP_SORT qsort
#endif
#ifndef STBRP_ASSERT
#include <assert.h>
#define STBRP_ASSERT assert
#endif
#ifdef _MSC_VER
#define STBRP__NOTUSED(v) (void)(v)
#define STBRP__CDECL __cdecl
#else
#define STBRP__NOTUSED(v) (void)sizeof(v)
#define STBRP__CDECL
#endif
enum
{
STBRP__INIT_skyline = 1
};
STBRP_DEF void stbrp_setup_heuristic(stbrp_context *context, int heuristic)
{
switch (context->init_mode) {
case STBRP__INIT_skyline:
STBRP_ASSERT(heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight || heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight);
context->heuristic = heuristic;
break;
default:
STBRP_ASSERT(0);
}
}
STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_out_of_mem)
{
if (allow_out_of_mem)
// if it's ok to run out of memory, then don't bother aligning them;
// this gives better packing, but may fail due to OOM (even though
// the rectangles easily fit). @TODO a smarter approach would be to only
// quantize once we've hit OOM, then we could get rid of this parameter.
context->align = 1;
else {
// if it's not ok to run out of memory, then quantize the widths
// so that num_nodes is always enough nodes.
//
// I.e. num_nodes * align >= width
// align >= width / num_nodes
// align = ceil(width/num_nodes)
context->align = (context->width + context->num_nodes-1) / context->num_nodes;
}
}
STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
{
int i;
for (i=0; i < num_nodes-1; ++i)
nodes[i].next = &nodes[i+1];
nodes[i].next = NULL;
context->init_mode = STBRP__INIT_skyline;
context->heuristic = STBRP_HEURISTIC_Skyline_default;
context->free_head = &nodes[0];
context->active_head = &context->extra[0];
context->width = width;
context->height = height;
context->num_nodes = num_nodes;
stbrp_setup_allow_out_of_mem(context, 0);
// node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly)
context->extra[0].x = 0;
context->extra[0].y = 0;
context->extra[0].next = &context->extra[1];
context->extra[1].x = (stbrp_coord) width;
context->extra[1].y = (1<<30);
context->extra[1].next = NULL;
}
// find minimum y position if it starts at x1
static int stbrp__skyline_find_min_y(stbrp_context *c, stbrp_node *first, int x0, int width, int *pwaste)
{
stbrp_node *node = first;
int x1 = x0 + width;
int min_y, visited_width, waste_area;
STBRP__NOTUSED(c);
STBRP_ASSERT(first->x <= x0);
#if 0
// skip in case we're past the node
while (node->next->x <= x0)
++node;
#else
STBRP_ASSERT(node->next->x > x0); // we ended up handling this in the caller for efficiency
#endif
STBRP_ASSERT(node->x <= x0);
min_y = 0;
waste_area = 0;
visited_width = 0;
while (node->x < x1) {
if (node->y > min_y) {
// raise min_y higher.
// we've accounted for all waste up to min_y,
// but we'll now add more waste for everything we've visted
waste_area += visited_width * (node->y - min_y);
min_y = node->y;
// the first time through, visited_width might be reduced
if (node->x < x0)
visited_width += node->next->x - x0;
else
visited_width += node->next->x - node->x;
} else {
// add waste area
int under_width = node->next->x - node->x;
if (under_width + visited_width > width)
under_width = width - visited_width;
waste_area += under_width * (min_y - node->y);
visited_width += under_width;
}
node = node->next;
}
*pwaste = waste_area;
return min_y;
}
typedef struct
{
int x,y;
stbrp_node **prev_link;
} stbrp__findresult;
static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int width, int height)
{
int best_waste = (1<<30), best_x, best_y = (1 << 30);
stbrp__findresult fr;
stbrp_node **prev, *node, *tail, **best = NULL;
// align to multiple of c->align
width = (width + c->align - 1);
width -= width % c->align;
STBRP_ASSERT(width % c->align == 0);
// if it can't possibly fit, bail immediately
if (width > c->width || height > c->height) {
fr.prev_link = NULL;
fr.x = fr.y = 0;
return fr;
}
node = c->active_head;
prev = &c->active_head;
while (node->x + width <= c->width) {
int y,waste;
y = stbrp__skyline_find_min_y(c, node, node->x, width, &waste);
if (c->heuristic == STBRP_HEURISTIC_Skyline_BL_sortHeight) { // actually just want to test BL
// bottom left
if (y < best_y) {
best_y = y;
best = prev;
}
} else {
// best-fit
if (y + height <= c->height) {
// can only use it if it first vertically
if (y < best_y || (y == best_y && waste < best_waste)) {
best_y = y;
best_waste = waste;
best = prev;
}
}
}
prev = &node->next;
node = node->next;
}
best_x = (best == NULL) ? 0 : (*best)->x;
// if doing best-fit (BF), we also have to try aligning right edge to each node position
//
// e.g, if fitting
//
// ____________________
// |____________________|
//
// into
//
// | |
// | ____________|
// |____________|
//
// then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned
//
// This makes BF take about 2x the time
if (c->heuristic == STBRP_HEURISTIC_Skyline_BF_sortHeight) {
tail = c->active_head;
node = c->active_head;
prev = &c->active_head;
// find first node that's admissible
while (tail->x < width)
tail = tail->next;
while (tail) {
int xpos = tail->x - width;
int y,waste;
STBRP_ASSERT(xpos >= 0);
// find the left position that matches this
while (node->next->x <= xpos) {
prev = &node->next;
node = node->next;
}
STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);
y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);
if (y + height <= c->height) {
if (y <= best_y) {
if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
best_x = xpos;
//STBRP_ASSERT(y <= best_y); [DEAR IMGUI]
best_y = y;
best_waste = waste;
best = prev;
}
}
}
tail = tail->next;
}
}
fr.prev_link = best;
fr.x = best_x;
fr.y = best_y;
return fr;
}
static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, int width, int height)
{
// find best position according to heuristic
stbrp__findresult res = stbrp__skyline_find_best_pos(context, width, height);
stbrp_node *node, *cur;
// bail if:
// 1. it failed
// 2. the best node doesn't fit (we don't always check this)
// 3. we're out of memory
if (res.prev_link == NULL || res.y + height > context->height || context->free_head == NULL) {
res.prev_link = NULL;
return res;
}
// on success, create new node
node = context->free_head;
node->x = (stbrp_coord) res.x;
node->y = (stbrp_coord) (res.y + height);
context->free_head = node->next;
// insert the new node into the right starting point, and
// let 'cur' point to the remaining nodes needing to be
// stiched back in
cur = *res.prev_link;
if (cur->x < res.x) {
// preserve the existing one, so start testing with the next one
stbrp_node *next = cur->next;
cur->next = node;
cur = next;
} else {
*res.prev_link = node;
}
// from here, traverse cur and free the nodes, until we get to one
// that shouldn't be freed
while (cur->next && cur->next->x <= res.x + width) {
stbrp_node *next = cur->next;
// move the current node to the free list
cur->next = context->free_head;
context->free_head = cur;
cur = next;
}
// stitch the list back in
node->next = cur;
if (cur->x < res.x + width)
cur->x = (stbrp_coord) (res.x + width);
#ifdef _DEBUG
cur = context->active_head;
while (cur->x < context->width) {
STBRP_ASSERT(cur->x < cur->next->x);
cur = cur->next;
}
STBRP_ASSERT(cur->next == NULL);
{
int count=0;
cur = context->active_head;
while (cur) {
cur = cur->next;
++count;
}
cur = context->free_head;
while (cur) {
cur = cur->next;
++count;
}
STBRP_ASSERT(count == context->num_nodes+2);
}
#endif
return res;
}
static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
if (p->h > q->h)
return -1;
if (p->h < q->h)
return 1;
return (p->w > q->w) ? -1 : (p->w < q->w);
}
static int STBRP__CDECL rect_original_order(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
}
STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
{
int i, all_rects_packed = 1;
// we use the 'was_packed' field internally to allow sorting/unsorting
for (i=0; i < num_rects; ++i) {
rects[i].was_packed = i;
}
// sort according to heuristic
STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_height_compare);
for (i=0; i < num_rects; ++i) {
if (rects[i].w == 0 || rects[i].h == 0) {
rects[i].x = rects[i].y = 0; // empty rect needs no space
} else {
stbrp__findresult fr = stbrp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
if (fr.prev_link) {
rects[i].x = (stbrp_coord) fr.x;
rects[i].y = (stbrp_coord) fr.y;
} else {
rects[i].x = rects[i].y = STBRP__MAXVAL;
}
}
}
// unsort
STBRP_SORT(rects, num_rects, sizeof(rects[0]), rect_original_order);
// set was_packed flags and all_rects_packed status
for (i=0; i < num_rects; ++i) {
rects[i].was_packed = !(rects[i].x == STBRP__MAXVAL && rects[i].y == STBRP__MAXVAL);
if (!rects[i].was_packed)
all_rects_packed = 0;
}
// return the all_rects_packed status
return all_rects_packed;
}
#endif
/*
------------------------------------------------------------------------------
This software is available under 2 licenses -- choose whichever you prefer.
------------------------------------------------------------------------------
ALTERNATIVE A - MIT License
Copyright (c) 2017 Sean Barrett
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
ALTERNATIVE B - Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,37 +0,0 @@
# imgui_freetype
Build font atlases using FreeType instead of stb_truetype (which is the default font rasterizer).
<br>by @vuhdo, @mikesart, @ocornut.
### Usage
1. Get latest FreeType binaries or build yourself (under Windows you may use vcpkg with `vcpkg install freetype --triplet=x64-windows`, `vcpkg integrate install`).
2. Add imgui_freetype.h/cpp alongside your project files.
3. Add `#define IMGUI_ENABLE_FREETYPE` in your [imconfig.h](https://github.com/ocornut/imgui/blob/master/imconfig.h) file
### About Gamma Correct Blending
FreeType assumes blending in linear space rather than gamma space.
See FreeType note for [FT_Render_Glyph](https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Render_Glyph).
For correct results you need to be using sRGB and convert to linear space in the pixel shader output.
The default Dear ImGui styles will be impacted by this change (alpha values will need tweaking).
### Testbed for toying with settings (for developers)
See https://gist.github.com/ocornut/b3a9ecf13502fd818799a452969649ad
### Known issues
- Oversampling settins are ignored but also not so much necessary with the higher quality rendering.
### Comparaison
Small, thin anti-aliased fonts typically benefit a lot from FreeType's hinting:
![comparing_font_rasterizers](https://user-images.githubusercontent.com/8225057/107550178-fef87f00-6bd0-11eb-8d09-e2edb2f0ccfc.gif)
### Colorful glyphs/emojis
You can use the `ImGuiFreeTypeBuilderFlags_LoadColor` flag to load certain colorful glyphs. See the
["Using Colorful Glyphs/Emojis"](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#using-colorful-glyphsemojis) section of FONTS.md.
![colored glyphs](https://user-images.githubusercontent.com/8225057/106171241-9dc4ba80-6191-11eb-8a69-ca1467b206d1.png)

View File

@ -1,780 +0,0 @@
// dear imgui: FreeType font builder (used as a replacement for the stb_truetype builder)
// (code)
// Get the latest version at https://github.com/ocornut/imgui/tree/master/misc/freetype
// Original code by @vuhdo (Aleksei Skriabin). Improvements by @mikesart. Maintained since 2019 by @ocornut.
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2021/08/23: fixed crash when FT_Render_Glyph() fails to render a glyph and returns NULL.
// 2021/03/05: added ImGuiFreeTypeBuilderFlags_Bitmap to load bitmap glyphs.
// 2021/03/02: set 'atlas->TexPixelsUseColors = true' to help some backends with deciding of a prefered texture format.
// 2021/01/28: added support for color-layered glyphs via ImGuiFreeTypeBuilderFlags_LoadColor (require Freetype 2.10+).
// 2021/01/26: simplified integration by using '#define IMGUI_ENABLE_FREETYPE'.
// renamed ImGuiFreeType::XXX flags to ImGuiFreeTypeBuilderFlags_XXX for consistency with other API. removed ImGuiFreeType::BuildFontAtlas().
// 2020/06/04: fix for rare case where FT_Get_Char_Index() succeed but FT_Load_Glyph() fails.
// 2019/02/09: added RasterizerFlags::Monochrome flag to disable font anti-aliasing (combine with ::MonoHinting for best results!)
// 2019/01/15: added support for imgui allocators + added FreeType only override function SetAllocatorFunctions().
// 2019/01/10: re-factored to match big update in STB builder. fixed texture height waste. fixed redundant glyphs when merging. support for glyph padding.
// 2018/06/08: added support for ImFontConfig::GlyphMinAdvanceX, GlyphMaxAdvanceX.
// 2018/02/04: moved to main imgui repository (away from http://www.github.com/ocornut/imgui_club)
// 2018/01/22: fix for addition of ImFontAtlas::TexUvscale member.
// 2017/10/22: minor inconsequential change to match change in master (removed an unnecessary statement).
// 2017/09/26: fixes for imgui internal changes.
// 2017/08/26: cleanup, optimizations, support for ImFontConfig::RasterizerFlags, ImFontConfig::RasterizerMultiply.
// 2017/08/16: imported from https://github.com/Vuhdo/imgui_freetype into http://www.github.com/ocornut/imgui_club, updated for latest changes in ImFontAtlas, minor tweaks.
// About Gamma Correct Blending:
// - FreeType assumes blending in linear space rather than gamma space.
// - See https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Render_Glyph
// - For correct results you need to be using sRGB and convert to linear space in the pixel shader output.
// - The default dear imgui styles will be impacted by this change (alpha values will need tweaking).
// FIXME: cfg.OversampleH, OversampleV are not supported (but perhaps not so necessary with this rasterizer).
#include "imgui_freetype.h"
#include "imgui_internal.h" // ImMin,ImMax,ImFontAtlasBuild*,
#include <stdint.h>
#include <ft2build.h>
#include FT_FREETYPE_H // <freetype/freetype.h>
#include FT_MODULE_H // <freetype/ftmodapi.h>
#include FT_GLYPH_H // <freetype/ftglyph.h>
#include FT_SYNTHESIS_H // <freetype/ftsynth.h>
#ifdef _MSC_VER
#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
#endif
#if defined(__GNUC__)
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
#endif
//-------------------------------------------------------------------------
// Data
//-------------------------------------------------------------------------
// Default memory allocators
static void* ImGuiFreeTypeDefaultAllocFunc(size_t size, void* user_data) { IM_UNUSED(user_data); return IM_ALLOC(size); }
static void ImGuiFreeTypeDefaultFreeFunc(void* ptr, void* user_data) { IM_UNUSED(user_data); IM_FREE(ptr); }
// Current memory allocators
static void* (*GImGuiFreeTypeAllocFunc)(size_t size, void* user_data) = ImGuiFreeTypeDefaultAllocFunc;
static void (*GImGuiFreeTypeFreeFunc)(void* ptr, void* user_data) = ImGuiFreeTypeDefaultFreeFunc;
static void* GImGuiFreeTypeAllocatorUserData = NULL;
//-------------------------------------------------------------------------
// Code
//-------------------------------------------------------------------------
namespace
{
// Glyph metrics:
// --------------
//
// xmin xmax
// | |
// |<-------- width -------->|
// | |
// | +-------------------------+----------------- ymax
// | | ggggggggg ggggg | ^ ^
// | | g:::::::::ggg::::g | | |
// | | g:::::::::::::::::g | | |
// | | g::::::ggggg::::::gg | | |
// | | g:::::g g:::::g | | |
// offsetX -|-------->| g:::::g g:::::g | offsetY |
// | | g:::::g g:::::g | | |
// | | g::::::g g:::::g | | |
// | | g:::::::ggggg:::::g | | |
// | | g::::::::::::::::g | | height
// | | gg::::::::::::::g | | |
// baseline ---*---------|---- gggggggg::::::g-----*-------- |
// / | | g:::::g | |
// origin | | gggggg g:::::g | |
// | | g:::::gg gg:::::g | |
// | | g::::::ggg:::::::g | |
// | | gg:::::::::::::g | |
// | | ggg::::::ggg | |
// | | gggggg | v
// | +-------------------------+----------------- ymin
// | |
// |------------- advanceX ----------->|
// A structure that describe a glyph.
struct GlyphInfo
{
int Width; // Glyph's width in pixels.
int Height; // Glyph's height in pixels.
FT_Int OffsetX; // The distance from the origin ("pen position") to the left of the glyph.
FT_Int OffsetY; // The distance from the origin to the top of the glyph. This is usually a value < 0.
float AdvanceX; // The distance from the origin to the origin of the next glyph. This is usually a value > 0.
bool IsColored; // The glyph is colored
};
// Font parameters and metrics.
struct FontInfo
{
uint32_t PixelHeight; // Size this font was generated with.
float Ascender; // The pixel extents above the baseline in pixels (typically positive).
float Descender; // The extents below the baseline in pixels (typically negative).
float LineSpacing; // The baseline-to-baseline distance. Note that it usually is larger than the sum of the ascender and descender taken as absolute values. There is also no guarantee that no glyphs extend above or below subsequent baselines when using this distance. Think of it as a value the designer of the font finds appropriate.
float LineGap; // The spacing in pixels between one row's descent and the next row's ascent.
float MaxAdvanceWidth; // This field gives the maximum horizontal cursor advance for all glyphs in the font.
};
// FreeType glyph rasterizer.
// NB: No ctor/dtor, explicitly call Init()/Shutdown()
struct FreeTypeFont
{
bool InitFont(FT_Library ft_library, const ImFontConfig& cfg, unsigned int extra_user_flags); // Initialize from an external data buffer. Doesn't copy data, and you must ensure it stays valid up to this object lifetime.
void CloseFont();
void SetPixelHeight(int pixel_height); // Change font pixel size. All following calls to RasterizeGlyph() will use this size
const FT_Glyph_Metrics* LoadGlyph(uint32_t in_codepoint);
const FT_Bitmap* RenderGlyphAndGetInfo(GlyphInfo* out_glyph_info);
void BlitGlyph(const FT_Bitmap* ft_bitmap, uint32_t* dst, uint32_t dst_pitch, unsigned char* multiply_table = NULL);
~FreeTypeFont() { CloseFont(); }
// [Internals]
FontInfo Info; // Font descriptor of the current font.
FT_Face Face;
unsigned int UserFlags; // = ImFontConfig::RasterizerFlags
FT_Int32 LoadFlags;
FT_Render_Mode RenderMode;
};
// From SDL_ttf: Handy routines for converting from fixed point
#define FT_CEIL(X) (((X + 63) & -64) / 64)
bool FreeTypeFont::InitFont(FT_Library ft_library, const ImFontConfig& cfg, unsigned int extra_font_builder_flags)
{
FT_Error error = FT_New_Memory_Face(ft_library, (uint8_t*)cfg.FontData, (uint32_t)cfg.FontDataSize, (uint32_t)cfg.FontNo, &Face);
if (error != 0)
return false;
error = FT_Select_Charmap(Face, FT_ENCODING_UNICODE);
if (error != 0)
return false;
// Convert to FreeType flags (NB: Bold and Oblique are processed separately)
UserFlags = cfg.FontBuilderFlags | extra_font_builder_flags;
LoadFlags = 0;
if ((UserFlags & ImGuiFreeTypeBuilderFlags_Bitmap) == 0)
LoadFlags |= FT_LOAD_NO_BITMAP;
if (UserFlags & ImGuiFreeTypeBuilderFlags_NoHinting)
LoadFlags |= FT_LOAD_NO_HINTING;
if (UserFlags & ImGuiFreeTypeBuilderFlags_NoAutoHint)
LoadFlags |= FT_LOAD_NO_AUTOHINT;
if (UserFlags & ImGuiFreeTypeBuilderFlags_ForceAutoHint)
LoadFlags |= FT_LOAD_FORCE_AUTOHINT;
if (UserFlags & ImGuiFreeTypeBuilderFlags_LightHinting)
LoadFlags |= FT_LOAD_TARGET_LIGHT;
else if (UserFlags & ImGuiFreeTypeBuilderFlags_MonoHinting)
LoadFlags |= FT_LOAD_TARGET_MONO;
else
LoadFlags |= FT_LOAD_TARGET_NORMAL;
if (UserFlags & ImGuiFreeTypeBuilderFlags_Monochrome)
RenderMode = FT_RENDER_MODE_MONO;
else
RenderMode = FT_RENDER_MODE_NORMAL;
if (UserFlags & ImGuiFreeTypeBuilderFlags_LoadColor)
LoadFlags |= FT_LOAD_COLOR;
memset(&Info, 0, sizeof(Info));
SetPixelHeight((uint32_t)cfg.SizePixels);
return true;
}
void FreeTypeFont::CloseFont()
{
if (Face)
{
FT_Done_Face(Face);
Face = NULL;
}
}
void FreeTypeFont::SetPixelHeight(int pixel_height)
{
// Vuhdo: I'm not sure how to deal with font sizes properly. As far as I understand, currently ImGui assumes that the 'pixel_height'
// is a maximum height of an any given glyph, i.e. it's the sum of font's ascender and descender. Seems strange to me.
// NB: FT_Set_Pixel_Sizes() doesn't seem to get us the same result.
FT_Size_RequestRec req;
req.type = (UserFlags & ImGuiFreeTypeBuilderFlags_Bitmap) ? FT_SIZE_REQUEST_TYPE_NOMINAL : FT_SIZE_REQUEST_TYPE_REAL_DIM;
req.width = 0;
req.height = (uint32_t)pixel_height * 64;
req.horiResolution = 0;
req.vertResolution = 0;
FT_Request_Size(Face, &req);
// Update font info
FT_Size_Metrics metrics = Face->size->metrics;
Info.PixelHeight = (uint32_t)pixel_height;
Info.Ascender = (float)FT_CEIL(metrics.ascender);
Info.Descender = (float)FT_CEIL(metrics.descender);
Info.LineSpacing = (float)FT_CEIL(metrics.height);
Info.LineGap = (float)FT_CEIL(metrics.height - metrics.ascender + metrics.descender);
Info.MaxAdvanceWidth = (float)FT_CEIL(metrics.max_advance);
}
const FT_Glyph_Metrics* FreeTypeFont::LoadGlyph(uint32_t codepoint)
{
uint32_t glyph_index = FT_Get_Char_Index(Face, codepoint);
if (glyph_index == 0)
return NULL;
// If this crash for you: FreeType 2.11.0 has a crash bug on some bitmap/colored fonts.
// - https://gitlab.freedesktop.org/freetype/freetype/-/issues/1076
// - https://github.com/ocornut/imgui/issues/4567
// - https://github.com/ocornut/imgui/issues/4566
// You can use FreeType 2.10, or the patched version of 2.11.0 in VcPkg, or probably any upcoming FreeType version.
FT_Error error = FT_Load_Glyph(Face, glyph_index, LoadFlags);
if (error)
return NULL;
// Need an outline for this to work
FT_GlyphSlot slot = Face->glyph;
IM_ASSERT(slot->format == FT_GLYPH_FORMAT_OUTLINE || slot->format == FT_GLYPH_FORMAT_BITMAP);
// Apply convenience transform (this is not picking from real "Bold"/"Italic" fonts! Merely applying FreeType helper transform. Oblique == Slanting)
if (UserFlags & ImGuiFreeTypeBuilderFlags_Bold)
FT_GlyphSlot_Embolden(slot);
if (UserFlags & ImGuiFreeTypeBuilderFlags_Oblique)
{
FT_GlyphSlot_Oblique(slot);
//FT_BBox bbox;
//FT_Outline_Get_BBox(&slot->outline, &bbox);
//slot->metrics.width = bbox.xMax - bbox.xMin;
//slot->metrics.height = bbox.yMax - bbox.yMin;
}
return &slot->metrics;
}
const FT_Bitmap* FreeTypeFont::RenderGlyphAndGetInfo(GlyphInfo* out_glyph_info)
{
FT_GlyphSlot slot = Face->glyph;
FT_Error error = FT_Render_Glyph(slot, RenderMode);
if (error != 0)
return NULL;
FT_Bitmap* ft_bitmap = &Face->glyph->bitmap;
out_glyph_info->Width = (int)ft_bitmap->width;
out_glyph_info->Height = (int)ft_bitmap->rows;
out_glyph_info->OffsetX = Face->glyph->bitmap_left;
out_glyph_info->OffsetY = -Face->glyph->bitmap_top;
out_glyph_info->AdvanceX = (float)FT_CEIL(slot->advance.x);
out_glyph_info->IsColored = (ft_bitmap->pixel_mode == FT_PIXEL_MODE_BGRA);
return ft_bitmap;
}
void FreeTypeFont::BlitGlyph(const FT_Bitmap* ft_bitmap, uint32_t* dst, uint32_t dst_pitch, unsigned char* multiply_table)
{
IM_ASSERT(ft_bitmap != NULL);
const uint32_t w = ft_bitmap->width;
const uint32_t h = ft_bitmap->rows;
const uint8_t* src = ft_bitmap->buffer;
const uint32_t src_pitch = ft_bitmap->pitch;
switch (ft_bitmap->pixel_mode)
{
case FT_PIXEL_MODE_GRAY: // Grayscale image, 1 byte per pixel.
{
if (multiply_table == NULL)
{
for (uint32_t y = 0; y < h; y++, src += src_pitch, dst += dst_pitch)
for (uint32_t x = 0; x < w; x++)
dst[x] = IM_COL32(255, 255, 255, src[x]);
}
else
{
for (uint32_t y = 0; y < h; y++, src += src_pitch, dst += dst_pitch)
for (uint32_t x = 0; x < w; x++)
dst[x] = IM_COL32(255, 255, 255, multiply_table[src[x]]);
}
break;
}
case FT_PIXEL_MODE_MONO: // Monochrome image, 1 bit per pixel. The bits in each byte are ordered from MSB to LSB.
{
uint8_t color0 = multiply_table ? multiply_table[0] : 0;
uint8_t color1 = multiply_table ? multiply_table[255] : 255;
for (uint32_t y = 0; y < h; y++, src += src_pitch, dst += dst_pitch)
{
uint8_t bits = 0;
const uint8_t* bits_ptr = src;
for (uint32_t x = 0; x < w; x++, bits <<= 1)
{
if ((x & 7) == 0)
bits = *bits_ptr++;
dst[x] = IM_COL32(255, 255, 255, (bits & 0x80) ? color1 : color0);
}
}
break;
}
case FT_PIXEL_MODE_BGRA:
{
// FIXME: Converting pre-multiplied alpha to straight. Doesn't smell good.
#define DE_MULTIPLY(color, alpha) (ImU32)(255.0f * (float)color / (float)alpha + 0.5f)
if (multiply_table == NULL)
{
for (uint32_t y = 0; y < h; y++, src += src_pitch, dst += dst_pitch)
for (uint32_t x = 0; x < w; x++)
{
uint8_t r = src[x * 4 + 2], g = src[x * 4 + 1], b = src[x * 4], a = src[x * 4 + 3];
dst[x] = IM_COL32(DE_MULTIPLY(r, a), DE_MULTIPLY(g, a), DE_MULTIPLY(b, a), a);
}
}
else
{
for (uint32_t y = 0; y < h; y++, src += src_pitch, dst += dst_pitch)
{
for (uint32_t x = 0; x < w; x++)
{
uint8_t r = src[x * 4 + 2], g = src[x * 4 + 1], b = src[x * 4], a = src[x * 4 + 3];
dst[x] = IM_COL32(multiply_table[DE_MULTIPLY(r, a)], multiply_table[DE_MULTIPLY(g, a)], multiply_table[DE_MULTIPLY(b, a)], multiply_table[a]);
}
}
}
#undef DE_MULTIPLY
break;
}
default:
IM_ASSERT(0 && "FreeTypeFont::BlitGlyph(): Unknown bitmap pixel mode!");
}
}
}
#ifndef STB_RECT_PACK_IMPLEMENTATION // in case the user already have an implementation in the _same_ compilation unit (e.g. unity builds)
#ifndef IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION
#define STBRP_ASSERT(x) do { IM_ASSERT(x); } while (0)
#define STBRP_STATIC
#define STB_RECT_PACK_IMPLEMENTATION
#endif
#ifdef IMGUI_STB_RECT_PACK_FILENAME
#include IMGUI_STB_RECT_PACK_FILENAME
#else
#include "imstb_rectpack.h"
#endif
#endif
struct ImFontBuildSrcGlyphFT
{
GlyphInfo Info;
uint32_t Codepoint;
unsigned int* BitmapData; // Point within one of the dst_tmp_bitmap_buffers[] array
ImFontBuildSrcGlyphFT() { memset((void*)this, 0, sizeof(*this)); }
};
struct ImFontBuildSrcDataFT
{
FreeTypeFont Font;
stbrp_rect* Rects; // Rectangle to pack. We first fill in their size and the packer will give us their position.
const ImWchar* SrcRanges; // Ranges as requested by user (user is allowed to request too much, e.g. 0x0020..0xFFFF)
int DstIndex; // Index into atlas->Fonts[] and dst_tmp_array[]
int GlyphsHighest; // Highest requested codepoint
int GlyphsCount; // Glyph count (excluding missing glyphs and glyphs already set by an earlier source font)
ImBitVector GlyphsSet; // Glyph bit map (random access, 1-bit per codepoint. This will be a maximum of 8KB)
ImVector<ImFontBuildSrcGlyphFT> GlyphsList;
};
// Temporary data for one destination ImFont* (multiple source fonts can be merged into one destination ImFont)
struct ImFontBuildDstDataFT
{
int SrcCount; // Number of source fonts targeting this destination font.
int GlyphsHighest;
int GlyphsCount;
ImBitVector GlyphsSet; // This is used to resolve collision when multiple sources are merged into a same destination font.
};
bool ImFontAtlasBuildWithFreeTypeEx(FT_Library ft_library, ImFontAtlas* atlas, unsigned int extra_flags)
{
IM_ASSERT(atlas->ConfigData.Size > 0);
ImFontAtlasBuildInit(atlas);
// Clear atlas
atlas->TexID = (ImTextureID)NULL;
atlas->TexWidth = atlas->TexHeight = 0;
atlas->TexUvScale = ImVec2(0.0f, 0.0f);
atlas->TexUvWhitePixel = ImVec2(0.0f, 0.0f);
atlas->ClearTexData();
// Temporary storage for building
bool src_load_color = false;
ImVector<ImFontBuildSrcDataFT> src_tmp_array;
ImVector<ImFontBuildDstDataFT> dst_tmp_array;
src_tmp_array.resize(atlas->ConfigData.Size);
dst_tmp_array.resize(atlas->Fonts.Size);
memset((void*)src_tmp_array.Data, 0, (size_t)src_tmp_array.size_in_bytes());
memset((void*)dst_tmp_array.Data, 0, (size_t)dst_tmp_array.size_in_bytes());
// 1. Initialize font loading structure, check font data validity
for (int src_i = 0; src_i < atlas->ConfigData.Size; src_i++)
{
ImFontBuildSrcDataFT& src_tmp = src_tmp_array[src_i];
ImFontConfig& cfg = atlas->ConfigData[src_i];
FreeTypeFont& font_face = src_tmp.Font;
IM_ASSERT(cfg.DstFont && (!cfg.DstFont->IsLoaded() || cfg.DstFont->ContainerAtlas == atlas));
// Find index from cfg.DstFont (we allow the user to set cfg.DstFont. Also it makes casual debugging nicer than when storing indices)
src_tmp.DstIndex = -1;
for (int output_i = 0; output_i < atlas->Fonts.Size && src_tmp.DstIndex == -1; output_i++)
if (cfg.DstFont == atlas->Fonts[output_i])
src_tmp.DstIndex = output_i;
IM_ASSERT(src_tmp.DstIndex != -1); // cfg.DstFont not pointing within atlas->Fonts[] array?
if (src_tmp.DstIndex == -1)
return false;
// Load font
if (!font_face.InitFont(ft_library, cfg, extra_flags))
return false;
// Measure highest codepoints
src_load_color |= (cfg.FontBuilderFlags & ImGuiFreeTypeBuilderFlags_LoadColor) != 0;
ImFontBuildDstDataFT& dst_tmp = dst_tmp_array[src_tmp.DstIndex];
src_tmp.SrcRanges = cfg.GlyphRanges ? cfg.GlyphRanges : atlas->GetGlyphRangesDefault();
for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
src_tmp.GlyphsHighest = ImMax(src_tmp.GlyphsHighest, (int)src_range[1]);
dst_tmp.SrcCount++;
dst_tmp.GlyphsHighest = ImMax(dst_tmp.GlyphsHighest, src_tmp.GlyphsHighest);
}
// 2. For every requested codepoint, check for their presence in the font data, and handle redundancy or overlaps between source fonts to avoid unused glyphs.
int total_glyphs_count = 0;
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
{
ImFontBuildSrcDataFT& src_tmp = src_tmp_array[src_i];
ImFontBuildDstDataFT& dst_tmp = dst_tmp_array[src_tmp.DstIndex];
src_tmp.GlyphsSet.Create(src_tmp.GlyphsHighest + 1);
if (dst_tmp.GlyphsSet.Storage.empty())
dst_tmp.GlyphsSet.Create(dst_tmp.GlyphsHighest + 1);
for (const ImWchar* src_range = src_tmp.SrcRanges; src_range[0] && src_range[1]; src_range += 2)
for (int codepoint = src_range[0]; codepoint <= (int)src_range[1]; codepoint++)
{
if (dst_tmp.GlyphsSet.TestBit(codepoint)) // Don't overwrite existing glyphs. We could make this an option (e.g. MergeOverwrite)
continue;
uint32_t glyph_index = FT_Get_Char_Index(src_tmp.Font.Face, codepoint); // It is actually in the font? (FIXME-OPT: We are not storing the glyph_index..)
if (glyph_index == 0)
continue;
// Add to avail set/counters
src_tmp.GlyphsCount++;
dst_tmp.GlyphsCount++;
src_tmp.GlyphsSet.SetBit(codepoint);
dst_tmp.GlyphsSet.SetBit(codepoint);
total_glyphs_count++;
}
}
// 3. Unpack our bit map into a flat list (we now have all the Unicode points that we know are requested _and_ available _and_ not overlapping another)
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
{
ImFontBuildSrcDataFT& src_tmp = src_tmp_array[src_i];
src_tmp.GlyphsList.reserve(src_tmp.GlyphsCount);
IM_ASSERT(sizeof(src_tmp.GlyphsSet.Storage.Data[0]) == sizeof(ImU32));
const ImU32* it_begin = src_tmp.GlyphsSet.Storage.begin();
const ImU32* it_end = src_tmp.GlyphsSet.Storage.end();
for (const ImU32* it = it_begin; it < it_end; it++)
if (ImU32 entries_32 = *it)
for (ImU32 bit_n = 0; bit_n < 32; bit_n++)
if (entries_32 & ((ImU32)1 << bit_n))
{
ImFontBuildSrcGlyphFT src_glyph;
src_glyph.Codepoint = (ImWchar)(((it - it_begin) << 5) + bit_n);
//src_glyph.GlyphIndex = 0; // FIXME-OPT: We had this info in the previous step and lost it..
src_tmp.GlyphsList.push_back(src_glyph);
}
src_tmp.GlyphsSet.Clear();
IM_ASSERT(src_tmp.GlyphsList.Size == src_tmp.GlyphsCount);
}
for (int dst_i = 0; dst_i < dst_tmp_array.Size; dst_i++)
dst_tmp_array[dst_i].GlyphsSet.Clear();
dst_tmp_array.clear();
// Allocate packing character data and flag packed characters buffer as non-packed (x0=y0=x1=y1=0)
// (We technically don't need to zero-clear buf_rects, but let's do it for the sake of sanity)
ImVector<stbrp_rect> buf_rects;
buf_rects.resize(total_glyphs_count);
memset(buf_rects.Data, 0, (size_t)buf_rects.size_in_bytes());
// Allocate temporary rasterization data buffers.
// We could not find a way to retrieve accurate glyph size without rendering them.
// (e.g. slot->metrics->width not always matching bitmap->width, especially considering the Oblique transform)
// We allocate in chunks of 256 KB to not waste too much extra memory ahead. Hopefully users of FreeType won't mind the temporary allocations.
const int BITMAP_BUFFERS_CHUNK_SIZE = 256 * 1024;
int buf_bitmap_current_used_bytes = 0;
ImVector<unsigned char*> buf_bitmap_buffers;
buf_bitmap_buffers.push_back((unsigned char*)IM_ALLOC(BITMAP_BUFFERS_CHUNK_SIZE));
// 4. Gather glyphs sizes so we can pack them in our virtual canvas.
// 8. Render/rasterize font characters into the texture
int total_surface = 0;
int buf_rects_out_n = 0;
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
{
ImFontBuildSrcDataFT& src_tmp = src_tmp_array[src_i];
ImFontConfig& cfg = atlas->ConfigData[src_i];
if (src_tmp.GlyphsCount == 0)
continue;
src_tmp.Rects = &buf_rects[buf_rects_out_n];
buf_rects_out_n += src_tmp.GlyphsCount;
// Compute multiply table if requested
const bool multiply_enabled = (cfg.RasterizerMultiply != 1.0f);
unsigned char multiply_table[256];
if (multiply_enabled)
ImFontAtlasBuildMultiplyCalcLookupTable(multiply_table, cfg.RasterizerMultiply);
// Gather the sizes of all rectangles we will need to pack
const int padding = atlas->TexGlyphPadding;
for (int glyph_i = 0; glyph_i < src_tmp.GlyphsList.Size; glyph_i++)
{
ImFontBuildSrcGlyphFT& src_glyph = src_tmp.GlyphsList[glyph_i];
const FT_Glyph_Metrics* metrics = src_tmp.Font.LoadGlyph(src_glyph.Codepoint);
if (metrics == NULL)
continue;
// Render glyph into a bitmap (currently held by FreeType)
const FT_Bitmap* ft_bitmap = src_tmp.Font.RenderGlyphAndGetInfo(&src_glyph.Info);
if (ft_bitmap == NULL)
continue;
// Allocate new temporary chunk if needed
const int bitmap_size_in_bytes = src_glyph.Info.Width * src_glyph.Info.Height * 4;
if (buf_bitmap_current_used_bytes + bitmap_size_in_bytes > BITMAP_BUFFERS_CHUNK_SIZE)
{
buf_bitmap_current_used_bytes = 0;
buf_bitmap_buffers.push_back((unsigned char*)IM_ALLOC(BITMAP_BUFFERS_CHUNK_SIZE));
}
IM_ASSERT(buf_bitmap_current_used_bytes + bitmap_size_in_bytes <= BITMAP_BUFFERS_CHUNK_SIZE); // We could probably allocate custom-sized buffer instead.
// Blit rasterized pixels to our temporary buffer and keep a pointer to it.
src_glyph.BitmapData = (unsigned int*)(buf_bitmap_buffers.back() + buf_bitmap_current_used_bytes);
buf_bitmap_current_used_bytes += bitmap_size_in_bytes;
src_tmp.Font.BlitGlyph(ft_bitmap, src_glyph.BitmapData, src_glyph.Info.Width, multiply_enabled ? multiply_table : NULL);
src_tmp.Rects[glyph_i].w = (stbrp_coord)(src_glyph.Info.Width + padding);
src_tmp.Rects[glyph_i].h = (stbrp_coord)(src_glyph.Info.Height + padding);
total_surface += src_tmp.Rects[glyph_i].w * src_tmp.Rects[glyph_i].h;
}
}
// We need a width for the skyline algorithm, any width!
// The exact width doesn't really matter much, but some API/GPU have texture size limitations and increasing width can decrease height.
// User can override TexDesiredWidth and TexGlyphPadding if they wish, otherwise we use a simple heuristic to select the width based on expected surface.
const int surface_sqrt = (int)ImSqrt((float)total_surface) + 1;
atlas->TexHeight = 0;
if (atlas->TexDesiredWidth > 0)
atlas->TexWidth = atlas->TexDesiredWidth;
else
atlas->TexWidth = (surface_sqrt >= 4096 * 0.7f) ? 4096 : (surface_sqrt >= 2048 * 0.7f) ? 2048 : (surface_sqrt >= 1024 * 0.7f) ? 1024 : 512;
// 5. Start packing
// Pack our extra data rectangles first, so it will be on the upper-left corner of our texture (UV will have small values).
const int TEX_HEIGHT_MAX = 1024 * 32;
const int num_nodes_for_packing_algorithm = atlas->TexWidth - atlas->TexGlyphPadding;
ImVector<stbrp_node> pack_nodes;
pack_nodes.resize(num_nodes_for_packing_algorithm);
stbrp_context pack_context;
stbrp_init_target(&pack_context, atlas->TexWidth, TEX_HEIGHT_MAX, pack_nodes.Data, pack_nodes.Size);
ImFontAtlasBuildPackCustomRects(atlas, &pack_context);
// 6. Pack each source font. No rendering yet, we are working with rectangles in an infinitely tall texture at this point.
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
{
ImFontBuildSrcDataFT& src_tmp = src_tmp_array[src_i];
if (src_tmp.GlyphsCount == 0)
continue;
stbrp_pack_rects(&pack_context, src_tmp.Rects, src_tmp.GlyphsCount);
// Extend texture height and mark missing glyphs as non-packed so we won't render them.
// FIXME: We are not handling packing failure here (would happen if we got off TEX_HEIGHT_MAX or if a single if larger than TexWidth?)
for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++)
if (src_tmp.Rects[glyph_i].was_packed)
atlas->TexHeight = ImMax(atlas->TexHeight, src_tmp.Rects[glyph_i].y + src_tmp.Rects[glyph_i].h);
}
// 7. Allocate texture
atlas->TexHeight = (atlas->Flags & ImFontAtlasFlags_NoPowerOfTwoHeight) ? (atlas->TexHeight + 1) : ImUpperPowerOfTwo(atlas->TexHeight);
atlas->TexUvScale = ImVec2(1.0f / atlas->TexWidth, 1.0f / atlas->TexHeight);
if (src_load_color)
{
size_t tex_size = (size_t)atlas->TexWidth * atlas->TexHeight * 4;
atlas->TexPixelsRGBA32 = (unsigned int*)IM_ALLOC(tex_size);
memset(atlas->TexPixelsRGBA32, 0, tex_size);
}
else
{
size_t tex_size = (size_t)atlas->TexWidth * atlas->TexHeight * 1;
atlas->TexPixelsAlpha8 = (unsigned char*)IM_ALLOC(tex_size);
memset(atlas->TexPixelsAlpha8, 0, tex_size);
}
// 8. Copy rasterized font characters back into the main texture
// 9. Setup ImFont and glyphs for runtime
bool tex_use_colors = false;
for (int src_i = 0; src_i < src_tmp_array.Size; src_i++)
{
ImFontBuildSrcDataFT& src_tmp = src_tmp_array[src_i];
if (src_tmp.GlyphsCount == 0)
continue;
// When merging fonts with MergeMode=true:
// - We can have multiple input fonts writing into a same destination font.
// - dst_font->ConfigData is != from cfg which is our source configuration.
ImFontConfig& cfg = atlas->ConfigData[src_i];
ImFont* dst_font = cfg.DstFont;
const float ascent = src_tmp.Font.Info.Ascender;
const float descent = src_tmp.Font.Info.Descender;
ImFontAtlasBuildSetupFont(atlas, dst_font, &cfg, ascent, descent);
const float font_off_x = cfg.GlyphOffset.x;
const float font_off_y = cfg.GlyphOffset.y + IM_ROUND(dst_font->Ascent);
const int padding = atlas->TexGlyphPadding;
for (int glyph_i = 0; glyph_i < src_tmp.GlyphsCount; glyph_i++)
{
ImFontBuildSrcGlyphFT& src_glyph = src_tmp.GlyphsList[glyph_i];
stbrp_rect& pack_rect = src_tmp.Rects[glyph_i];
IM_ASSERT(pack_rect.was_packed);
if (pack_rect.w == 0 && pack_rect.h == 0)
continue;
GlyphInfo& info = src_glyph.Info;
IM_ASSERT(info.Width + padding <= pack_rect.w);
IM_ASSERT(info.Height + padding <= pack_rect.h);
const int tx = pack_rect.x + padding;
const int ty = pack_rect.y + padding;
// Register glyph
float x0 = info.OffsetX + font_off_x;
float y0 = info.OffsetY + font_off_y;
float x1 = x0 + info.Width;
float y1 = y0 + info.Height;
float u0 = (tx) / (float)atlas->TexWidth;
float v0 = (ty) / (float)atlas->TexHeight;
float u1 = (tx + info.Width) / (float)atlas->TexWidth;
float v1 = (ty + info.Height) / (float)atlas->TexHeight;
dst_font->AddGlyph(&cfg, (ImWchar)src_glyph.Codepoint, x0, y0, x1, y1, u0, v0, u1, v1, info.AdvanceX);
ImFontGlyph* dst_glyph = &dst_font->Glyphs.back();
IM_ASSERT(dst_glyph->Codepoint == src_glyph.Codepoint);
if (src_glyph.Info.IsColored)
dst_glyph->Colored = tex_use_colors = true;
// Blit from temporary buffer to final texture
size_t blit_src_stride = (size_t)src_glyph.Info.Width;
size_t blit_dst_stride = (size_t)atlas->TexWidth;
unsigned int* blit_src = src_glyph.BitmapData;
if (atlas->TexPixelsAlpha8 != NULL)
{
unsigned char* blit_dst = atlas->TexPixelsAlpha8 + (ty * blit_dst_stride) + tx;
for (int y = 0; y < info.Height; y++, blit_dst += blit_dst_stride, blit_src += blit_src_stride)
for (int x = 0; x < info.Width; x++)
blit_dst[x] = (unsigned char)((blit_src[x] >> IM_COL32_A_SHIFT) & 0xFF);
}
else
{
unsigned int* blit_dst = atlas->TexPixelsRGBA32 + (ty * blit_dst_stride) + tx;
for (int y = 0; y < info.Height; y++, blit_dst += blit_dst_stride, blit_src += blit_src_stride)
for (int x = 0; x < info.Width; x++)
blit_dst[x] = blit_src[x];
}
}
src_tmp.Rects = NULL;
}
atlas->TexPixelsUseColors = tex_use_colors;
// Cleanup
for (int buf_i = 0; buf_i < buf_bitmap_buffers.Size; buf_i++)
IM_FREE(buf_bitmap_buffers[buf_i]);
src_tmp_array.clear_destruct();
ImFontAtlasBuildFinish(atlas);
return true;
}
// FreeType memory allocation callbacks
static void* FreeType_Alloc(FT_Memory /*memory*/, long size)
{
return GImGuiFreeTypeAllocFunc((size_t)size, GImGuiFreeTypeAllocatorUserData);
}
static void FreeType_Free(FT_Memory /*memory*/, void* block)
{
GImGuiFreeTypeFreeFunc(block, GImGuiFreeTypeAllocatorUserData);
}
static void* FreeType_Realloc(FT_Memory /*memory*/, long cur_size, long new_size, void* block)
{
// Implement realloc() as we don't ask user to provide it.
if (block == NULL)
return GImGuiFreeTypeAllocFunc((size_t)new_size, GImGuiFreeTypeAllocatorUserData);
if (new_size == 0)
{
GImGuiFreeTypeFreeFunc(block, GImGuiFreeTypeAllocatorUserData);
return NULL;
}
if (new_size > cur_size)
{
void* new_block = GImGuiFreeTypeAllocFunc((size_t)new_size, GImGuiFreeTypeAllocatorUserData);
memcpy(new_block, block, (size_t)cur_size);
GImGuiFreeTypeFreeFunc(block, GImGuiFreeTypeAllocatorUserData);
return new_block;
}
return block;
}
static bool ImFontAtlasBuildWithFreeType(ImFontAtlas* atlas)
{
// FreeType memory management: https://www.freetype.org/freetype2/docs/design/design-4.html
FT_MemoryRec_ memory_rec = {};
memory_rec.user = NULL;
memory_rec.alloc = &FreeType_Alloc;
memory_rec.free = &FreeType_Free;
memory_rec.realloc = &FreeType_Realloc;
// https://www.freetype.org/freetype2/docs/reference/ft2-module_management.html#FT_New_Library
FT_Library ft_library;
FT_Error error = FT_New_Library(&memory_rec, &ft_library);
if (error != 0)
return false;
// If you don't call FT_Add_Default_Modules() the rest of code may work, but FreeType won't use our custom allocator.
FT_Add_Default_Modules(ft_library);
bool ret = ImFontAtlasBuildWithFreeTypeEx(ft_library, atlas, atlas->FontBuilderFlags);
FT_Done_Library(ft_library);
return ret;
}
const ImFontBuilderIO* ImGuiFreeType::GetBuilderForFreeType()
{
static ImFontBuilderIO io;
io.FontBuilder_Build = ImFontAtlasBuildWithFreeType;
return &io;
}
void ImGuiFreeType::SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data)
{
GImGuiFreeTypeAllocFunc = alloc_func;
GImGuiFreeTypeFreeFunc = free_func;
GImGuiFreeTypeAllocatorUserData = user_data;
}

View File

@ -1,50 +0,0 @@
// dear imgui: FreeType font builder (used as a replacement for the stb_truetype builder)
// (headers)
#pragma once
#include "imgui.h" // IMGUI_API
// Forward declarations
struct ImFontAtlas;
struct ImFontBuilderIO;
// Hinting greatly impacts visuals (and glyph sizes).
// - By default, hinting is enabled and the font's native hinter is preferred over the auto-hinter.
// - When disabled, FreeType generates blurrier glyphs, more or less matches the stb_truetype.h
// - The Default hinting mode usually looks good, but may distort glyphs in an unusual way.
// - The Light hinting mode generates fuzzier glyphs but better matches Microsoft's rasterizer.
// You can set those flags globaly in ImFontAtlas::FontBuilderFlags
// You can set those flags on a per font basis in ImFontConfig::FontBuilderFlags
enum ImGuiFreeTypeBuilderFlags
{
ImGuiFreeTypeBuilderFlags_NoHinting = 1 << 0, // Disable hinting. This generally generates 'blurrier' bitmap glyphs when the glyph are rendered in any of the anti-aliased modes.
ImGuiFreeTypeBuilderFlags_NoAutoHint = 1 << 1, // Disable auto-hinter.
ImGuiFreeTypeBuilderFlags_ForceAutoHint = 1 << 2, // Indicates that the auto-hinter is preferred over the font's native hinter.
ImGuiFreeTypeBuilderFlags_LightHinting = 1 << 3, // A lighter hinting algorithm for gray-level modes. Many generated glyphs are fuzzier but better resemble their original shape. This is achieved by snapping glyphs to the pixel grid only vertically (Y-axis), as is done by Microsoft's ClearType and Adobe's proprietary font renderer. This preserves inter-glyph spacing in horizontal text.
ImGuiFreeTypeBuilderFlags_MonoHinting = 1 << 4, // Strong hinting algorithm that should only be used for monochrome output.
ImGuiFreeTypeBuilderFlags_Bold = 1 << 5, // Styling: Should we artificially embolden the font?
ImGuiFreeTypeBuilderFlags_Oblique = 1 << 6, // Styling: Should we slant the font, emulating italic style?
ImGuiFreeTypeBuilderFlags_Monochrome = 1 << 7, // Disable anti-aliasing. Combine this with MonoHinting for best results!
ImGuiFreeTypeBuilderFlags_LoadColor = 1 << 8, // Enable FreeType color-layered glyphs
ImGuiFreeTypeBuilderFlags_Bitmap = 1 << 9 // Enable FreeType bitmap glyphs
};
namespace ImGuiFreeType
{
// This is automatically assigned when using '#define IMGUI_ENABLE_FREETYPE'.
// If you need to dynamically select between multiple builders:
// - you can manually assign this builder with 'atlas->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType()'
// - prefer deep-copying this into your own ImFontBuilderIO instance if you use hot-reloading that messes up static data.
IMGUI_API const ImFontBuilderIO* GetBuilderForFreeType();
// Override allocators. By default ImGuiFreeType will use IM_ALLOC()/IM_FREE()
// However, as FreeType does lots of allocations we provide a way for the user to redirect it to a separate memory heap if desired.
IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data = NULL);
// Obsolete names (will be removed soon)
// Prefer using '#define IMGUI_ENABLE_FREETYPE'
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
static inline bool BuildFontAtlas(ImFontAtlas* atlas, unsigned int flags = 0) { atlas->FontBuilderIO = GetBuilderForFreeType(); atlas->FontBuilderFlags = flags; return atlas->Build(); }
#endif
}

View File

@ -1,16 +0,0 @@
all: release
debug:
@+make -f debug.mk all
release:
@+make -f release.mk all
clean:
@+make -f build.mk clean
db: clean
@bear -- $(MAKE) -f debug.mk all
@mv -f compile_commands.json ../../../
.PHONY: all clean debug release db

View File

@ -1,12 +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 := import-chrome
IMAGE := $(PROJECT)-$(BUILD)
FILTER :=
include ../../../common/src-from-vcxproj.mk
include ../../../common/unix.mk

View File

@ -1,6 +0,0 @@
CFLAGS := -g3 -Wall
DEFINES := -DDEBUG
BUILD := debug
include ../../../common/unix-debug.mk
include build.mk

View File

@ -1,9 +0,0 @@
CFLAGS := -O3
ifndef TRACY_NO_LTO
CFLAGS += -flto
endif
DEFINES := -DNDEBUG
BUILD := release
include ../../../common/unix-release.mk
include build.mk

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