libcsdbg  1.28
C++ exception (and generic) stack trace debug library
const plugin * csdbg::tracer::get_plugin ( const i8 path) const
virtual

Get a registered plugin module (DSO)

Parameters
[in]paththe path of the module file
Returns
the plugin or NULL if no such plugin module is registered

Definition at line 967 of file tracer.cpp.

References __D_ASSERT, likely, csdbg::util::lock(), m_plugins, csdbg::plugin::path(), unlikely, and csdbg::util::unlock().

Referenced by csdbg::__cyg_profile_func_enter(), and csdbg::__cyg_profile_func_exit().

968 {
969  __D_ASSERT(path != NULL);
970  if ( unlikely(path == NULL) )
971  return NULL;
972 
973  util::lock();
974  for (u32 i = 0, sz = m_plugins->size(); likely(i < sz); i++) {
975  const plugin *plg = m_plugins->at(i);
976 
977  /* If this is an inline plugin */
978  if ( unlikely(plg->path() == NULL) )
979  continue;
980 
981  if ( unlikely(strcmp(plg->path(), path) == 0) ) {
982  util::unlock();
983  return plg;
984  }
985  }
986 
987  util::unlock();
988  return NULL;
989 }
chain< plugin > * m_plugins
Instrumentation plugins.
Definition: tracer.hpp:48
#define likely(expr)
Offer a hint (positive) to the pipeline branch predictor.
Definition: config.hpp:344
static void lock()
Lock the global access mutex.
Definition: util.cpp:397
static void unlock()
Unlock the global access mutex.
Definition: util.cpp:406
unsigned int u32
32-bit unsigned integer
Definition: config.hpp:102
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349
#define __D_ASSERT(x)
Assertion macro.
Definition: config.hpp:268

+ Here is the call graph for this function:

+ Here is the caller graph for this function: