Use TraceFunc instead of set_trace_func