X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_writer_local.hpp;h=358455a955a6d2bfe6c0fdd409a734e04a5e312d;hb=0ae84f58eee1c239d5bc2cc148a1d007b328d2e1;hp=1da22501d41dbe52291bacd5b1679d3073734885;hpb=aa1b2136cc72893e519ff73c47e2ecd29cafe1da;p=apitrace diff --git a/common/trace_writer_local.hpp b/common/trace_writer_local.hpp index 1da2250..358455a 100644 --- a/common/trace_writer_local.hpp +++ b/common/trace_writer_local.hpp @@ -34,15 +34,16 @@ #include #include "os_thread.hpp" +#include "os_process.hpp" #include "trace_writer.hpp" namespace trace { - extern FunctionSig memcpy_sig; - extern FunctionSig malloc_sig; - extern FunctionSig free_sig; - extern FunctionSig realloc_sig; + extern const FunctionSig memcpy_sig; + extern const FunctionSig malloc_sig; + extern const FunctionSig free_sig; + extern const FunctionSig realloc_sig; /** * A specialized Writer class, mean to trace the current process. @@ -70,6 +71,13 @@ namespace trace { os::recursive_mutex mutex; int acquired; + /** + * ID of the processed that opened the trace file. + */ + os::ProcessId pid; + + void checkProcessId(); + public: /** * Should never called directly -- use localWriter singleton below @@ -83,7 +91,7 @@ namespace trace { /** * It will acquire the mutex. */ - unsigned beginEnter(FunctionSig *sig); + unsigned beginEnter(const FunctionSig *sig, bool fake = false); /** * It will release the mutex.