Update HidlInstrumentor.
* Instead of dlsym method HIDL_INSTRUMENTATION_FUNCTION, dlsym
HIDL_INSTRUMENTATION_FUNCTION + insterface_name.
* This enables a single profiler library that contains the profiling
method for all the interfaces defined within the same hidl package.
Test: mma for hardware/interface.
local test with vts.
Change-Id: I076841ea8a565c489b45303e5ca496806d5d10be
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 3f7248c..7fb052b 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -838,7 +838,9 @@
const char *method,
std::vector<void *> *args)>;
- explicit HidlInstrumentor(const std::string &prefix);
+ explicit HidlInstrumentor(
+ const std::string &package,
+ const std::string &insterface);
virtual ~HidlInstrumentor();
protected:
@@ -870,7 +872,10 @@
// Flag whether to enable instrumentation.
bool mEnableInstrumentation;
// Prefix to lookup the instrumentation libraries.
- std::string mInstrumentationLibPrefix;
+ std::string mInstrumentationLibPackage;
+ // Used for dlsym to load the profiling method for given interface.
+ std::string mInterfaceName;
+
};
///////////////////// toString functions