]> git.cworth.org Git - apitrace/commitdiff
Merge branch 'backtrace'
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 13 May 2013 15:44:35 +0000 (16:44 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 13 May 2013 15:44:35 +0000 (16:44 +0100)
Conflicts:
common/trace_writer_local.cpp

1  2 
common/trace_writer_local.cpp
common/trace_writer_local.hpp

index d2ff3b5f73f2a41c5ea9c1413f98260a56941b20,6cea2faa28f9d44805d961aeb4310cf4e2f0fc13..c5a5c4447b2b4213bea2603f6fd905f554c67bca
@@@ -138,21 -134,7 +139,21 @@@ static uintptr_t next_thread_num = 1
  static OS_THREAD_SPECIFIC_PTR(void)
  thread_num;
  
- unsigned LocalWriter::beginEnter(const FunctionSig *sig) {
 +void LocalWriter::checkProcessId(void) {
 +    if (m_file->isOpened() &&
 +        os::getCurrentProcessId() != pid) {
 +        // We are a forked child process that inherited the trace file, so
 +        // create a new file.  We can't call any method of the current
 +        // file, as it may cause it to flush and corrupt the parent's
 +        // trace, so we effectively leak the old file object.
 +        m_file = File::createSnappy();
 +        // Don't want to open the same file again
 +        os::unsetEnvironment("TRACE_FILE");
 +        open();
 +    }
 +}
 +
+ unsigned LocalWriter::beginEnter(const FunctionSig *sig, bool fake) {
      mutex.lock();
      ++acquired;
  
Simple merge