The Android SDK includes among its various tools two that are specially intended to analyze performance problems and potentially determine the target to apply optimizations.
These tools have an advantage over other alternatives: usually no modification to the source code is needed for simpler tasks. However, for more complex cases some additions are needed, but they are very simple as we will see shortly.
If you don't need precision about starting and stopping tracing, you can drive it from the command line or Eclipse. For example, to start tracing from the command line you can use the following command. Remember to replace the serial number for what is applicable in your case:
$ adb -s emulator-5554 ...