Merge "processor: Export pid/tid as signed integers into JSON"
diff --git a/Android.bp b/Android.bp
index 45bb558..d721882 100644
--- a/Android.bp
+++ b/Android.bp
@@ -994,10 +994,6 @@
     ":perfetto_src_tracing_tracing",
     ":perfetto_test_test_helper",
   ],
-  static_libs: [
-    "libgmock",
-    "libgtest",
-  ],
   export_include_dirs: [
     "include",
     "include/perfetto/base/build_configs/android_tree",
diff --git a/gn/standalone/BUILD.gn b/gn/standalone/BUILD.gn
index c52b7c1..79cdadf 100644
--- a/gn/standalone/BUILD.gn
+++ b/gn/standalone/BUILD.gn
@@ -23,6 +23,12 @@
     "-Wpedantic",
   ]
 
+  # Disable variadic macro warning as we make extensive use of them in trace
+  # processor and client API.
+  if (is_clang) {
+    cflags += [ "-Wno-gnu-zero-variadic-macro-arguments" ]
+  }
+
   # Disable Weverything on fuzzers to avoid breakages when new versions of clang
   # are rolled into OSS-fuzz.
   if (is_clang && !is_fuzzer) {
@@ -33,7 +39,6 @@
       "-Wno-disabled-macro-expansion",
       "-Wno-gnu-include-next",
       "-Wno-gnu-statement-expression",
-      "-Wno-gnu-zero-variadic-macro-arguments",
       "-Wno-padded",
       "-Wno-reserved-id-macro",
       "-Wno-unknown-sanitizers",
diff --git a/src/base/BUILD.gn b/src/base/BUILD.gn
index 53681bc..c786391 100644
--- a/src/base/BUILD.gn
+++ b/src/base/BUILD.gn
@@ -95,7 +95,6 @@
   deps = [
     ":base",
     "../../gn:default_deps",
-    "../../gn:gtest_and_gmock",
   ]
   sources = [
     "test/utils.cc",
diff --git a/src/base/test/utils.h b/src/base/test/utils.h
index a064fa2..673362a 100644
--- a/src/base/test/utils.h
+++ b/src/base/test/utils.h
@@ -20,7 +20,6 @@
 #include <string>
 
 #include "perfetto/base/logging.h"
-#include "test/gtest_and_gmock.h"
 
 #if PERFETTO_DCHECK_IS_ON()
 
@@ -31,20 +30,11 @@
 
 #else  // PERFETTO_DCHECK_IS_ON()
 
-// Since PERFETTO_DCHECK_IS_ON() is false these statements should not die (if
-// they should/do we should use EXPECT/ASSERT DEATH_TEST_IF_SUPPORTED directly).
-// Therefore if the platform supports DEATH_TESTS we can use the handy
-// GTEST_EXECUTE_STATEMENT_ which prevents optimizing the code away, and if not
-// we just fall back on executing the code directly.
-#if GTEST_HAS_DEATH_TEST
 #define EXPECT_DCHECK_DEATH(statement) \
     GTEST_EXECUTE_STATEMENT_(statement, "PERFETTO_CHECK")
 #define ASSERT_DCHECK_DEATH(statement) \
     GTEST_EXECUTE_STATEMENT_(statement, "PERFETTO_CHECK")
-#else
-#define EXPECT_DCHECK_DEATH(statement) statement
-#define ASSERT_DCHECK_DEATH(statement) statement
-#endif  // GTEST_HAS_DEATH_TEST
+
 #endif  // PERFETTO_DCHECK_IS_ON()
 
 namespace perfetto {
diff --git a/src/base/watchdog_posix.cc b/src/base/watchdog_posix.cc
index 3517afd..25782d9 100644
--- a/src/base/watchdog_posix.cc
+++ b/src/base/watchdog_posix.cc
@@ -47,7 +47,8 @@
   for (size_t i = 0; i < size; i++) {
     total += array[i];
   }
-  return total / size;
+  return static_cast<double>(total / size);
+
 }
 
 }  //  namespace
@@ -164,7 +165,7 @@
   // Add the current stat value to the ring buffer and check that the mean
   // remains under our threshold.
   if (memory_window_bytes_.Push(rss_bytes)) {
-    if (memory_window_bytes_.Mean() > memory_limit_bytes_) {
+    if (memory_window_bytes_.Mean() > static_cast<double>(memory_limit_bytes_)) {
       PERFETTO_ELOG(
           "Memory watchdog trigger. Memory window of %f bytes is above the "
           "%" PRIu64 " bytes limit.",
@@ -187,7 +188,7 @@
     double window_interval_ticks =
         (static_cast<double>(WindowTimeForRingBuffer(cpu_window_time_ticks_)) /
          1000.0) *
-        sysconf(_SC_CLK_TCK);
+        static_cast<double>(sysconf(_SC_CLK_TCK));
     double percentage = static_cast<double>(difference_ticks) /
                         static_cast<double>(window_interval_ticks) * 100;
     if (percentage > cpu_limit_percentage_) {