Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/ps/Profiler2.h
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Lines | enum EItem | ||||
ITEM_NOP = 0, | ITEM_NOP = 0, | ||||
ITEM_SYNC = 1, // magic value used for parse syncing | ITEM_SYNC = 1, // magic value used for parse syncing | ||||
ITEM_EVENT = 2, // single event | ITEM_EVENT = 2, // single event | ||||
ITEM_ENTER = 3, // entering a region | ITEM_ENTER = 3, // entering a region | ||||
ITEM_LEAVE = 4, // leaving a region (must be correctly nested) | ITEM_LEAVE = 4, // leaving a region (must be correctly nested) | ||||
ITEM_ATTRIBUTE = 5, // arbitrary string associated with current region, or latest event (if the previous item was an event) | ITEM_ATTRIBUTE = 5, // arbitrary string associated with current region, or latest event (if the previous item was an event) | ||||
}; | }; | ||||
static const size_t MAX_ATTRIBUTE_LENGTH = 256; // includes null terminator, which isn't stored | static const size_t MAX_ATTRIBUTE_LENGTH; // includes null terminator, which isn't stored | ||||
/// An arbitrary number to help resyncing with the item stream when parsing. | /// An arbitrary number to help resyncing with the item stream when parsing. | ||||
static const u8 RESYNC_MAGIC[8]; | static const u8 RESYNC_MAGIC[8]; | ||||
/** | /** | ||||
* An item with a relative time and an ID string pointer. | * An item with a relative time and an ID string pointer. | ||||
*/ | */ | ||||
struct SItem_dt_id | struct SItem_dt_id | ||||
{ | { | ||||
float dt; // time relative to last event | float dt; // time relative to last event | ||||
const char* id; | const char* id; | ||||
}; | }; | ||||
private: | private: | ||||
// TODO: what's a good size? | |||||
// TODO: different threads might want different sizes | // TODO: different threads might want different sizes | ||||
static const size_t BUFFER_SIZE = 4*1024*1024; | static const size_t BUFFER_SIZE; | ||||
static const size_t HOLD_BUFFER_SIZE = 128 * 1024; | static const size_t HOLD_BUFFER_SIZE; | ||||
/** | /** | ||||
* Class instantiated in every registered thread. | * Class instantiated in every registered thread. | ||||
*/ | */ | ||||
class ThreadStorage | class ThreadStorage | ||||
{ | { | ||||
NONCOPYABLE(ThreadStorage); | NONCOPYABLE(ThreadStorage); | ||||
public: | public: | ||||
▲ Show 20 Lines • Show All 417 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator