1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:27:34 +00:00

Profiler: Store event type as enum

Also check for the most common event type (sample) first instead of
leaving it as the fallback. This avoids a lot of string comparisons
while parsing profiles.
This commit is contained in:
Andreas Kling 2021-08-13 01:51:30 +02:00
parent 5a2ccbffc5
commit 7abf58ecaf
2 changed files with 45 additions and 19 deletions

View file

@ -163,9 +163,22 @@ public:
};
struct Event {
enum class Type {
Free,
Malloc,
Mmap,
Munmap,
ProcessCreate,
ProcessExec,
ProcessExit,
Sample,
Signpost,
ThreadCreate,
ThreadExit,
};
Type type {};
EventSerialNumber serial;
u64 timestamp { 0 };
String type;
FlatPtr ptr { 0 };
size_t size { 0 };
String name;