summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/tracing_perfetto/include/tracing_perfetto.h2
-rw-r--r--libs/tracing_perfetto/tracing_perfetto.cpp11
2 files changed, 6 insertions, 7 deletions
diff --git a/libs/tracing_perfetto/include/tracing_perfetto.h b/libs/tracing_perfetto/include/tracing_perfetto.h
index 2c1c2a49e7..4e3c83fca3 100644
--- a/libs/tracing_perfetto/include/tracing_perfetto.h
+++ b/libs/tracing_perfetto/include/tracing_perfetto.h
@@ -46,7 +46,7 @@ Result traceInstantForTrack(uint64_t category, const char* trackName,
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 6f716eea9a..19d1eb639e 100644
--- a/libs/tracing_perfetto/tracing_perfetto.cpp
+++ b/libs/tracing_perfetto/tracing_perfetto.cpp
@@ -130,13 +130,12 @@ Result traceCounter(uint64_t category, const char* name, int64_t value) {
}
}
-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();
}
}