Implement backtrace exclusion logic which is common for all libraries