This stored procedure is an alternative to using SQL Profiler to create a script to create a trace.
support.microsoft.com