• Work
    August 10, 2006

Profiling a running process

Guest Author

A couple of months back I was looking at the performance of a customer's application. The usual protocol for these kind of things is to figure out where the application actually gets launched and then insert a call to collect before this happens:

collect -F on <application> <params>

Of course this can sometimes be difficult to locate. An alternative is to use dbx and attach to the running process:

attach <pid>
collector enable

This requires less searching of startup scripts, but does require a bit of typing (and the application freezes, waiting, while you do it).

A while back a colleague suggested to me that it would be possible to script this. When I was working on spot, I wanted it to be able to attach to a running process and generate a profile, consequently I finally ended up writing the script. I'm very grateful to the Analyzer team because they took my script and implemented it in the product in Sun Studio 11:

collect -P <pid>

Coming back to the customer's application, the first profiles I got were using this relatively painless method.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.