]> git.saurik.com Git - apple/system_cmds.git/blobdiff - KDBG/TraceFile.cpp
system_cmds-643.30.1.tar.gz
[apple/system_cmds.git] / KDBG / TraceFile.cpp
diff --git a/KDBG/TraceFile.cpp b/KDBG/TraceFile.cpp
new file mode 100644 (file)
index 0000000..bddf161
--- /dev/null
@@ -0,0 +1,28 @@
+//
+//  TraceFile.cpp
+//  system_cmds
+//
+//  Created by James McIlree on 4/1/14.
+//
+//
+
+#include "KDebug.h"
+
+TraceFile::TraceFile(const char* path, bool sort_events, uint32_t default_ap_count, uint32_t default_iop_count) :
+       _file(path),
+       _version(kTraceFileVersion::Unknown),
+       _is_64_bit(false),
+       _is_valid(false),
+       _threadmap(nullptr),
+       _threadmap_count(0),
+       _cpumap(nullptr),
+       _cpumap_count(0),
+       _events(nullptr),
+       _event_count(0)
+{
+       try {
+               parse<Kernel64>(sort_events, default_ap_count, default_iop_count);
+       } catch (...) {
+               parse<Kernel32>(sort_events, default_ap_count, default_iop_count);
+       }
+}