Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Unified Diff: src/base/platform/platform-posix.cc

Issue 368433006: Reland "Linux perf tool support update + refactoring." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix Android builder Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/base/platform/platform-posix.cc
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc
index 8454213def9308ef2d89e9b758f506af764e330c..b49e7bf856296d2fa789ca59afadc0d70ec9715a 100644
--- a/src/base/platform/platform-posix.cc
+++ b/src/base/platform/platform-posix.cc
@@ -20,9 +20,9 @@
#include <sys/mman.h>
#include <sys/resource.h>
#include <sys/stat.h>
+#include <sys/syscall.h>
#include <sys/time.h>
#include <sys/types.h>
-
#if defined(__linux__)
#include <sys/prctl.h> // NOLINT, for prctl
#endif
@@ -318,6 +318,15 @@ int OS::GetCurrentProcessId() {
}
+int OS::GetCurrentThreadId() {
+#if defined(ANDROID)
+ return static_cast<int>(syscall(__NR_gettid));
+#else
+ return static_cast<int>(syscall(SYS_gettid));
+#endif // defined(ANDROID)
+}
+
+
// ----------------------------------------------------------------------------
// POSIX date/time support.
//

Powered by Google App Engine
This is Rietveld 408576698