Commit Graph

683 Commits

Author SHA1 Message Date
Bartosz Taudul
235ac90b85 Set proper tail of blocks. 2020-01-03 01:24:11 +01:00
Bartosz Taudul
ab91480f6d Store tail atomic variable in register.
Also: use macros for lock free queue prepare and commit.
2020-01-03 01:11:38 +01:00
Bartosz Taudul
9fed0ef938 Flush data after queue delay is calibrated. 2020-01-03 00:38:12 +01:00
Bartosz Taudul
7d68b16341 Implement flushing data from producer. 2020-01-03 00:37:54 +01:00
Bartosz Taudul
89254ab353 Allow just freeing blocks. 2020-01-03 00:37:40 +01:00
Bartosz Taudul
8588b8b4a6 Don't lock memory on fast path. 2020-01-03 00:25:01 +01:00
Bartosz Taudul
a35e1e7a8c Keep lock free queue thread local data in one struct. 2020-01-02 23:55:56 +01:00
Bartosz Taudul
be5c94ee09 Prevent inlining next block preparation. 2020-01-02 23:52:03 +01:00
Bartosz Taudul
9b0044838e Enqueue can be a static operation. 2020-01-02 23:42:38 +01:00
Bartosz Taudul
4af26880dd Don't report CPU topology if delayed init is active.
Reporting topology requires producer to be available, which creates a
deadlock during delayed init data structures construction.

Calling GetProducer() results in a call to GetProfilerThreadData(),
which in turn calls GetProfilerData() to construct its thread local
variable. However, at this point we already are calling
GetProfilerData() (to construct the profiler itself). This would result
in an incorrect double construction of data, but the code already
prevents this by allowing init code to be entered only once. Hence the
deadlock.

Currently this is a non-issue, as no platform which can report CPU
topology needs to use delayed init.
2020-01-02 22:45:21 +01:00
Bartosz Taudul
e7cb1fe52b Remove concurrentqueue. 2020-01-02 22:45:21 +01:00
Bartosz Taudul
25a260dcd1 Missing header. 2020-01-02 22:45:21 +01:00
Bartosz Taudul
a298c4333e Use new lock-free queue.
Only enqueue is implemented, no way to dequeue items yet. Expect lots of
bugs and reduced performance.
2020-01-02 22:45:21 +01:00
Bartosz Taudul
6054a301c2 Direct enqueue of QueueItems. 2020-01-02 22:23:58 +01:00
Bartosz Taudul
40186956f6 Add inlines required to not duplicate symbols. 2020-01-02 22:23:58 +01:00
Bartosz Taudul
92fded825e Lock-free queue enqueue. 2020-01-02 22:23:58 +01:00
Bartosz Taudul
6b64fbc3be Producers and data blocks plumbing for lock-free queue. 2020-01-02 22:23:58 +01:00
Bartosz Taudul
4ef2ce4622 Fix _mm256_cvtsi256_si32 on gcc. 2019-12-12 02:13:12 +01:00
Bartosz Taudul
129b80ef0f Free source location, if zone is not active. 2019-12-06 00:42:42 +01:00
Bartosz Taudul
b9cdf2cbb7 Expose srcloc allocation in C API. 2019-12-06 00:25:52 +01:00
Bartosz Taudul
399b87fecc Add allocated srcloc zone begin emit functions to C API. 2019-12-06 00:22:49 +01:00
Bartosz Taudul
68ff33d0ba Extract source location allocation functionality. 2019-12-06 00:15:46 +01:00
Bartosz Taudul
e8fcc250a1 Report CPU topology on Linux. 2019-11-30 01:51:29 +01:00
Bartosz Taudul
712403e9fd Transfer, display, save CPU topology data. 2019-11-29 22:41:41 +01:00
Bartosz Taudul
59371eef5a Obtain CPU topology on windows. 2019-11-29 18:29:31 +01:00
thedmd
a1e2c533f6 libbacktrace: Add support for Mach-O (dSYM)
`macho.cpp` was backported from official libbacktrace repository.
2019-11-29 12:04:47 +01:00
Bartosz Taudul
a7d2d5f08b Fix DeferItem() call. 2019-11-26 01:10:50 +01:00
Bartosz Taudul
4551553eb4 Implement setting client parameters from server. 2019-11-25 23:59:48 +01:00
Bartosz Taudul
c5c9dfb0c9 Native callstacks are now optional in allocated callstack messages. 2019-11-25 22:54:10 +01:00
Bartosz Taudul
37eef59d54 Implement reading sys time on BSD. 2019-11-21 20:41:57 +01:00
Bartosz Taudul
c7a22cc1ff Use libbacktrace on BSD. 2019-11-21 20:41:57 +01:00
Bartosz Taudul
bd7b0a8197 Support callstack capture on BSD. 2019-11-21 02:34:42 +01:00
Bartosz Taudul
c79449a6a1 Get proper program name on BSD. 2019-11-21 02:16:12 +01:00
Bartosz Taudul
7940977dba Report physical memory size on BSD. 2019-11-21 02:14:08 +01:00
Bartosz Taudul
3854ae11b2 Revert "Remove dead code."
This reverts commit a36b73f745.
2019-11-17 17:38:02 +01:00
Bartosz Taudul
a36b73f745 Remove dead code. 2019-11-16 18:34:05 +01:00
Bartosz Taudul
8286b0b72f Plumbing for message call stacks. 2019-11-14 23:40:41 +01:00
Bartosz Taudul
0befc75f83 Fix conflicts with X.h. 2019-11-14 18:24:29 +01:00
Bartosz Taudul
655864eb7c Enable crash handler on cygwin.
Crash is properly recorded, but the profiler hangs while waiting for
shutdown finish.
2019-11-07 19:20:13 +01:00
Bartosz Taudul
3fd74a92f9 Native threads are used on mingw. 2019-11-07 19:02:54 +01:00
Bartosz Taudul
351e220d30 Don't calculate queue delay if delayed init is used.
Queue calibration requires queue access during profiler construction. This
in turn requires construction of profiler data block, *which at this point
is underway*, because the profiler is being constructed.
2019-06-19 17:29:04 +02:00
Bartosz Taudul
c98f1f0b6b Make sure profiler is initialized only once in delayed init scenario. 2019-06-19 17:28:18 +02:00
Bartosz Taudul
d4f58ddaf3 Use native windows threads on cygwin, mingw. 2019-11-06 01:42:14 +01:00
Bartosz Taudul
ca198e44d3 Remove dead code from concurrentqueue. 2019-11-05 21:40:52 +01:00
Bartosz Taudul
b5590ed197 Include <mutex> for std::once. 2019-11-05 21:40:35 +01:00
Bartosz Taudul
3e9bb80217 More header cleanup. 2019-11-05 20:15:53 +01:00
Bartosz Taudul
6bbf273581 Partial header inclusion cleanup. 2019-11-05 20:09:40 +01:00
Bartosz Taudul
907574e637 Allow remote plot configuration. 2019-11-05 17:45:19 +01:00
Bartosz Taudul
f34609fd9b Set per-cpu kernel buffer size to 512 KB.
The default setting was causing events to be lost on Android.
2019-11-03 21:52:20 +01:00
Bartosz Taudul
b8d459d48b Use proper string size (for consistency).
On Android code path this value is ignored.
2019-11-03 21:51:49 +01:00