User definable tracing API