Red Gate forums :: View topic - Profile Windows Service
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Profiler Previous Versions
ANTS Profiler Previous Versions forum

Profile Windows Service

Search in ANTS Profiler Previous Versions forum
Post new topic   Reply to topic
Jump to:  
Author Message
paulsmith



Joined: 23 Apr 2009
Posts: 8
Location: Durham

PostPosted: Tue Apr 28, 2009 11:29 am    Post subject: Profile Windows Service Reply with quote

I have a profiler attached to a Windows service however it's only seems to profile the main service thread and not threads it spawns. As a result we can't profile any code we've written.

Is there a way round this? Are we doing something wrong?

Thanks
Back to top
View user's profile Send private message
StephenC



Joined: 15 Oct 2007
Posts: 315
Location: Cambridge

PostPosted: Tue Apr 28, 2009 1:12 pm    Post subject: Reply with quote

Hi Paul,

let me start with the two most obvious questions just so we can disregard them -

- Is the checkbox in the setup dialog which says "Profile Child Processes" checked?
- If so, what appears in the combo box displaying "All Threads" by default on the main profiler UI. Are any of the processes you are wanting to see data for available for selection in there?

If neither of these apply then it could be a bug and will need further looking into.

Stephen
Back to top
View user's profile Send private message
paulsmith



Joined: 23 Apr 2009
Posts: 8
Location: Durham

PostPosted: Tue Apr 28, 2009 2:09 pm    Post subject: Reply with quote

Hi,

Yes that checkbox is checked. In that dropdown you refer to, there is a list of threads. However selecting any of them doesn't reveal anything. Most result in (Thread Blocked) in the main window or simply an empty window. However I know the service is working as it's doing what it should.

Paul
Back to top
View user's profile Send private message
paulsmith



Joined: 23 Apr 2009
Posts: 8
Location: Durham

PostPosted: Tue Apr 28, 2009 2:13 pm    Post subject: Reply with quote

I don't know whether this helps but here is some platform information...

.NET 2.0 Windows Service
Vista Business 64bit.

Thanks again

Paul
Back to top
View user's profile Send private message
StephenC



Joined: 15 Oct 2007
Posts: 315
Location: Cambridge

PostPosted: Tue Apr 28, 2009 2:54 pm    Post subject: Reply with quote

Hi Paul,

one final check - is the display also set to showing CPU time and nothing changes?

If looking for child processes itís important that the environment isnít changed to remove the variables set by the profiler when starting them or it wonít get attached.

Stephen
Back to top
View user's profile Send private message
paulsmith



Joined: 23 Apr 2009
Posts: 8
Location: Durham

PostPosted: Wed Apr 29, 2009 9:17 am    Post subject: Reply with quote

Hi,

Yes that is correct, I can see the CPU graph ticking away as the service works however I don't see any threads.

I can send a screenshot if that would be useful.

Thanks

Paul
Back to top
View user's profile Send private message
paulsmith



Joined: 23 Apr 2009
Posts: 8
Location: Durham

PostPosted: Wed Apr 29, 2009 9:36 am    Post subject: Reply with quote

I have posted a screenshot here if it's useful....

Back to top
View user's profile Send private message
AndrewH



Joined: 17 Aug 2006
Posts: 137

PostPosted: Wed Apr 29, 2009 10:09 am    Post subject: Reply with quote

Ah, I think I see what's going on here: the profiler can't find any debugging symbols for the service so it doesn't think that any methods have source code associated with them.

You should be able to switch the Display drop-down to show all methods in order to see the missing methods: you'll see all the framework calls as well, so the results can get a little cluttered.

To enable the profiler to identify methods with source, you'll need to put the .pdb files generated when you compiled it in the same directory as your service: they will show up in bold when the profiler can identify them.
_________________
Andrew Hunter
Software Developer
Red Gate Software Ltd.
Back to top
View user's profile Send private message
paulsmith



Joined: 23 Apr 2009
Posts: 8
Location: Durham

PostPosted: Wed Apr 29, 2009 10:28 am    Post subject: Reply with quote

Hi,

Yeah that seems to have got it working. Very Happy

Never even thought about that, always looking for the most complicated answer.

Just need to buy our license now.

Thanks again

Paul
Back to top
View user's profile Send private message
paulsmith



Joined: 23 Apr 2009
Posts: 8
Location: Durham

PostPosted: Wed Apr 29, 2009 4:32 pm    Post subject: Reply with quote

Hi,

We seem to have encountered another issue while profiling the service. One of our threads uses the JET engine to connected to an excel file on a remote machine. Our service runs under a specific account and this account has all the relevant permissions. This all works fine. However when the profiler is attached we get an error when connecting to the file.

The exception is not the most useful as it's just an "Unspecified error". I'm assuming it has something to do with permissions and the way the profiler stops and starts the service. Can you direct us in possible placed to look. We're making the assumption that when the service is restarted when the profiler is attached that it used the same account?

<StackTrace>
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at Communicator.Data.DataImport.ImportTempDB.Create() in C:\Documents\Visual Studio 2005\Projects\Communicator\v4\Communicator\Data\DataImport\ImportTempDB.cs:line 86
at Communicator.Data.DataImport.Service.DataImporter.Import() in C:\Documents\Visual Studio 2005\Projects\Communicator\v4\Communicator\Data\DataImport\Service\DataImporter.cs:line 126</StackTrace>

Here is a snapshot of the stacktrace pinpointing the the calls to the OLEDB objects.

Thanks

Paul
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group