1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! The idea of firestorm-core was to try to make a small API subset so that multiple
//! versions of firestorm with the potential for backward incompatable API changes
//! between them could share common data so that profiling all dependencies would
//! still work. This probably fell short, but it's a step toward that.
// TODO: The main problem about the above is that multiple dependencies would not be enabled.
// So, even the enable/disable re-export paradigm has to come from this crate.
use UnsafeCell;
// The TimeSample type exists to make time opaque for backward compatability.
// The means by which time is sampled has a huge impact on the performance of this
// crate. So, it is desirable to be able to change the method without requiring
// a version bump.
//
// We also make the method configurable
pub use *;
pub use *;
type Str = &'static &'static str;
// TODO: Add Pause, Resume to help with things like the
// amortized cost of expanding the length of the events
// array getting reported as a part of another operation.
/// A lazy string format.
/// A tiny record of a method call which when played back can construct
/// a profiling state. Several representations were considered, the most
/// elaborate of which would write variable length data to the event stream.
/// Ideally, data would be an &'static EventData to avoid writing more data
/// than is necessary but limitations in the Rust compiler prevent this.
// Having a large capacity here buys some time before having to implement Pause/Resume capabilities to hide
// the time spent in expanding the array.
thread_local!;