tracing: Fix selftest function recursion accounting