virtual void onZygoteInit() { if (PTR_atrace_set_tracing_enabled != NULL) { // Re-enable tracing now that we're no longer in Zygote. PTR_atrace_set_tracing_enabled(true); } sp<ProcessState> proc = ProcessState::self(); ALOGV("App process: starting thread pool.\n"); proc->startThreadPool(); }
void _atrace_set_tracing_enabled(bool enabled) { if (xposed::getSdkVersion() < 18) return; dlerror(); // Clear existing errors void (*PTR_atrace_set_tracing_enabled)(bool); *(void **) (&PTR_atrace_set_tracing_enabled) = dlsym(RTLD_DEFAULT, "atrace_set_tracing_enabled"); const char *error; if ((error = dlerror()) != NULL) { ALOGE("Could not find address for function atrace_set_tracing_enabled: %s", error); } else { PTR_atrace_set_tracing_enabled(enabled); } }