/art/runtime/art_method.cc
const void* ArtMethod::RegisterNative(const void* native_method) {
CHECK(IsNative()) << PrettyMethod();
CHECK(native_method != nullptr) << PrettyMethod();
void* new_native_method = nullptr;
// add start
int pid = getpid();
LOG(INFO) << "YoohaLog: {\"Type\":\"NativeLog\",\"PID\":\"" << pid << "\",\"Info\":\"<ArtMethod::RegisterNative>:name=" << this->PrettyMethod() << " addr=" << native_method << "\"}";
// add end
Runtime::Current()->GetRuntimeCallbacks()->RegisterNativeMethod(this,
native_method,
/*out*/&new_native_method);
SetEntryPointFromJni(new_native_method);
return new_native_method;
}
效果图: