Fast method for collecting stack traces