[SM91] Update to Spidermonkey 91.1.3 APIs
[0ad.git] / libraries / source / spidermonkey / include-win32-debug / mozilla / ProfileBufferEntryKinds.h
blobc8280a92d7fb316f85f41ac4f3c4c1c8912406e1
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef ProfileBufferEntryKinds_h
8 #define ProfileBufferEntryKinds_h
10 #include <cstdint>
12 namespace mozilla {
14 // This is equal to sizeof(double), which is the largest non-char variant in
15 // |u|.
16 static constexpr size_t ProfileBufferEntryNumChars = 8;
18 // NOTE! If you add entries, you need to verify if they need to be added to the
19 // switch statement in DuplicateLastSample!
20 // This will evaluate the MACRO with (KIND, TYPE, SIZE)
21 #define FOR_EACH_PROFILE_BUFFER_ENTRY_KIND(MACRO) \
22 MACRO(CategoryPair, int, sizeof(int)) \
23 MACRO(CollectionStart, double, sizeof(double)) \
24 MACRO(CollectionEnd, double, sizeof(double)) \
25 MACRO(Label, const char*, sizeof(const char*)) \
26 MACRO(FrameFlags, uint64_t, sizeof(uint64_t)) \
27 MACRO(DynamicStringFragment, char*, ProfileBufferEntryNumChars) \
28 MACRO(JitReturnAddr, void*, sizeof(void*)) \
29 MACRO(InnerWindowID, uint64_t, sizeof(uint64_t)) \
30 MACRO(LineNumber, int, sizeof(int)) \
31 MACRO(ColumnNumber, int, sizeof(int)) \
32 MACRO(NativeLeafAddr, void*, sizeof(void*)) \
33 MACRO(Pause, double, sizeof(double)) \
34 MACRO(Resume, double, sizeof(double)) \
35 MACRO(PauseSampling, double, sizeof(double)) \
36 MACRO(ResumeSampling, double, sizeof(double)) \
37 MACRO(Responsiveness, double, sizeof(double)) \
38 MACRO(ThreadId, int, sizeof(int)) \
39 MACRO(Time, double, sizeof(double)) \
40 MACRO(TimeBeforeCompactStack, double, sizeof(double)) \
41 MACRO(CounterId, void*, sizeof(void*)) \
42 MACRO(CounterKey, uint64_t, sizeof(uint64_t)) \
43 MACRO(Number, uint64_t, sizeof(uint64_t)) \
44 MACRO(Count, int64_t, sizeof(int64_t)) \
45 MACRO(ProfilerOverheadTime, double, sizeof(double)) \
46 MACRO(ProfilerOverheadDuration, double, sizeof(double))
48 // The `Kind` is a single byte identifying the type of data that is actually
49 // stored in a `ProfileBufferEntry`, as per the list in
50 // `FOR_EACH_PROFILE_BUFFER_ENTRY_KIND`.
52 // This byte is also used to identify entries in ProfileChunkedBuffer blocks,
53 // for both "legacy" entries that do contain a `ProfileBufferEntry`, and for
54 // new types of entries that may carry more data of different types.
55 // TODO: Eventually each type of "legacy" entry should be replaced with newer,
56 // more efficient kinds of entries (e.g., stack frames could be stored in one
57 // bigger entry, instead of multiple `ProfileBufferEntry`s); then we could
58 // discard `ProfileBufferEntry` and move this enum to a more appropriate spot.
59 using ProfileBufferEntryKindUnderlyingType = uint8_t;
61 enum class ProfileBufferEntryKind : ProfileBufferEntryKindUnderlyingType {
62 INVALID = 0,
63 #define KIND(KIND, TYPE, SIZE) KIND,
64 FOR_EACH_PROFILE_BUFFER_ENTRY_KIND(KIND)
65 #undef KIND
67 // Any value under `LEGACY_LIMIT` represents a `ProfileBufferEntry`.
68 LEGACY_LIMIT,
70 // Any value starting here does *not* represent a `ProfileBufferEntry` and
71 // requires separate decoding and handling.
73 // Markers and their data.
74 Marker = LEGACY_LIMIT,
76 // Entry with "running times", such as CPU usage measurements.
77 // Optional between TimeBeforeCompactStack and CompactStack.
78 RunningTimes,
80 // Optional between TimeBeforeCompactStack and CompactStack.
81 UnresponsiveDurationMs,
83 // Collection of legacy stack entries, must follow a ThreadId and
84 // TimeBeforeCompactStack (which are not included in the CompactStack;
85 // TimeBeforeCompactStack is equivalent to Time, but indicates that a
86 // CompactStack follows shortly afterwards).
87 CompactStack,
89 MODERN_LIMIT
92 } // namespace mozilla
94 #endif // ProfileBufferEntryKinds_h