Reviewers: Vyacheslav Egorov,

Message:
plz review

do you have some kind of trybots? I don't feel like compiling this on windows
myself

Description:
Add OS::GetCurrentProcessId and prepend output from trace-gc with the current
pid

BUG=none
TEST=manual

Please review this at http://codereview.chromium.org/9817002/

SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/

Affected files:
  M     src/incremental-marking-inl.h
  M     src/incremental-marking.h
  M     src/platform-posix.cc
  M     src/platform-win32.cc
  M     src/platform.h
  M     test/cctest/test-platform-linux.cc
  M     test/cctest/test-platform-win32.cc


Index: src/incremental-marking-inl.h
===================================================================
--- src/incremental-marking-inl.h       (revision 11090)
+++ src/incremental-marking-inl.h       (working copy)
@@ -107,7 +107,9 @@
       // trace it.  In this case we switch to non-incremental marking in
       // order to finish off this marking phase.
       if (FLAG_trace_gc) {
- PrintF("Hurrying incremental marking because of lack of progress\n");
+        PrintF("[%d] Hurrying incremental marking "
+               "because of lack of progress\n",
+               OS::GetCurrentProcessId());
       }
       allocation_marking_factor_ = kMaxAllocationMarkingFactor;
     }
Index: src/incremental-marking.h
===================================================================
--- src/incremental-marking.h   (revision 11090)
+++ src/incremental-marking.h   (working copy)
@@ -201,7 +201,9 @@
     if (IsMarking()) {
       if (allocation_marking_factor_ < kFastMarking) {
         if (FLAG_trace_gc) {
- PrintF("Increasing marking speed to %d due to high promotion rate\n",
+          PrintF("[%d] Increasing marking speed to %d "
+                 "due to high promotion rate\n",
+                 OS::GetCurrentProcessId(),
                  static_cast<int>(kFastMarking));
         }
         allocation_marking_factor_ = kFastMarking;
Index: src/platform-posix.cc
===================================================================
--- src/platform-posix.cc       (revision 11090)
+++ src/platform-posix.cc       (working copy)
@@ -153,6 +153,9 @@
   return NAN;
 }

+int OS::GetCurrentProcessId() {
+  return static_cast<int>(getpid());
+}

// ----------------------------------------------------------------------------
 // POSIX date/time support.
Index: src/platform-win32.cc
===================================================================
--- src/platform-win32.cc       (revision 11090)
+++ src/platform-win32.cc       (working copy)
@@ -633,6 +633,11 @@
 }


+int OS::GetCurrentProcessId() {
+  return static_cast<int>(::GetCurrentProcessId());
+}
+
+
// ----------------------------------------------------------------------------
 // Win32 console output.
 //
Index: src/platform.h
===================================================================
--- src/platform.h      (revision 11090)
+++ src/platform.h      (working copy)
@@ -310,6 +310,8 @@
   static const int kMinComplexMemCopy = 256;
 #endif  // V8_TARGET_ARCH_IA32

+  static int GetCurrentProcessId();
+
  private:
   static const int msPerSecond = 1000;

Index: test/cctest/test-platform-linux.cc
===================================================================
--- test/cctest/test-platform-linux.cc  (revision 11090)
+++ test/cctest/test-platform-linux.cc  (working copy)
@@ -79,3 +79,8 @@
   CHECK(vm->Uncommit(block_addr, block_size));
   delete vm;
 }
+
+TEST(GetCurrentProcessId) {
+  OS::SetUp();
+  CHECK_EQ(static_cast<int>(getpid()), OS::GetCurrentProcessId());
+}
Index: test/cctest/test-platform-win32.cc
===================================================================
--- test/cctest/test-platform-win32.cc  (revision 11090)
+++ test/cctest/test-platform-win32.cc  (working copy)
@@ -25,3 +25,9 @@
   CHECK(vm->Uncommit(block_addr, block_size));
   delete vm;
 }
+
+TEST(GetCurrentProcessId) {
+  OS::SetUp();
+  CHECK_EQ(static_cast<int>(::GetCurrentProcessId()),
+           OS::GetCurrentProcessId());
+}


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to