From 7812b11f9b6cf7ddefbff211c3b6ec81373f9c59 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Thu, 7 Aug 2025 21:16:01 +0000 Subject: [PATCH] util/perf: amend missing atrace_init When perfetto isn't enabled, atrace can still be used freely on Android. All trace micros have accounted for that, but the init is missed. Cc: mesa-stable Acked-by: Mike Blumenkrantz Part-of: (cherry picked from commit e74516dbc7f8843a95ef57fed5630986c154918e) --- .pick_status.json | 2 +- src/util/perf/cpu_trace.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index fed0b0ec659..b7e5a46773b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5354,7 +5354,7 @@ "description": "util/perf: amend missing atrace_init", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/util/perf/cpu_trace.h b/src/util/perf/cpu_trace.h index 8ce3e8d0aa7..5c7133e5d56 100644 --- a/src/util/perf/cpu_trace.h +++ b/src/util/perf/cpu_trace.h @@ -204,7 +204,12 @@ _mesa_trace_scope_end(UNUSED void **scope) static inline void util_cpu_trace_init() { +#if defined(HAVE_PERFETTO) util_perfetto_init(); +#elif DETECT_OS_ANDROID && !defined(__cplusplus) + atrace_init(); +#endif /* HAVE_PERFETTO */ + util_gpuvis_init(); }