Revert "Fix check for whether a trace tag is enabled"
Revert submission 26575765-is_tag_enabled
Reason for revert: Droid-monitored triggered revert due to breakage in b/330172681. Will be verifying through ABTD before submission.
Reverted changes: /q/submissionid:26575765-is_tag_enabled
Change-Id: I870c6e3edaada40e44ce843cb343619f73b1a42d
diff --git a/libs/tracing_perfetto/include/tracing_perfetto.h b/libs/tracing_perfetto/include/tracing_perfetto.h
index 2c1c2a4..4e3c83f 100644
--- a/libs/tracing_perfetto/include/tracing_perfetto.h
+++ b/libs/tracing_perfetto/include/tracing_perfetto.h
@@ -46,7 +46,7 @@
Result traceCounter(uint64_t category, const char* name, int64_t value);
-bool isTagEnabled(uint64_t category);
+uint64_t getEnabledCategories();
} // namespace tracing_perfetto
diff --git a/libs/tracing_perfetto/tracing_perfetto.cpp b/libs/tracing_perfetto/tracing_perfetto.cpp
index 6f716ee..19d1eb6 100644
--- a/libs/tracing_perfetto/tracing_perfetto.cpp
+++ b/libs/tracing_perfetto/tracing_perfetto.cpp
@@ -130,13 +130,12 @@
}
}
-bool isTagEnabled(uint64_t category) {
- struct PerfettoTeCategory* perfettoTeCategory =
- internal::toPerfettoCategory(category);
- if (perfettoTeCategory != nullptr) {
- return true;
+uint64_t getEnabledCategories() {
+ if (internal::isPerfettoRegistered()) {
+ // TODO(b/303199244): Return only enabled categories and not all registered ones
+ return internal::getDefaultCategories();
} else {
- return (atrace_get_enabled_tags() & category) != 0;
+ return atrace_get_enabled_tags();
}
}