]> git.cworth.org Git - apitrace/blobdiff - trace_writer.hpp
Merge branch 'master' into compression
[apitrace] / trace_writer.hpp
index eb81f233f604bef706d1149d867d13ef1748e2fc..4d46f739f8f231fcdee4e39de053b21949193448 100644 (file)
@@ -55,7 +55,6 @@ namespace Trace {
         Writer();
         ~Writer();
 
-        void open(void);
         bool open(const char *filename);
         void close(void);
 
@@ -105,6 +104,27 @@ namespace Trace {
         void inline _writeString(const char *str);
 
     };
+
+    /**
+     * A specialized Writer class, mean to trace the current process.
+     *
+     * In particular:
+     * - it creates a trace file based on the current process name
+     * - uses mutexes to allow tracing from multiple threades
+     * - flushes the output to ensure the last call is traced in event of
+     *   abnormal termination
+     */
+    class LocalWriter : public Writer {
+    protected:
+    public:
+        void open(void);
+
+        unsigned beginEnter(const FunctionSig *sig);
+        void endEnter(void);
+
+        void beginLeave(unsigned call);
+        void endLeave(void);
+    };
 }
 
 #endif /* _TRACE_WRITER_HPP_ */