How to use TrueTime/TrueCoverage to profile COM components

0 Likes

Problem:

How to useTrueTime/TrueCoverage to profile COM component which is called from an application or an ASP page ?

Resolution:

This article is for DevParner version 6.6 and below only.

There are four steps:

Step1: Build your component with TrueTime.

Step2: Get a COM application that will contain your component

If you want to run your component inside your own process, get a Library Application. If you want to run your component inside DLLHOST.exe, then you need a Server Application.

You can create a brand-new COM application using the following steps:

1. Go to start -> Run MMC.EXE

2. Console -> Add snap-in, add Component Services

3. Expand the node in the left panel until you reach to the 'COM Application'

4. Right click on 'COM Application' -> New -> Application, follow the prompt given by the COM application Install Wizard to create a new application.

You also can use an already existing COM application.

Step3: Register your instrumented component into a COM application.

There are a few ways to do that. After you expand the node of 'COM application' until you reach to the one into which you want to put your component.

1. Drag the component from the Windows Explorer into its 'component' folder

2. Right click on 'component' folder, New -> Component, follow the COM application Install Wizard to add a new component into this application.

If you have a bunch of components, you may want to use script to do that.

At the time your component is registered into the COM application, it is also registered into the O.S.

If you are adding your component to an existing COM Application, be sure the application is not running (not twirling).

Please note: During the registering period on Windows 2000, there are some things that are better to be pointed out. You can see :

1. Multiple TrueTime Recording Control Windows and SaveAs dialogs popping up

2. It is RunDll32.EXE that shows up in the Recording Control Windows but not your own EXE or DLLHOST.EXE.

These are expected behaviors. When you add your instrumented component into the application, COM is activating the components multiple times ( DLLHOST.EXE requests system utility RunDll32.EXE that invokes our TrueTime Engine TTCORE.DLL. TTCORE.DLL invokes related modules. That is why multiple Recording Control Windows and SaveAs dialogs appear. But there is nothing to save because we haven't done anything against the component yet, e.g. create an object of that component). The performance of TrueTime is not affected by this behavior. You can simply Cancel those SaveAs dialogs. There are some other things you can do to avoid those 'annoying' things. If you have DevPartner Agent Manager, you can check ' save session file automatically' checkbox. Or you can use Environment variables to save session file automatically too (Please see help file for details )

If you want to use IIS to load an ASP page which uses that component, you may need to go to Services to check the 'log on' tab for IIS Admin, FTP, WWW as 'Interactive user'.

Then go to Internet Information Services -> Properties of 'Default Web Site' -> Home Directory, Specif your local path and make sure you have Read, Write right. 'Execute Permissions' is 'Script and Executables' and 'Application Protection' is set to 'Low (IIS Process)'. Also, Click "Configuration" on the "Home Directory" tab and under "App Debugging" check the "Enable ASP server-side script debugging" checkbox.

Step 4: Run the EXE inside which your component runs. At this time, you can take a snapshot or you can get the session file after the EXE terminates.

If your component is called by an asp page, then restart IIS and open browser to load your ASP page ( assuming you are using IE and your local path is c:\intetpub\wwwroot, so you should have your asp page under this path). You can take a snapshot when IIS is still running or you can get session file when you shutdown IIS at the place you specified (automatically saved or manually saved).

If you find that the Recording Control icon is not created in the task bar and IIS hangs after creating an out-of-proc COM object from an ASP page, you need to include IUSR_machinename and IWAM_machinename (IIS accounts) in the administrators group. By default, these accounts have very limited set of privileges which prohibit TrueTime from interacting with NT services and user desktop.

Please note that these steps are suitable for TrueCoverage too.

Old KB# 11298
Comment List
Anonymous
Related Discussions
Recommended