diff options
author | Brian Carlstrom <bdc@google.com> | 2018-01-24 19:22:30 -0800 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2018-01-24 19:53:36 -0800 |
commit | 3f2d71fb2d37bbcd9c6e9bafe8262988001d64c3 (patch) | |
tree | 2a1e867782ade50fdf59dcd096625487f0575ef0 /renderscript | |
parent | b0f5034e87697538bc8790faed1d7b365fdefa0b (diff) | |
download | android_hardware_interfaces-3f2d71fb2d37bbcd9c6e9bafe8262988001d64c3.tar.gz android_hardware_interfaces-3f2d71fb2d37bbcd9c6e9bafe8262988001d64c3.tar.bz2 android_hardware_interfaces-3f2d71fb2d37bbcd9c6e9bafe8262988001d64c3.zip |
Log dlerror on dlopen related failures
Bug: 72300913
Bug: 72342986
Bug: 72462122
Test: manually confirmed logging on failure
Change-Id: I401587311e5c3e3d1ef69516645ebb2dd4479c51
Diffstat (limited to 'renderscript')
-rw-r--r-- | renderscript/1.0/default/Android.bp | 2 | ||||
-rw-r--r-- | renderscript/1.0/default/Context.cpp | 2 | ||||
-rw-r--r-- | renderscript/1.0/default/Device.cpp | 7 |
3 files changed, 8 insertions, 3 deletions
diff --git a/renderscript/1.0/default/Android.bp b/renderscript/1.0/default/Android.bp index b9969697f..d5d6d8d3e 100644 --- a/renderscript/1.0/default/Android.bp +++ b/renderscript/1.0/default/Android.bp @@ -12,7 +12,7 @@ cc_library_shared { ], shared_libs: [ "libdl", - "liblog", + "libbase", "libhidlbase", "libhidltransport", "libutils", diff --git a/renderscript/1.0/default/Context.cpp b/renderscript/1.0/default/Context.cpp index fbfc6522c..f5b70c9fa 100644 --- a/renderscript/1.0/default/Context.cpp +++ b/renderscript/1.0/default/Context.cpp @@ -1,5 +1,3 @@ -#define LOG_TAG "android.hardware.renderscript@1.0-impl" - #include "Context.h" #include "Device.h" diff --git a/renderscript/1.0/default/Device.cpp b/renderscript/1.0/default/Device.cpp index a2b950ded..8fda3ff1e 100644 --- a/renderscript/1.0/default/Device.cpp +++ b/renderscript/1.0/default/Device.cpp @@ -1,6 +1,7 @@ #include "Context.h" #include "Device.h" +#include <android-base/logging.h> #include <android/dlext.h> #include <dlfcn.h> @@ -54,12 +55,18 @@ dispatchTable loadHAL() { .flags = ANDROID_DLEXT_USE_NAMESPACE, .library_namespace = rsNamespace, }; handle = android_dlopen_ext(filename, RTLD_LAZY | RTLD_LOCAL, &dlextinfo); + if (handle == nullptr) { + LOG(WARNING) << "android_dlopen_ext(" << filename << ") failed: " << dlerror(); + } } } if (handle == nullptr) { // if there is no "rs" namespace (in case when this HAL impl is loaded // into a vendor process), then use the plain dlopen. handle = dlopen(filename, RTLD_LAZY | RTLD_LOCAL); + if (handle == nullptr) { + LOG(FATAL) << "dlopen(" << filename << ") failed: " << dlerror(); + } } dispatchTable dispatchHal = { |