It is becoming increasingly important for software developers to become more power aware. A laptop or a mobile device would have limited use if it was not able to function for extended periods of time on battery alone. It is also critical for software to not be wasteful in their power usage. Intel® VTune™ Amplifier XE 2013 presents a software based solution whereby you can measure where your application is not optimal in its usage of power.
To make use of the power analysis types in Intel® VTune™ Amplifier XE 2013 on Linux, the following are required:
- A CPU architecture of Nehalem or above. (Note: Intel® Core 2 ™ architecture is not supported.)
- Linux kernel version of 2.6.32 or above.
The following is a step by step method for using the power analysis types of Intel® VTune™ Amplifier XE 2013. There are two “Power Analysis” types available in Intel® VTune™ Amplifier XE 2013:
- CPU Sleep states
- CPU Sleep states indicate during what intervals your CPU is asleep. The main goal of CPU Sleep states is to show when the system is sleeping, what sleep state it was in and what woke up the system. The higher the sleep state the lower the power usage.
- CPU Frequency
- CPU’s also have the ability to change the core clock frequency, power usage will be higher the greater the frequency.
The following is a step by step method for using the power analysis types in Intel® VTune™ Amplifier XE 2013.
- Untar the tachyon sample located here: /opt/intel/vtune_amplifier_xe_2013/samples/en/C++/tachyon_vtune_amp_xe.tgz using the following command: tar xzvf tachyon_vtune_amp_xe.tgz. (make sure you run this command in a location that you want to build the sample)
- After you have untarred the sample it should have created the directory tachyon. Move into this directory, “cd tachyon”. Then run “make”. This should build the application.
- The application you will be running is “tachyon_find_hotspots”
- Bring up the the Intel® VTune™ Amplifier XE 2013 GUI. First source the environment: source /opt/intel/vtune_amplifier_xe_2013/amplx-vars.sh. Run the amplxe-gui command.
- You will need to create a project to set up your analysis and hold your results. In the amplxe-gui application, File->New->Project. This will bring up a dialog and allows you to specify a project name.
- Once you have specified a project name and clicked “Ok”, you should now see the “Project Properties” dialog.
- You should specify the tachyon_find_hotspots application and the tachyon working directory that you built in step 2. Click “Ok”
- Click on the “New Analysis” icon. (Orange icon shaped like a play button)
- You should now see the “Configure Analysis Dialog”. On the right had side of the dialog you should see all the available analysis types. For this example we will be using the analysis types related to “Power Analysis”.
10. As shown in step 9, there are 2 separate power analysis types. First, click on CPU Sleep States. Then click on “Start”, to start a CPU Sleep States analysis.
11. Once the tachyon application has finished, you should see a summary of the CPU Sleep States analysis that you just ran.The summary shows the Top 5 causes of CPU Wake-ups and a histogram showing the elapsed time the processor spent in each CPU Sleep State.
12. There are some additional dialogs that you can also navigate to obtain some additional information.
13. If you click on “Sleep states” button, you will bring up a dialog showing the time spent in each sleep state and also a timeline of the sleep state transitions.
14. If you click on the “Wake-ups” button, you will see the top reasons for the processor waking up and a timeline for wake-ups.
15. In order to collect the data on CPU Frequencies you will need to run a “New Analysis”. From the “Power Analysis” types specified in step 9. Click on “CPU Frequency”. Then Click on “Start”.
16. Once the tachyon application has completed a summary of the data for CPU Frequency will be displayed.
Power has become a critical issue in modern computers. Intel® VTune™ Amplifier XE 2013 has some very useful analysis types for discovering where software is making non-optimal use of resources and could therefore be wasting power.