How to attach to a Windows service

How to attach to a Windows service

16 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi,

You can attach
to a running Windows service the same way you attach to a general Windows
process: VTune Amplifier XE->Project Properties->Attach to process->Process
Name or PID.

You can
obtain the process name for a service in the Windows (Win7) Control Panel->Administrative
Tools->Component Services->Services(Local)

-Vladimir

Hi

Thanks for your reply. It looks strange that contents in my previous post disappeared. Actually I want to ask : Why can't vTune attach to a Windows service? I already tried your method to attach my service, but it failed. vTune reports that it can't find PID after I click Start button in XE GUI. My anaylysis type is HotSpots and both PID and process name are failed. I will post detail error message when I go to office.

Ok. Just make sure the process is really running in the system.

-Vladimir

Please see my reply in another thread. Basically, if you can attach to the process with a debugger from the user account that is running VTune Amplifier XE, then you should be able to attach to it with the profiler.

Regards,
MrAnderson

The error message is: Process with the specified PID is not found. Specify another PID and try attaching again. As I mentioned in previous post, I try to specify PIDor Process Name in Project Properties, but both failed. I just download XE 2011 yesterday and want to try it, does this has any relationship with issue?

Hi

Thanks. This computer is my developing tool and I try to use Visual Studio2005 to attach it, it can. My account belongs to Adminstrator group.

Please, attach the screenshot of the Visual Studion 'Attach to Process' dialog with the mame and ID of the process in the focus, and thescreenshot of the VTune's error report. Thanks.

-Vladimir

Sorry for so late replying your post. I struggle for a while but I still can't upload my screenshot. Do you have any help or training materials for this one?

Thanks

Use the 'Add Files' button in the edit pane. Create a folder and add the pictures into there. Add them to a message. That should work.

-Vladimir

Also see this article for info on attaching files.

Regards,
MrAnderson

Thanks. Below are my screenshot:
1. XE project properties
2. VS2005

3. Task Manager

4. XE Error message

Thank you for the screenshots. Now I see that the process was started by
the System user. This is not something we support with attachment, sorry. We
will consider how to fix that in the future releases.

Im not an expert in Windows services, so you probably
could find a way how to launch the service process as not System user this should
help to workaround the problem.

Thanks again for the reproducer.

-Vladimir

Thanks. I will try your proposed workaround, but I think this restriction is a big issue which prevent many applications.

I test again. You workaround doesn't work. Environment: Windows 7 and VS2005.

We need some time to investigate it further. Thanks for patience.

-Vladimir

Leave a Comment

Please sign in to add a comment. Not a member? Join today