Support perfetto track_event prefer

Trace.java now supports per-category tracing to perfetto if specified
in the config. When we trace to perfetto, the event will be missing from
the ftrace buffer. This means that a concurrent session that has the
same category enabled for atrace will be missing the atrace event.
To avoid this, the config can specify that the perfetto event can be
preferred. This means that despite the category being enabled for
atrace, we will trace to perfetto if the category is enabled there.

By default, the perfetto event is not preferred, but it can be preferred
explicitly in the config with atrace_categories_prefer_track_event.

Bug: 303199244
Test: atest libtracing_perfetto_tests
Flag: android.os.flags.perfetto_sdk_tracing
Change-Id: Idf7cfc7c7f9c8ac4191cabff3d958926606f564b
diff --git a/libs/tracing_perfetto/tests/utils.h b/libs/tracing_perfetto/tests/utils.h
index 4353554..8edb414 100644
--- a/libs/tracing_perfetto/tests/utils.h
+++ b/libs/tracing_perfetto/tests/utils.h
@@ -74,10 +74,6 @@
   class Builder {
    public:
     Builder() = default;
-    Builder& set_data_source_name(std::string data_source_name) {
-      data_source_name_ = std::move(data_source_name);
-      return *this;
-    }
     Builder& add_enabled_category(std::string category) {
       enabled_categories_.push_back(std::move(category));
       return *this;
@@ -86,12 +82,21 @@
       disabled_categories_.push_back(std::move(category));
       return *this;
     }
+    Builder& add_atrace_category(std::string category) {
+      atrace_categories_.push_back(std::move(category));
+      return *this;
+    }
+    Builder& add_atrace_category_prefer_sdk(std::string category) {
+      atrace_categories_prefer_sdk_.push_back(std::move(category));
+      return *this;
+    }
     TracingSession Build();
 
    private:
-    std::string data_source_name_;
     std::vector<std::string> enabled_categories_;
     std::vector<std::string> disabled_categories_;
+    std::vector<std::string> atrace_categories_;
+    std::vector<std::string> atrace_categories_prefer_sdk_;
   };
 
   static TracingSession Adopt(struct PerfettoTracingSessionImpl*);