Rename trace_filter field because it was broken

Before 9bccc2d649b8("Split packets in IPC-friendly-sized slices after
filtering"), setting a trace_filter could cause traced to crash.

Now the problem is fixed, but, in order to prevent a new configuration
(with a non-empty trace_filter) from crashing an old traced, this commit
renumbers the field.

Bug: 200028589
Change-Id: I9c0df14fa3690f2d47eb0eb36580631671d6fd46
diff --git a/CHANGELOG b/CHANGELOG
index 128093a..0861716 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,10 @@
   Tracing service and probes:
     * Removed DCHECK that would cause crashes when a debug build of the service
       is used with a producer built with -DNDEBUG.
+    * Changed the service-side field-level filtering configuration protobuf
+      field number, because the feature had a bug. This is effectively
+      equivalent to deprecating the feature and reintroducing it under a
+      different name.
   Trace Processor:
     * Added reqiurement of separating queries by semi-colon (;) followed by
       new-line when specifying a query file with -q to trace processor shell.
diff --git a/protos/perfetto/config/perfetto_config.proto b/protos/perfetto/config/perfetto_config.proto
index c173c1c..2394168 100644
--- a/protos/perfetto/config/perfetto_config.proto
+++ b/protos/perfetto/config/perfetto_config.proto
@@ -1490,7 +1490,7 @@
 // It contains the general config for the logging buffer(s) and the configs for
 // all the data source being enabled.
 //
-// Next id: 33.
+// Next id: 34.
 message TraceConfig {
   message BufferConfig {
     optional uint32 size_kb = 1;
@@ -1890,10 +1890,17 @@
   // provided. The filter is applied at ReadBuffers() time and works both in the
   // case of IPC readback and write_into_file. This filter can be generated
   // using `tools/proto_filter -s schema.proto -F filter_out.bytes` or
-  // `-T filter_out.escaped_string` (for .pbtx).
-  // Introduced in Android S. See go/trace-filtering for design.
-  message TraceFilter { optional bytes bytecode = 1; }
-  optional TraceFilter trace_filter = 32;
+  // `-T filter_out.escaped_string` (for .pbtx). See go/trace-filtering for
+  // design.
+  //
+  // Introduced in Android S, but it was broken (b/195065199). Reintroduced in
+  // Android T with a different field number.
+  message TraceFilter {
+    optional bytes bytecode = 1;
+  }
+  // old field number for trace_filter
+  reserved 32;
+  optional TraceFilter trace_filter = 33;
 }
 
 // End of protos/perfetto/config/trace_config.proto
diff --git a/protos/perfetto/config/trace_config.proto b/protos/perfetto/config/trace_config.proto
index dbc1bab..e845f17 100644
--- a/protos/perfetto/config/trace_config.proto
+++ b/protos/perfetto/config/trace_config.proto
@@ -16,17 +16,17 @@
 
 syntax = "proto2";
 
-import "protos/perfetto/config/data_source_config.proto";
-import "protos/perfetto/common/builtin_clock.proto";
-
 package perfetto.protos;
 
+import "protos/perfetto/common/builtin_clock.proto";
+import "protos/perfetto/config/data_source_config.proto";
+
 // The overall config that is used when starting a new tracing session through
 // ProducerPort::StartTracing().
 // It contains the general config for the logging buffer(s) and the configs for
 // all the data source being enabled.
 //
-// Next id: 33.
+// Next id: 34.
 message TraceConfig {
   message BufferConfig {
     optional uint32 size_kb = 1;
@@ -426,8 +426,15 @@
   // provided. The filter is applied at ReadBuffers() time and works both in the
   // case of IPC readback and write_into_file. This filter can be generated
   // using `tools/proto_filter -s schema.proto -F filter_out.bytes` or
-  // `-T filter_out.escaped_string` (for .pbtx).
-  // Introduced in Android S. See go/trace-filtering for design.
-  message TraceFilter { optional bytes bytecode = 1; }
-  optional TraceFilter trace_filter = 32;
+  // `-T filter_out.escaped_string` (for .pbtx). See go/trace-filtering for
+  // design.
+  //
+  // Introduced in Android S, but it was broken (b/195065199). Reintroduced in
+  // Android T with a different field number.
+  message TraceFilter {
+    optional bytes bytecode = 1;
+  }
+  // old field number for trace_filter
+  reserved 32;
+  optional TraceFilter trace_filter = 33;
 }
diff --git a/protos/perfetto/trace/perfetto_trace.proto b/protos/perfetto/trace/perfetto_trace.proto
index e8c019e..b8f69c5 100644
--- a/protos/perfetto/trace/perfetto_trace.proto
+++ b/protos/perfetto/trace/perfetto_trace.proto
@@ -1490,7 +1490,7 @@
 // It contains the general config for the logging buffer(s) and the configs for
 // all the data source being enabled.
 //
-// Next id: 33.
+// Next id: 34.
 message TraceConfig {
   message BufferConfig {
     optional uint32 size_kb = 1;
@@ -1890,10 +1890,17 @@
   // provided. The filter is applied at ReadBuffers() time and works both in the
   // case of IPC readback and write_into_file. This filter can be generated
   // using `tools/proto_filter -s schema.proto -F filter_out.bytes` or
-  // `-T filter_out.escaped_string` (for .pbtx).
-  // Introduced in Android S. See go/trace-filtering for design.
-  message TraceFilter { optional bytes bytecode = 1; }
-  optional TraceFilter trace_filter = 32;
+  // `-T filter_out.escaped_string` (for .pbtx). See go/trace-filtering for
+  // design.
+  //
+  // Introduced in Android S, but it was broken (b/195065199). Reintroduced in
+  // Android T with a different field number.
+  message TraceFilter {
+    optional bytes bytecode = 1;
+  }
+  // old field number for trace_filter
+  reserved 32;
+  optional TraceFilter trace_filter = 33;
 }
 
 // End of protos/perfetto/config/trace_config.proto