Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f70680e9 authored by Corey Tabaka's avatar Corey Tabaka
Browse files

atrace: Poke PDX services using utility class.

Poke PDX services to enable tracing in stand-alone services.

Bug: 37432968
Test: build; run systrace with gfx flag; observe bufferhubd traces.
Change-Id: Id03a82fa51c6ca7c595ecc29c15a742295c53d46
parent 16f1c1a3
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -16,6 +16,9 @@ cc_binary {
        "libz",
        "libbase",
    ],
    static_libs: [
        "libpdx_default_transport",
    ],

    init_rc: ["atrace.rc"],

+4 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
#include <hidl/ServiceManagement.h>
#include <cutils/properties.h>

#include <pdx/default_transport/service_utility.h>
#include <utils/String8.h>
#include <utils/Timers.h>
#include <utils/Tokenizer.h>
@@ -48,6 +49,7 @@
#include <android-base/file.h>

using namespace android;
using pdx::default_transport::ServiceUtility;

using std::string;
#define NELEM(x) ((int) (sizeof(x) / sizeof((x)[0])))
@@ -814,6 +816,7 @@ static bool setUpTrace()
    ok &= setAppCmdlineProperty(&packageList[0]);
    ok &= pokeBinderServices();
    pokeHalServices();
    ok &= ServiceUtility::PokeServices();

    // Disable all the sysfs enables.  This is done as a separate loop from
    // the enables to allow the same enable to exist in multiple categories.
@@ -851,6 +854,7 @@ static void cleanUpTrace()
    setTagsProperty(0);
    clearAppProperties();
    pokeBinderServices();
    ServiceUtility::PokeServices();

    // Set the options back to their defaults.
    setTraceOverwriteEnable(true);