Merge "ui: Add Steve to OWNERS"
diff --git a/include/perfetto/tracing/internal/track_event_data_source.h b/include/perfetto/tracing/internal/track_event_data_source.h
index 32993ac..784cf84 100644
--- a/include/perfetto/tracing/internal/track_event_data_source.h
+++ b/include/perfetto/tracing/internal/track_event_data_source.h
@@ -557,9 +557,8 @@
// The DecayArgType method is used to avoid unnecessary instantiations of
// templates on:
// * string constants of different sizes.
- // * integers of different sizes or constness.
- // * floats of different sizes.
- // This allows to avoid extra instantiations of TraceForCategory templates.
+ // * primitive of different constness (or references).
+ // This avoids extra instantiations of TraceForCategory templates.
template <typename T>
static T&& DecayArgType(T&& t) {
return std::forward<T>(t);
@@ -567,15 +566,15 @@
static const char* DecayArgType(const char* s) { return s; }
static uint64_t DecayArgType(uint64_t u) { return u; }
- static uint64_t DecayArgType(uint32_t u) { return u; }
- static uint64_t DecayArgType(uint16_t u) { return u; }
- static uint64_t DecayArgType(uint8_t u) { return u; }
+ static uint32_t DecayArgType(uint32_t u) { return u; }
+ static uint16_t DecayArgType(uint16_t u) { return u; }
+ static uint8_t DecayArgType(uint8_t u) { return u; }
static int64_t DecayArgType(int64_t i) { return i; }
- static int64_t DecayArgType(int32_t i) { return i; }
- static int64_t DecayArgType(int16_t i) { return i; }
- static int64_t DecayArgType(int8_t i) { return i; }
+ static int32_t DecayArgType(int32_t i) { return i; }
+ static int16_t DecayArgType(int16_t i) { return i; }
+ static int8_t DecayArgType(int8_t i) { return i; }
static bool DecayArgType(bool b) { return b; }
- static double DecayArgType(float f) { return static_cast<double>(f); }
+ static float DecayArgType(float f) { return f; }
static double DecayArgType(double f) { return f; }
// Once we've determined tracing to be enabled for this category, actually
@@ -699,7 +698,7 @@
perfetto::protos::pbzero::TrackEvent::Type type,
CounterTrack track,
TimestampType timestamp,
- ValueType value) PERFETTO_ALWAYS_INLINE {
+ ValueType value) PERFETTO_NO_INLINE {
PERFETTO_DCHECK(type == perfetto::protos::pbzero::TrackEvent::TYPE_COUNTER);
TraceForCategoryImpl(
instances, category, /*name=*/nullptr, type, track, timestamp,
diff --git a/protos/perfetto/trace/test_extensions.proto b/protos/perfetto/trace/test_extensions.proto
index dca2db6..0d33c09 100644
--- a/protos/perfetto/trace/test_extensions.proto
+++ b/protos/perfetto/trace/test_extensions.proto
@@ -31,6 +31,7 @@
repeated int32 int_extension_for_testing = 9901;
optional string omitted_extension_for_testing = 9902;
optional TestExtensionChild nested_message_extension_for_testing = 9903;
+ optional uint32 uint_extension_for_testing = 9904;
}
}
diff --git a/src/tracing/test/api_integrationtest.cc b/src/tracing/test/api_integrationtest.cc
index be2a27c..18d302c 100644
--- a/src/tracing/test/api_integrationtest.cc
+++ b/src/tracing/test/api_integrationtest.cc
@@ -3092,13 +3092,15 @@
TRACE_EVENT(
"test", "TestEventWithExtensionArgs",
perfetto::protos::pbzero::TestExtension::kIntExtensionForTesting,
- std::vector<int>{42});
+ std::vector<int>{42},
+ perfetto::protos::pbzero::TestExtension::kUintExtensionForTesting, 42u);
}
std::vector<char> raw_trace = StopSessionAndReturnBytes(tracing_session);
EXPECT_GE(raw_trace.size(), 0u);
- bool found_extension = false;
+ bool found_int_extension = false;
+ bool found_uint_extension = false;
perfetto::protos::pbzero::Trace_Decoder trace(
reinterpret_cast<uint8_t*>(raw_trace.data()), raw_trace.size());
@@ -3116,12 +3118,17 @@
f = decoder.ReadField()) {
if (f.id() == perfetto::protos::pbzero::TestExtension::
FieldMetadata_IntExtensionForTesting::kFieldId) {
- found_extension = true;
+ found_int_extension = true;
+ } else if (f.id() ==
+ perfetto::protos::pbzero::TestExtension::
+ FieldMetadata_UintExtensionForTesting::kFieldId) {
+ found_uint_extension = true;
}
}
}
- EXPECT_TRUE(found_extension);
+ EXPECT_TRUE(found_int_extension);
+ EXPECT_TRUE(found_uint_extension);
}
TEST_P(PerfettoApiTest, TrackEventInstant) {