Merge "changelog: include key fix to ftrace bugfix of absolute timestamps"
diff --git a/BUILD b/BUILD
index 2cfc776..1ef9c2d 100644
--- a/BUILD
+++ b/BUILD
@@ -186,6 +186,22 @@
     ] + PERFETTO_CONFIG.deps.protobuf_full,
 )
 
+# GN target: //tools/proto_merger:proto_merger
+perfetto_cc_binary(
+    name = "proto_merger",
+    srcs = [
+        "tools/proto_merger/allowlist.h",
+        "tools/proto_merger/main.cc",
+        "tools/proto_merger/proto_file.cc",
+        "tools/proto_merger/proto_file.h",
+        "tools/proto_merger/proto_merger.cc",
+        "tools/proto_merger/proto_merger.h",
+    ],
+    deps = [
+        ":src_base_base",
+    ] + PERFETTO_CONFIG.deps.protobuf_full,
+)
+
 # GN target: //:libperfetto
 perfetto_cc_library(
     name = "libperfetto",
diff --git a/tools/gen_bazel b/tools/gen_bazel
index 5a80506..61396cc 100755
--- a/tools/gen_bazel
+++ b/tools/gen_bazel
@@ -71,6 +71,7 @@
     '//src/protozero/protoc_plugin:protozero_plugin',
     '//src/protozero/protoc_plugin:cppgen_plugin',
     '//tools/proto_filter:proto_filter',
+    '//tools/proto_merger:proto_merger',
 ] + public_targets
 
 # Root proto targets (to force discovery of intermediate proto targets).
diff --git a/tools/proto_merger/proto_merger.cc b/tools/proto_merger/proto_merger.cc
index e9305d7..c362d59 100644
--- a/tools/proto_merger/proto_merger.cc
+++ b/tools/proto_merger/proto_merger.cc
@@ -33,6 +33,7 @@
 
 // Finds the given 'name' in the vector by comparing against
 // the field named 'name' for each item in the vector.
+// T is ProtoFile::Enum, ProtoFile::Oneof or ProtoFile::Message.
 template <typename T>
 const T* FindByName(const std::vector<T>& items, const std::string& name) {
   for (const auto& item : items) {
@@ -44,6 +45,7 @@
 
 // Compute the items present in the |input| vector but deleted in
 // the |upstream| vector by looking at the field |name|.
+// T is ProtoFile::Enum, ProtoFile::Oneof or ProtoFile::Message.
 template <typename T>
 std::vector<T> ComputeDeletedByName(const std::vector<T>& input,
                                     const std::vector<T>& upstream) {
@@ -66,6 +68,7 @@
 
 // Finds the given 'number' in the vector by comparing against
 // the field named 'number for each item in the vector.
+// T is ProtoFile::EnumValue or ProtoFile::Field.
 template <typename T>
 const T* FindByNumber(const std::vector<T>& items, int number) {
   for (const auto& item : items) {
@@ -77,6 +80,7 @@
 
 // Compute the items present in the |input| vector but deleted in
 // the |upstream| vector by looking at the field |number|.
+// T is ProtoFile::EnumValue or ProtoFile::Field.
 template <typename T>
 std::vector<T> ComputeDeletedByNumber(const std::vector<T>& input,
                                       const std::vector<T>& upstream) {