Unable to connect for profiling after YK Upgrade to 7

Questions about YourKit .NET Profiler
Post Reply
jexpert
Posts: 8
Joined: Tue Apr 24, 2012 1:20 pm

Unable to connect for profiling after YK Upgrade to 7

Post by jexpert »

I just want to share my experience after upgrading from YourKit 6 to 7. I'm aware of the same topic in the other thread http://forums.yourkit.com/viewtopic.php?f=5&t=4110

In YourKit 6:
1. Simply start YourKit
2. Start the app, choose the right process (green icons). Profile. Done!

Now in Yourkit 7:
1. Start Yourkit, then App
2. Attach (yellow) icon. Receive a "-1" error code
3. Huh? Reboot after upgrade necessary?
4. Reboot. Trying to click "Local App"
5. Nah! I don't want to start it manually!
6. Try "next app". Says: "Start me as Admin!". WTF? Why this?
7. Restart Yourkit as Administratror, Click next, start app ("via nant run").
8. Become attached to LC.exe (no - thats not My app
9. Stop everything, restart everything
10. Carefully watch the build screen output for the right point in time just before the app start
11. Have luck! Get connected

I think my story is self-explanatory!

As a long-termin YJP the attachment way of YourKit.NET6 was a huge convenience win compared to the Jabva version.
Now - its a huge loss...

Please re-enable this intuitive way of profiling from version 6 as default and simply make it a easy one-click option to ignore unwanted processes instead of making it a huge fuss to include wanted processes.
jexpert
Posts: 8
Joined: Tue Apr 24, 2012 1:20 pm

Re: Unable to connect for profiling after YK Upgrade to 7

Post by jexpert »

Btw: What are the reasons why now I need to be Administrator to connect to newly started processes?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Unable to connect for profiling after YK Upgrade to 7

Post by Anton Katilin »

Hello,

Thank you for the feedback.

First of all, as was discussed in the thread which you've referred, the old approach will be back in next build as an available option. An internal build is available as:
http://www.yourkit.com/download/tmp/201 ... r-.NET.exe
See action "Profile | All .NET Processes That Will Start..."
Please re-enable this intuitive way of profiling from version 6 as default
Unfortunately, many (or maybe even most) users did not find it intuitive.
They were not ready for such an innovation.
They wanted a conservative approach to explicitly launch profiled applications from within the profiler, which they had been using in other tools.
But if you do not agree with that majority, you now have an option to use the old approach.
6. Try "next app". Says: "Start me as Admin!". WTF? Why this?
Enabling profiling for all processes requires a few registry keys to be set, this is how CLR works. The keys cannot be set unless your run as administrator. This is the security policy Windows had chosen for those keys.

In version 6, the profiler UI always started as administrator. It was essential for the global profiling enabling approach. But it did not allow users to profile any (e.g. standalone) applications without administrative privileges.

Now it is possible to run the profiler as a regular user and to profile standalone or silverlight applications. In their case a new process is started, and profiling is enabled by setting an environment variable.

Anyway, if you prefer the global profiling enabling, you can:
1) go to "YourKit for .NET Profiler" Properties -> Compatibility -> Run this program as an administrator
and 2) invoke "Profile | All .NET Processes That Will Start...", select option "Automatically re-enable profiling on next profiler start" and press Profile.
After that the profiler will virtually return to the old behavior.

Best regards,
Anton
jexpert
Posts: 8
Joined: Tue Apr 24, 2012 1:20 pm

Re: Unable to connect for profiling after YK Upgrade to 7

Post by jexpert »

Many thanks for your extensive and care-taking reply!
But did I really start YourKit.NET with Administrator privileges? I'm working as a restricted user under XP and I do not remember launching YourKit with administrator privileges nor granting elevated rights. Attaching to newly created processed worked well. But maybe I just mix that....
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Unable to connect for profiling after YK Upgrade to 7

Post by Anton Katilin »

First of all, it seems about XP only. Vista and Windows 7 have UAC and it elevates privileges when needed, thus a restricted account is OK.
I'm working as a restricted user under XP
Are you sure it worked with version 6?
A restricted XP user:
- cannot install to "c:\Program Files", a workaround is to install to c:\yourkit or inside user home
- cannot register the dlls and that is the problem; you can work this around by running the registration as administrator
- cannot globally enable profiling - no access to registry; again, running as administrator helps.

Run as administrator in XP:
http://www.microsoft.com/resources/docu ... x?mfr=true
Post Reply