API

Questions about YourKit .NET Profiler
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Post by Anton Katilin »

First question: do you profile the application itself (application #1 == application #2, as from my previous posts example) or a different application (application #1 != application #2)?

If it is the first case:

you do not need to set the port at all. The profiler agent will choose free port automatically. The controller's constructor with no parameters (new Controller()) will automatically find that port.

If it is the second case:

The port should be free, i.e. not used by another application. If 10002 is busy, try another one, e.g. 10005 or 10020. Instead of using startup-options.ini I would recommend to set YNP_STARTUP_OPTIONS environment variable instead, and to do it for the process #1 (the profiled one) only.

Anyway, could you please confirm whether your case is first or second, and I'll explain in more detail if necessary.
jarbas
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Post by jarbas »

My case is the second.

The application #1 != application #2
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Post by Anton Katilin »

We will release next version in 1-2 days. Among other improvements there will be improvements in the API.
In particular, there will be Controller constructor which gets the profiled application's PID instead of port. This will simplify setup as it will not be needed anymore to hard code the port; the by-default chosen port will be OK.
jarbas
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Post by jarbas »

Ok Anton,

Very good improvements. I will stay waiting this release.

Thank so much.
jarbas
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Post by jarbas »

Anton,

I atached an application with PID 2656 and have tried to create a new Controller like this:

Controller c = new Controller(2656);

Occurred the following error:

Process with PID=2656 does not exist or is not started with YourKit Profiler.

Notice that I have been to profiled this application before.
Mine application is Windows Service type.

Thanks.
Vladimir Kondratyev
Posts: 1624
Joined: Tue Aug 10, 2004 7:52 pm

Re: API

Post by Vladimir Kondratyev »

YourKit .NET Profiler 7.0 was released today. Please download and try it http://www.yourkit.com/dotnet/download/
jarbas
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Post by jarbas »

I'm had already using the version 7.0
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Post by Anton Katilin »

Process with PID=2656 does not exist or is not started with YourKit Profiler.
Have you started it with the profiler?
http://www.yourkit.com/docs/net70/help/ ... _local.jsp
http://www.yourkit.com/docs/net70/help/ ... manual.jsp

If yes, the profiler log file must be created. Does it exist? What is its content? Please change its location if you cannot find it:
http://www.yourkit.com/docs/net70/help/ ... jsp#logdir
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Post by Anton Katilin »

P.S.
Please also ensure that the profiler agent library is in the PATH of the process which calls Controller. Controller depends on some unmanaged code from it.

If you access the Controller from a 32-bit process, it is <profiler installation directory>\bin\win32\ynpagent.dll
If you access the Controller from a 64-bit process, it is <profiler installation directory>\bin\win64\ynpagent.dll

You can copy the file to the current directory if it is easier to do.
jarbas
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Post by jarbas »

Anton Katilin wrote:
Process with PID=2656 does not exist or is not started with YourKit Profiler.
Have you started it with the profiler?
http://www.yourkit.com/docs/net70/help/ ... _local.jsp
http://www.yourkit.com/docs/net70/help/ ... manual.jsp

If yes, the profiler log file must be created. Does it exist? What is its content? Please change its location if you cannot find it:
http://www.yourkit.com/docs/net70/help/ ... jsp#logdir
Yes, I started with profiler.

The log exist. See part of the content:

[YourKit Profiler 6.0.1 for .NET] [0.061]:
OS: Windows 7 6.1
'C:\RM.Net\Bin\RM.Host.exe' started 19.1.2012 at 9:35
[YourKit Profiler 6.0.1 for .NET] [0.062]: Reading ignore list...
[YourKit Profiler 6.0.1 for .NET] [0.062]: File C:\Users\jarbas.carvalho\.ynp\config\.ignore2: not found
[YourKit Profiler 6.0.1 for .NET] [0.062]: Registry key HKLM\SOFTWARE\YNP: RegQueryValueEx failed for IGNORE_LIST with code 2
[YourKit Profiler 6.0.1 for .NET] [0.062]: Using default
[YourKit Profiler 6.0.1 for .NET] [0.063]: Reading startup options
[YourKit Profiler 6.0.1 for .NET] [0.063]: Environment variable YNP_STARTUP_OPTIONS: not defined
[YourKit Profiler 6.0.1 for .NET] [0.063]: File C:\Users\jarbas.carvalho\.ynp\config\startup-options.ini: disablealloc
[YourKit Profiler 6.0.1 for .NET] [0.521]: agent is listening on port 10001
[YourKit Profiler 6.0.1 for .NET] [0.575]: setTriggers:

[YourKit Profiler 6.0.1 for .NET] [0.575]: setTriggers: OK
[YourKit Profiler 6.0.1 for .NET] [3.685]: Shutting down...
7.0.0 - 0.020: Command line:
jarbas
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Post by jarbas »

Anton Katilin wrote:P.S.
Please also ensure that the profiler agent library is in the PATH of the process which calls Controller. Controller depends on some unmanaged code from it.

If you access the Controller from a 32-bit process, it is <profiler installation directory>\bin\win32\ynpagent.dll
If you access the Controller from a 64-bit process, it is <profiler installation directory>\bin\win64\ynpagent.dll

You can copy the file to the current directory if it is easier to do.
Yes, the file ynpagent.dll exists in this path for 32-bit process.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Post by Anton Katilin »

Please note that the log says the application starts with version 6, not with 7.
Please uninstall version 6 before installing version 7 to avoid loading of a wrong agent.
jarbas
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Post by jarbas »

Strange because I removed the old version using the installer YourKit-Profiler-7.0.0-for-.NET.exe and through of windows panel control and the application continue saving the log like version 6.0.1 for .NET.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: API

Post by Anton Katilin »

Have you manually copied ynpagent.dll from the v6 directory to another directory?
Please search all your disks for ynpagent.dll and ensure no copy of v6's agent remains.
jarbas
Posts: 24
Joined: Fri Apr 13, 2012 1:20 pm

Re: API

Post by jarbas »

I removed the yourkit, all the folders and files and reinstall it again but the log continue saving with the old version.

2012-01-17 16:46:18.955 0 +0 INFO com.yourkit.Main0 :
---------------------------------------------------------------------
Product: YourKit Profiler 6.0.1 for .NET
Build: 6006 on Mon Nov 21 15:56:00 BRST 2011
JDK: 1.6.0_27
VM: Java HotSpot(TM) Client VM
Vendor: Sun Microsystems Inc.
OS: Windows 7
OS version: 6.1
OS arch: x86

I will try in another machine.
Post Reply