Profiler gathers no information

Questions about YourKit .NET Profiler
Post Reply
andnaess
Posts: 2
Joined: Tue May 27, 2008 8:05 am

Profiler gathers no information

Post by andnaess »

Hi

I've got a small console app in VS2008 that I'm using to benchmark some code. Unfortunately YourKit doesn't give any information. I first tried just running the app (no debug), but it didn't even show up in the list of apps in YourKit. (I had set application startup to tracing). Next I started the application with debugging, and this time it showed up, but when I connected to it and saved the output there were almost nothing in the method list.

As a final attempt, I rewrote the main method as an infinite loop and added a breakpoint at the first line. As soon as the breakpoint was hit I connected to the app in YourKit, and let it loose. It ran, and the CPU chart in YourKit showed the CPU doing lots of work. Then I did "Capture snapshot".

But the snapshot still contains NO trace of my code. This is typically what it looks like (Call tree by thread):

Name Time (ms)
Unnamed#1
78 100 %
System.AppDomain.SetDefaultDomainManager(String, String[], String[])
78 100 %
vshost.RunParkingWindow
31 100 %
System.Threading.ThreadHelper.ThreadStart()
31 100 %
.NET SystemEvents
15 100 %
System.Threading.ThreadHelper.ThreadStart()
15 100 %

The method list contains two methods:

System.AppDomain.SetDefaultDomainManager(String, String[], String[])
System.Threading.ThreadHelper.ThreadStart()

What's going on?
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Post by Vladimir Kondratyev »

andnaess, profiler shows only methods which consume more than 1 ms of CPU time. All other methods are filtered. If your test is very short then it's possible that it's the reason.

The second reason why some methods can be invisible is "Filters". Please read about filters in the Help http://www.yourkit.com/docs/net30/help/filters.jsp.

Otherwise, please send us your test application to support(at)yourkit.com

Best regards,
Vladimir Kondratyev
YourKit, LLC
http://www.yourkit.com
"Don't get lost in data, get information!"
andnaess
Posts: 2
Joined: Tue May 27, 2008 8:05 am

Post by andnaess »

Thanks for a quick answer.

Filters. That was the problem. YourKit by default collapses methods that run under the "System" namespace. But when I run a main() from VS2008, it is executed by System.AppDomain.ExecuteAssembly(), and all my code is thus lost. Maybe you should warn about this, or include it in your manual? I would guess that a lot of people would use the Console Application project to quickly test some code, like I did.
Post Reply