From 9ee90ceb9715808f7d28a360d7f3ed9aede2714d Mon Sep 17 00:00:00 2001 From: Lingfeng Yang Date: Mon, 28 Sep 2020 18:56:23 -0700 Subject: Make it easier to locally unit test guest/host combined tracing Change-Id: If7c24e1ac9fa50dba8b85fc12274ecd75fea0e01 --- system/OpenglSystemCommon/HostConnection.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'system/OpenglSystemCommon/HostConnection.cpp') diff --git a/system/OpenglSystemCommon/HostConnection.cpp b/system/OpenglSystemCommon/HostConnection.cpp index 7d309fbd..7ddf277f 100644 --- a/system/OpenglSystemCommon/HostConnection.cpp +++ b/system/OpenglSystemCommon/HostConnection.cpp @@ -17,6 +17,10 @@ #include "cutils/properties.h" +#ifdef HOST_BUILD +#include "android/base/Tracing.h" +#endif + #ifdef GOLDFISH_NO_GL struct gl_client_context_t { int placeholder; @@ -359,7 +363,11 @@ HostConnection::HostConnection() : m_grallocOnly(true), m_noHostError(true), m_rendernodeFd(-1), - m_rendernodeFdOwned(false) { } + m_rendernodeFdOwned(false) { +#ifdef HOST_BUILD + android::base::initializeTracing(); +#endif +} HostConnection::~HostConnection() { -- cgit v1.2.3