]> git.saurik.com Git - apple/system_cmds.git/blobdiff - KDBG/IOActivity.hpp
system_cmds-643.30.1.tar.gz
[apple/system_cmds.git] / KDBG / IOActivity.hpp
diff --git a/KDBG/IOActivity.hpp b/KDBG/IOActivity.hpp
new file mode 100644 (file)
index 0000000..caa0264
--- /dev/null
@@ -0,0 +1,34 @@
+//
+//  IOActivity.hpp
+//  KDBG
+//
+//  Created by James McIlree on 9/2/13.
+//  Copyright (c) 2014 Apple. All rights reserved.
+//
+
+#ifndef kdprof_IOActivity_hpp
+#define kdprof_IOActivity_hpp
+
+template <typename SIZE>
+class IOActivity : public TRange<AbsTime> {
+    private:
+       MachineThread<SIZE>*    _thread;
+       typename SIZE::ptr_t    _size;
+
+    public:
+       IOActivity(AbsTime start, AbsTime length, MachineThread<SIZE>* thread, typename SIZE::ptr_t size) :
+               TRange(start, length),
+               _thread(thread),
+               _size(size)
+       {
+               ASSERT(_thread, "Sanity");
+               ASSERT(_size, "Zero length IO");
+       }
+
+       MachineThread<SIZE>* thread() const             { return _thread; }
+       void set_thread(MachineThread<SIZE>* thread)    { _thread = thread; }
+
+       typename SIZE::ptr_t size() const               { return _size; }
+};
+
+#endif