Guard profiling function with context->profiling