The C++ Build Insights SDK is compatible with Visual Studio 2017 and above. To see the documentation for these versions, set the Visual Studio Version selector control for this article to Visual Studio 2017 or Visual Studio 2019. It's found at the top of the table of contents on this page.

The StopAndAnalyzeTracingSessionA function stops an ongoing tracing session and saves the resulting trace in a temporary file. An analysis session is then immediately started using the temporary file as an input. Executables calling this function must have administrator privileges.


enum RESULT_CODE StopAndAnalyzeTracingSessionA(
    const char*                 sessionName,
    const ANALYSIS_DESCRIPTOR*  analysisDescriptor);


The name of the tracing session to stop. Use the same session name as the one passed to StartTracingSession, StartTracingSessionA, or StartTracingSessionW.

Pointer to a TRACING_SESSION_STATISTICS object. StopAndAnalyzeTracingSessionA writes trace collection statistics in this object before returning.

Pointer to an ANALYSIS_DESCRIPTOR object. Use this object to configure the analysis session that's started by StopAndAnalyzeTracingSessionA.

Return Value

A result code from the RESULT_CODE enum.