tp: implement native support for the glob operator

This CL adds a class to parse and match UNIX globs inside trace
processor. This can be used to implement native support for SQL globs,
significantly improving the performance of real world trace
processor queries.

This CL does not perform the integration with filtering yet: that will
be done in a follow-up to allow easy reverts if necessary.

Bug: 249961301
Change-Id: I581a1a8ae615113082ecff79f3d488ac397d18b6
diff --git a/Android.bp b/Android.bp
index 5b76850..4f9a16ab 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1985,6 +1985,7 @@
         ":perfetto_src_trace_processor_tables_tables",
         ":perfetto_src_trace_processor_types_types",
         ":perfetto_src_trace_processor_util_descriptors",
+        ":perfetto_src_trace_processor_util_glob",
         ":perfetto_src_trace_processor_util_gzip",
         ":perfetto_src_trace_processor_util_interned_message_view",
         ":perfetto_src_trace_processor_util_profile_builder",
@@ -9667,6 +9668,14 @@
     ],
 }
 
+// GN: //src/trace_processor/util:glob
+filegroup {
+    name: "perfetto_src_trace_processor_util_glob",
+    srcs: [
+        "src/trace_processor/util/glob.cc",
+    ],
+}
+
 // GN: //src/trace_processor/util:gzip
 filegroup {
     name: "perfetto_src_trace_processor_util_gzip",
@@ -9727,6 +9736,7 @@
     name: "perfetto_src_trace_processor_util_unittests",
     srcs: [
         "src/trace_processor/util/debug_annotation_parser_unittest.cc",
+        "src/trace_processor/util/glob_unittest.cc",
         "src/trace_processor/util/gzip_utils_unittest.cc",
         "src/trace_processor/util/proto_profiler_unittest.cc",
         "src/trace_processor/util/proto_to_args_parser_unittest.cc",
@@ -11051,6 +11061,7 @@
         ":perfetto_src_trace_processor_types_unittests",
         ":perfetto_src_trace_processor_unittests",
         ":perfetto_src_trace_processor_util_descriptors",
+        ":perfetto_src_trace_processor_util_glob",
         ":perfetto_src_trace_processor_util_gzip",
         ":perfetto_src_trace_processor_util_interned_message_view",
         ":perfetto_src_trace_processor_util_profile_builder",
@@ -11680,6 +11691,7 @@
         ":perfetto_src_trace_processor_tables_tables",
         ":perfetto_src_trace_processor_types_types",
         ":perfetto_src_trace_processor_util_descriptors",
+        ":perfetto_src_trace_processor_util_glob",
         ":perfetto_src_trace_processor_util_gzip",
         ":perfetto_src_trace_processor_util_interned_message_view",
         ":perfetto_src_trace_processor_util_profile_builder",
@@ -11866,6 +11878,7 @@
         ":perfetto_src_trace_processor_tables_tables",
         ":perfetto_src_trace_processor_types_types",
         ":perfetto_src_trace_processor_util_descriptors",
+        ":perfetto_src_trace_processor_util_glob",
         ":perfetto_src_trace_processor_util_gzip",
         ":perfetto_src_trace_processor_util_interned_message_view",
         ":perfetto_src_trace_processor_util_profile_builder",