sim: trace: add WITH_TRACE_ANY_P helper