Commit Graph

6998 Commits

Author SHA1 Message Date
Daniil Brychikov
a9ba1ce688 Codestyle fixes 2022-02-19 11:44:15 +03:00
Daniil Brychikov
73f6c66cde Automatic timer fallback 2022-02-16 15:18:45 +03:00
Bartosz Taudul
46d2977694
prev_state is long. 2022-02-14 22:34:20 +01:00
Bartosz Taudul
9f2ffb05ac
Check if memory can be allocated in a thread.
Consider running the following code with operator new and delete overloaded to
track allocations with call stacks:

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

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

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

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

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

Note that this is not a water-tight solution. Other functions will still want
to allocate memory for call stacks, but it is rather unlikely that such calls
would be performed during TLS block destruction. It is also possible that the
event queue will run out of allocated space for events at this very moment,
and in such a case the allocator will also fail.
2022-02-14 17:55:46 +01:00
Bartosz Taudul
793e6b0e29
Add rpmalloc thread state accessor. 2022-02-14 17:53:27 +01:00
Bartosz Taudul
20680fa6a3
Keep track of rpmalloc thread shutdown state. 2022-02-14 17:52:33 +01:00
Bartosz Taudul
72ae4d2ee4
Merge pull request #326 from Lectem/install_namepace
CMake install should use the Tracy:: namespace
2022-02-12 01:14:52 +01:00
Bartosz Taudul
278878e4f1
Merge pull request #327 from Lectem/fix_cmake_uwp
Fix missing TracyUwp in the CMake headers install
2022-02-12 00:26:57 +01:00
Clément Grégoire
5a67fa99a7 Fix missing TracyUwp in the CMake headers install 2022-02-12 00:20:37 +01:00
Clément Grégoire
0b6c60de76 Since tracy provides the Tracy::TracyClient it should also install with that namespace 2022-02-11 23:58:47 +01:00
Bartosz Taudul
4084dec939
Update AUTHORS. 2022-02-11 20:22:53 +01:00
Bartosz Taudul
af136f8289
Update NEWS. 2022-02-11 20:21:32 +01:00
Bartosz Taudul
a2d017c456
Merge pull request #324 from shapr3d/uwp_fix
Make Tracy usable in UWP applications
2022-02-11 20:20:18 +01:00
Balazs Kovacsics
aa44cedcd2 Fix indentation 2022-02-11 17:14:16 +01:00
Balazs Kovacsics
85e16ee33a Add UWP platform limitations to manual 2022-02-11 14:14:27 +01:00
Balazs Kovacsics
a0a56eaf9e Move TRACY_UWP define to own header 2022-02-10 20:26:45 +01:00
Balazs Kovacsics
7169f5f30a Fix compiling TracyClient.cpp on UWP with defined TRACY_ENABLE 2022-02-09 22:14:36 +01:00
Balazs Kovacsics
10b3d7ad82 Fix compiling TracyClient.cpp on UWP with undefined TRACY_ENABLE 2022-02-09 18:25:04 +01:00
Bartosz Taudul
92b182d47e
Font Awesome is licensed under SIL OFL.
"In the Font Awesome Free download, the SIL OFL license applies to all icons
packaged as web and desktop font files."
2022-02-08 21:30:49 +01:00
Bartosz Taudul
fe927d63f7
Update to Font Awesome 6. 2022-02-08 21:27:51 +01:00
Bartosz Taudul
1a4f369d4a
Backport 19471da from ImGui.
https://github.com/ocornut/imgui/issues/4920
2022-02-03 01:59:56 +01:00
Bartosz Taudul
f058ad01fc
Don't process ring buffers when not connected in on-demand mode. 2022-01-31 20:53:10 +01:00
Bartosz Taudul
361782f3fd
Fix edge case triggered by mouse being out-of-window. 2022-01-29 15:53:50 +01:00
Bartosz Taudul
df96293477
Create GPU source location zones stats entry, if not present.
In case of CPU statistics data, this entry is created during creation of a
source location. This won't be done for GPU zones, as it would needlessly
expand the number of held entries. This is assuming the number of GPU zones
is significantly less than the number of CPU zones.
2022-01-29 15:45:25 +01:00
Bartosz Taudul
32173dca29
Update NEWS. 2022-01-29 15:35:52 +01:00
Bartosz Taudul
f4043d9bb8
Display GPU zone statistics. 2022-01-29 15:35:25 +01:00
Bartosz Taudul
45c7edcc96
GPU source locations zones data accessor. 2022-01-29 15:22:49 +01:00
Bartosz Taudul
6d55f79109
Save source location data counts. 2022-01-29 15:14:43 +01:00
Bartosz Taudul
2ca4b0058a
Add AreGpuSourceLocationZonesReady() query. 2022-01-29 00:51:43 +01:00
Bartosz Taudul
ba87929074
Perform GPU statistics reconstruction.
Note: Zone counts are currently being calculated, but they are not being
saved. Proper usage of this data (as is performed in the CPU counterpart)
would remove the possibility of insertion of new entries into the map in
ReconstructZoneStatistics().
2022-01-29 00:48:01 +01:00
Bartosz Taudul
7870ca9da6
Add GPU mutable children accessor. 2022-01-29 00:40:11 +01:00
Bartosz Taudul
7a1b9efc2f
Add GPU statistics radio button. 2022-01-29 00:33:53 +01:00
Bartosz Taudul
28d029f820
Collection of GPU statistics. 2022-01-29 00:15:33 +01:00
Bartosz Taudul
f9279afaec
GPU zone counting. 2022-01-29 00:15:32 +01:00
Bartosz Taudul
f1095bba12
GPU statistics data accessors. 2022-01-29 00:15:32 +01:00
Bartosz Taudul
8533bdf5f4
Add data structures for GPU statistics. 2022-01-29 00:15:31 +01:00
Bartosz Taudul
fcced3c76a
Don't call SameLine() twice in a row. 2022-01-29 00:15:31 +01:00
Bartosz Taudul
3ee91b909f
Unify comparison for accumulation mode combo box. 2022-01-29 00:15:28 +01:00
Bartosz Taudul
f3f5f1dab8
Merge pull request #313 from cloudhan/update-opencl
Update OpenCL
2022-01-28 12:01:00 +01:00
Cloud Han
c9fb07ffe5 remove blocking collect 2022-01-28 11:55:42 +08:00
Bartosz Taudul
701ecdebaa
Merge pull request #317 from hulakdar/master
Fix MSVC warnings
2022-01-26 21:46:25 +01:00
hulakdar
e98f7e5019 Fix potentially unitialized value warning 2022-01-26 21:08:54 +02:00
hulakdar
9fda60820a Silence padding warnings, as this is intended behaviour 2022-01-26 21:08:54 +02:00
Cloud Han
f6769ecb91 better error discoverability if queue is not created with CL_QUEUE_PROFILING_ENABLE 2022-01-25 12:59:35 +08:00
Cloud Han
9b60c4970e better example 2022-01-25 12:59:35 +08:00
Cloud Han
21b748ac84 add back non-blocking collect 2022-01-25 12:59:28 +08:00
Cloud Han
d660425e00 mute warnings 2022-01-25 12:17:11 +08:00
Cloud Han
f8d231bbc9 stop using macro in TRACY_CL_CHECK_ERROR 2022-01-25 12:17:11 +08:00
Cloud Han
e28c562a20 add log and simple statistics for async kernel 2022-01-25 12:17:04 +08:00
Cloud Han
f6894c8d6c Make OpenCL example async 2022-01-25 12:17:03 +08:00