Improved packet matching for tracing