| Author |
Message |
sh54
Joined: 24 Oct 2011 Posts: 2
|
Posted: Mon Oct 24, 2011 9:45 am Post subject: Profiling a powershell module |
|
|
I have tried to profile a powershell module compiled as a 32-bit c# dotnet 3.5 library by choosing ".NET executable" where the executable is "C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe" and giving it arguments: noexit -command Import-Module "C:/xyz/MY-MODULE.dll"
However, whilst I get to see a graph of the CPU, I cannot inspect which methods take a long time. All the time used is placed under a row labeled "(Waiting for synchronization)".
I have no trouble attaching the Visual Studio debugger directly to powershell.exe and stepping through my source code.
Is there any specific settings I should be using to get profiling working correctly? |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Mon Oct 24, 2011 10:25 am Post subject: |
|
|
What does the Import-Module command do? Doesn't it just load the module into Powershell? Then you're not actually running any managed code, so no, you shouldn't expect to see any results.
You'll need to call some code in the DLL. _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
sh54
Joined: 24 Oct 2011 Posts: 2
|
Posted: Mon Oct 24, 2011 11:12 am Post subject: |
|
|
| My apologies! I just was not looking hard enough in the call tree (and forgot to mention I was calling a method in my dll from powershell). |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Mon Oct 24, 2011 11:27 am Post subject: |
|
|
If you are invoking some code then this is probably the same common problem of not getting results regardless of the kind of app.
You can try the usual first steps - show all methods (vs just the ones that have source), show all threads, and uncheck "hide insignificant methods". _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6341 Location: Red Gate Software
|
Posted: Tue Oct 25, 2011 11:02 am Post subject: |
|
|
Just checking - did turning some of those filters off get the methods to show in the results? _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|
|
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