Enabling Tracing to Investigate Performance Issues

Install a debug build of StyleCop (like 4.6.2.0-debug.msi)

load devenv.exe.config into notepad (it'll most likely be in %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE )

add an appSetiings section like:

<configuration>
  <appSettings>
    <add key="StyleCopTraceLogPath" value="d:\logs" />
    <add key="StyleCopTraceLevel" value="15" />
  </appSettings>
  <system.diagnostics>
    <trace autoflush="true" />
  </system.diagnostics>
<configuration>

Load a solution, open a cs file.

Right click and run StyleCop.

Open the log file.

You'll see entries like:

2011-09-02 07:44:27Z : PB = 370675712 : StyleCop\andy : In   : ---------- StyleCop.VisualStudio.PackageCommandSet.InvokeAnalyzeThisFile(sender={ce99db75-e6a6-41c9-9091-434390724fac : 304 : Supported|Enabled|Visible})
2011-09-02 07:44:27Z : PB = 370683904 : StyleCop\andy : In   : ------------ StyleCop.VisualStudio.AnalysisHelper.Analyze(full=False, type={File})
2011-09-02 07:44:27Z : PB = 354746368 : StyleCop\andy : In   : ---- StyleCop.VisualStudio.AnalysisThread.AnalyzeProc()
2011-09-02 07:44:27Z : PB = 354746368 : StyleCop\andy : Out  : ------------ StyleCop.VisualStudio.AnalysisHelper.Analyze()
2011-09-02 07:44:27Z : PB = 355303424 : StyleCop\andy : Out  : ---------- StyleCop.VisualStudio.PackageCommandSet.InvokeAnalyzeThisFile()
2011-09-02 07:44:27Z : PB = 355303424 : StyleCop\andy : In   : ----- StyleCop.StyleCopCore.Analyze(projects=[List<CodeProject>: Count = 1])
2011-09-02 07:44:27Z : PB = 355303424 : StyleCop\andy : In   : ------ StyleCop.StyleCopCore.Analyze(projects=[List<CodeProject>: Count = 1], ignoreCache=False, settingsPath=<null>)
2011-09-02 07:44:27Z : PB = 355344384 : StyleCop\andy : In   : ------- StyleCop.StyleCopCore.RunWorkerThreads(data=[Data], count=1)
2011-09-02 07:44:27Z : PB = 355344384 : StyleCop\andy : In   : ----------- StyleCop.StyleCopThread.DoWork(sender={System.ComponentModel.BackgroundWorker}, e=[DoWorkEventArgs])
2011-09-02 07:44:27Z : PB = 356671488 : StyleCop\andy : Out  : ----------- StyleCop.StyleCopThread.DoWork()
2011-09-02 07:44:27Z : PB = 356671488 : StyleCop\andy : Out  : ------- StyleCop.StyleCopCore.RunWorkerThreads()=True
2011-09-02 07:44:27Z : PB = 356671488 : StyleCop\andy : Out  : ------ StyleCop.StyleCopCore.Analyze()
2011-09-02 07:44:27Z : PB = 356671488 : StyleCop\andy : Out  : ----- StyleCop.StyleCopCore.Analyze()
2011-09-02 07:44:27Z : PB = 356675584 : StyleCop\andy : In   : ----- StyleCop.VisualStudio.AnalysisHelper.AnalyzeComplete(sender=[AnalysisThread], e=[EventArgs])
2011-09-02 07:44:27Z : PB = 356700160 : StyleCop\andy : In   : --------------- StyleCop.VisualStudio.AnalysisHelper.AnalyzeCompleteMain(sender=[AnalysisThread], e=[EventArgs])
2011-09-02 07:44:27Z : PB = 356700160 : StyleCop\andy : In   : ---------------- StyleCop.VisualStudio.FileAnalysisHelper.ProvideEndAnalysisResult(violations=[List<ViolationInfo>: Count = 1234])
2011-09-02 07:44:27Z : PB = 356700160 : StyleCop\andy : In   : ----------------- StyleCop.VisualStudio.TaskProvider.AddResults(violations=[List<ViolationInfo>: Count = 1234])
2011-09-02 07:44:27Z : PB = 359211008 : StyleCop\andy : Out  : ----------------- StyleCop.VisualStudio.TaskProvider.AddResults()
2011-09-02 07:44:28Z : PB = 342036480 : StyleCop\andy : Out  : ---------------- StyleCop.VisualStudio.FileAnalysisHelper.ProvideEndAnalysisResult()
2011-09-02 07:44:28Z : PB = 342036480 : StyleCop\andy : Out  : --------------- StyleCop.VisualStudio.AnalysisHelper.AnalyzeCompleteMain()
2011-09-02 07:44:28Z : PB = 342036480 : StyleCop\andy : Out  : ----- StyleCop.VisualStudio.AnalysisHelper.AnalyzeComplete()
2011-09-02 07:44:28Z : PB = 342036480 : StyleCop\andy : Out  : ---- StyleCop.VisualStudio.AnalysisThread.AnalyzeProc()


This shows date/time of entry, the privatebytes currently in use in the process, the user and which function was entered/exited.

Last edited Sep 2, 2011 at 7:57 AM by andyr, version 3