The dynamic rules filter can do all the filtering that the static filter does—and more—but it isn't as quick. This filter lets you register functions (event handlers) that decide whether or not to log a given event.
TraceEvent(_NTO_TRACE_ADDCLASS, _NTO_TRACE_THREAD):
For an example of using the dynamic rules filter, see the eh_simple.c example in the Tutorials chapter.