Commit Graph

21 Commits

Author SHA1 Message Date
Tiago Rodrigues
a1ca8dd06a fixes according to review comments 2023-11-24 16:32:45 -05: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
c302b509fe fix formatting 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
Tiago Rodrigues
c373647dae fix coding style 2023-11-13 13:43:03 -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
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
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
383ecb6a12
Remove CodeLocation query and CodeInformation response. 2022-10-11 22:56:23 +02:00
Bartosz Taudul
6f9dfc8469
Use dladdr, not libbacktrace in fast callstack decode path.
DecodeCallstackPtrFast() may be called outside the symbol processing thread,
for example in the crash handler. Using the less-capable dladdr functionality
doesn't have a big impact here. Callstack decoding in this context is used to
remove the uninteresting top part of the callstack, so that the callstack ends
at the crashing function, and not in the crash handler. Even if this
functionality would be impacted by this change, the damage done is close to
none.

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

NB everything was working when it was first implemented, because back then the
callstack decoding was still performed on the main thread, and not on a
separate, dedicated one.
2022-10-08 13:22:56 +02:00
Bartosz Taudul
7552341ff0
Increase possible inline stack size to 64 elements. 2022-10-04 22:16:20 +02:00
Bartosz Taudul
2cc5eff9a2
Normalize symbol paths on libbacktrace systems. 2022-09-02 01:23:29 +02:00
Bartosz Taudul
8cc43284bd
Add path normalization function. 2022-09-02 01:23:14 +02:00
Bartosz Taudul
d32dc47845
Add debug logging for debuginfod queries. 2022-08-16 22:05:08 +02:00
Bartosz Taudul
72ad40698b
Move initialization of callstack structs to a thread.
Initializing structures for callstack processing (building memory map of the
process, gathering kernel symbols, etc) takes some time, which in some cases
may be significant.

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

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

Some parts of the initialization process may be critical to do in the main
thread, for example because the function responsible for gathering callstacks
must be loaded first. This is done still on the main thread, in a new function
InitCallstackCritical().
2022-08-16 13:55:46 +02:00
Bartosz Taudul
c6464f44da
Fix typo. 2022-07-30 22:02:25 +02:00
Bartosz Taudul
a75846dd88
Do not try to demangle really long function names. 2022-07-23 12:37:00 +02:00
Bartosz Taudul
d282425287
Fix demangle buffer. 2022-07-23 12:34:35 +02:00
Bartosz Taudul
7dc95bf3a8
Fix demangling of functions with names >64KB. 2022-07-20 01:21:43 +02:00
Bartosz Taudul
06c7984a16
Move all client headers and sources to public/ directory. 2022-07-17 15:47:38 +02:00