Simplify utils
This commit is contained in:
parent
f489192a7c
commit
5bd910a322
1 changed files with 1 additions and 12 deletions
|
@ -24,17 +24,6 @@ const char * _demangle_symbol(const char * mangled);
|
||||||
|
|
||||||
const char * _get_symbol_funcptr(void * funcptr);
|
const char * _get_symbol_funcptr(void * funcptr);
|
||||||
|
|
||||||
template<typename T, typename ... U>
|
|
||||||
const char * _get_symbol_non_funcptr(std::function<T(U...)> f)
|
|
||||||
{
|
|
||||||
#if defined(TRACETOOLS_LTTNG_ENABLED) && !defined(_WIN32)
|
|
||||||
return _demangle_symbol(f.target_type().name());
|
|
||||||
#else
|
|
||||||
(void)f;
|
|
||||||
return SYMBOL_UNKNOWN;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T, typename ... U>
|
template<typename T, typename ... U>
|
||||||
const char * get_symbol(std::function<T(U...)> f)
|
const char * get_symbol(std::function<T(U...)> f)
|
||||||
{
|
{
|
||||||
|
@ -47,7 +36,7 @@ const char * get_symbol(std::function<T(U...)> f)
|
||||||
return _get_symbol_funcptr(funcptr);
|
return _get_symbol_funcptr(funcptr);
|
||||||
}
|
}
|
||||||
// Otherwise we have to go through target_type()
|
// Otherwise we have to go through target_type()
|
||||||
return _get_symbol_non_funcptr(f);
|
return _demangle_symbol(f.target_type().name());
|
||||||
#else
|
#else
|
||||||
(void)f;
|
(void)f;
|
||||||
return SYMBOL_UNKNOWN;
|
return SYMBOL_UNKNOWN;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue