I need to check whether my application is accelerated by running under OpenOnload or not. The restriction is that no Onload specific API can be used - app is not linked with Onload extensions library.
How this can be done?
I need to check whether my application is accelerated by running under OpenOnload or not. The restriction is that no Onload specific API can be used - app is not linked with Onload extensions library.
How this can be done?
On
Just search the symbol "onload_is_present" using the default shared object search order and if onload is pre-loaded it will return a valid address.
bool IsOnloadPresent()
{
void* pIsOnloadPresent = dlsym(RTLD_DEFAULT, "onload_is_present");
if(pIsOnloadPresent == NULL)
return false;
return true;
}
OpenOnload can be detected by pre-loaded shared library presence
libonload.so.In this case your application environment will contain
LD_PRELOAD=libonload.sostring.Or you can just enumerate all loaded shared libraries and check for
libonload.so.