Service mixed CLR2 and CLR4

Questions about YourKit .NET Profiler
Post Reply
[email protected]
Posts: 3
Joined: Mon Feb 11, 2013 8:09 am

Service mixed CLR2 and CLR4

Post by [email protected] »

Hi all,

we do have a service written in .NET3.5 (CLR2) which loads some .NET4 (CRL4) assemblies. This works without problems. But when we want to profile the use of the .NET 4 components in the .NET3.5 service we cann't see them at all. My suspect is that the profiler has decided to profile CLR2 and does not check the CLR4. Is there any trick to tell the profiler only to look for CLR4 instead of CLR2? Or much better to tell the profiler to check both runtimes CL§2 and CLR4?

Thanks
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Service mixed CLR2 and CLR4

Post by Anton Katilin »

Hello,
My suspect is that the profiler has decided to profile CLR2 and does not check the CLR4.
At the moment, only the first loaded CLR is being profiled.
Is there any trick to tell the profiler only to look for CLR4 instead of CLR2?
It seems we can add a option to choose which CLR instance to profile. In your case you'll need to choose version 4. If you are interested, we'll give you a build for testing.

Best regards,
Anton
[email protected]
Posts: 3
Joined: Mon Feb 11, 2013 8:09 am

Re: Service mixed CLR2 and CLR4

Post by [email protected] »

Hi,

yes, that would be great. We need this urgently.
Are there any plans to develop something within the profiler so it can profile any type of runtime in parallel, that would enhance the profiler dramatically.

Thanks
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Service mixed CLR2 and CLR4

Post by Anton Katilin »

yes, that would be great. We need this urgently.
We'll try to provide it today or tomorrow.
Are there any plans to develop something within the profiler so it can profile any type of runtime in parallel, that would enhance the profiler dramatically.
It's technically possible, but would require serious changes in the profiler agent. We'll consider this as a new feature for the next version.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Service mixed CLR2 and CLR4

Post by Anton Katilin »

Could you please try to specify startup option "recursive" with the latest released version of the profiler (8.0.3):
http://www.yourkit.com/dotnet/download/

How to specify a startup option:
http://www.yourkit.com/docs/dotnet/help ... ptions.jsp
Since you run a service, you'll likely need to set a system (not user!) variable YNP_STARTUP_OPTIONS and then restart the machine.

If this does not help, please try a build with the new startup option "targetclr=v4":
http://www.yourkit.com/download/tmp/201 ... ld9000.exe

If this doesn't work, please try startup options "targetclr=v4,recursive".
[email protected]
Posts: 3
Joined: Mon Feb 11, 2013 8:09 am

Re: Service mixed CLR2 and CLR4

Post by [email protected] »

Hi Anton,

the first two options do not work. I have installed V8.0.3 of the profiler, no success. I tried to give the startup options as mentioned "targetclr=v4,recursive", but I get the message

Invalid Option: "targetclr=v4

Having installed 9.0.0 preview does the job. First I thought it is still not working, but after it loads the first .NET 4 assembly the service shows up in the list of .NET applications and our .NET 4 assemblies can be profiled. That is great. But much better would be the ability to transparently profile all clr versions.

Many thanks for your quick response and help.

Regards
Christian
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Service mixed CLR2 and CLR4

Post by Anton Katilin »

Hello Christian

Thanks for the feedback.
Invalid Option: "targetclr=v4
It's OK with version 8.0.3 because this option has just been added in the 9.0.0 internal build.
Did you try 8.0.3 with "recursive" alone?
Having installed 9.0.0 preview does the job.
Could you please clarify: did you use the combination "targetclr=v4,recursive" or only "targetclr=v4"?
If possible, could you test all the variants with 9.0.0:

targetclr=v4,recursive
targetclr=v4
recursive
But much better would be the ability to transparently profile all clr versions.
As I wrote, we'll consider this as a new feature.

Best regards,
Anton
Post Reply