Merge "Project import generated by Copybara."
diff --git a/buildtools/BUILD.gn b/buildtools/BUILD.gn
index da12dff..c6bcd5c 100644
--- a/buildtools/BUILD.gn
+++ b/buildtools/BUILD.gn
@@ -143,6 +143,9 @@
cflags = []
if (is_clang) {
cflags += [ "-Wno-switch-enum" ]
+ if (is_win) {
+ cflags += [ "-Wno-undef" ]
+ }
}
}
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 01f12d0..192ede8 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -287,6 +287,8 @@
"-Wno-undefined-reinterpret-cast",
"-Wno-inconsistent-missing-destructor-override",
"-Wno-unused-parameter",
+ "-Wno-shadow-field-in-constructor",
+ "-Wno-zero-as-null-pointer-constant",
]
}
diff --git a/include/perfetto/ext/base/string_utils.h b/include/perfetto/ext/base/string_utils.h
index bca19c8..828d214 100644
--- a/include/perfetto/ext/base/string_utils.h
+++ b/include/perfetto/ext/base/string_utils.h
@@ -211,6 +211,7 @@
std::string ToStdString() const { return std::string(buf_, len_); }
const char* c_str() const { return buf_; }
size_t len() const { return len_; }
+ char* mutable_data() { return buf_; }
private:
char buf_[N];
diff --git a/src/base/threading/channel_unittest.cc b/src/base/threading/channel_unittest.cc
index 0649678..7acb355 100644
--- a/src/base/threading/channel_unittest.cc
+++ b/src/base/threading/channel_unittest.cc
@@ -15,6 +15,7 @@
*/
#include "perfetto/ext/base/threading/channel.h"
+#include <array>
#include <memory>
#include "perfetto/base/platform_handle.h"
diff --git a/src/trace_processor/sorter/trace_sorter.h b/src/trace_processor/sorter/trace_sorter.h
index aa1d121..6308401 100644
--- a/src/trace_processor/sorter/trace_sorter.h
+++ b/src/trace_processor/sorter/trace_sorter.h
@@ -219,8 +219,8 @@
// The type of this event. GCC7 does not like bit-field enums (see
// https://stackoverflow.com/questions/36005063/gcc-suppress-warning-too-small-to-hold-all-values-of)
- // so use an uint8_t instead and cast to the enum type.
- uint8_t event_type : kMaxTypeBits;
+ // so use an uint32_t instead and cast to the enum type.
+ uint32_t event_type : kMaxTypeBits;
// Out-of-band data used to intepret data in the TraceTokenBuffer.
// Exists outside of TraceTokenBuffer because we have a bunch of free
diff --git a/src/tracing/test/api_test_support.cc b/src/tracing/test/api_test_support.cc
index f07cb84..6246a6b 100644
--- a/src/tracing/test/api_test_support.cc
+++ b/src/tracing/test/api_test_support.cc
@@ -147,21 +147,23 @@
TestTempFile res{};
#if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
base::StackString<255> temp_file("%s\\perfetto-XXXXXX", getenv("TMP"));
- PERFETTO_CHECK(_mktemp_s(temp_file.c_str(), temp_file.len() + 1) == 0);
+ PERFETTO_CHECK(_mktemp_s(temp_file.mutable_data(), temp_file.len() + 1) == 0);
HANDLE handle =
- ::CreateFileA(temp_file, GENERIC_READ | GENERIC_WRITE,
+ ::CreateFileA(temp_file.c_str(), GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_DELETE | FILE_SHARE_READ, nullptr, CREATE_ALWAYS,
FILE_ATTRIBUTE_TEMPORARY, nullptr);
PERFETTO_CHECK(handle && handle != INVALID_HANDLE_VALUE);
res.fd = _open_osfhandle(reinterpret_cast<intptr_t>(handle), 0);
+ res.path = temp_file.ToStdString();
#elif PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
char temp_file[] = "/data/local/tmp/perfetto-XXXXXXXX";
res.fd = mkstemp(temp_file);
+ res.path = temp_file;
#else
char temp_file[] = "/tmp/perfetto-XXXXXXXX";
res.fd = mkstemp(temp_file);
-#endif
res.path = temp_file;
+#endif
PERFETTO_CHECK(res.fd > 0);
return res;
}
diff --git a/src/tracing/test/tracing_module.cc b/src/tracing/test/tracing_module.cc
index d2ade28..d6dff5d 100644
--- a/src/tracing/test/tracing_module.cc
+++ b/src/tracing/test/tracing_module.cc
@@ -25,9 +25,8 @@
// combined into the same program.
PERFETTO_TRACK_EVENT_STATIC_STORAGE_IN_NAMESPACE(tracing_module);
-PERFETTO_TRACK_EVENT_STATIC_STORAGE_IN_NAMESPACE_WITH_ATTRS(
- tracing_extra,
- PERFETTO_SDK_EXPORT);
+PERFETTO_TRACK_EVENT_STATIC_STORAGE_IN_NAMESPACE_WITH_ATTRS(tracing_extra,
+ [[maybe_unused]]);
namespace tracing_extra {
namespace {
diff --git a/src/tracing/test/tracing_module_categories.h b/src/tracing/test/tracing_module_categories.h
index 9b1dd7b..5b80a74 100644
--- a/src/tracing/test/tracing_module_categories.h
+++ b/src/tracing/test/tracing_module_categories.h
@@ -43,7 +43,7 @@
// linkage attributes.
PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS(
tracing_extra,
- PERFETTO_SDK_EXPORT,
+ [[maybe_unused]],
perfetto::Category("extra"),
perfetto::Category("extra2"));