NIIT Intel_VTune中文PPT5
- 格式:ppt
- 大小:1.02 MB
- 文档页数:15
Get Started with Energy AnalysisGet Started with Energy AnalysisContentsChapter 1: Get Started with Energy Analysis 2Get Started with Energy Analysis 1Energy Analysis with Intel® SoC WatchUse Intel® SoC Watch to perform energy analysis on a Linux*, Windows*, or Android* system running on Intel® architecture. Study power consumption in the system and identify behaviors that waste energy. Intel SoC Watch generates a summary text report or you can import results into Intel® VTune™ Profiler.Get the ToolsIntel® SoC Watch is available in VTune Profiler, which you can download with the Intel® oneAPI Base Toolkit.WorkflowsYou perform energy analysis by examining a summary report of data collected on the target system. See if the system is using energy-efficient, low power states. If results are not optimal, you may need additional examination of the data on a timeline as well as correlating metrics to determine a cause.There are two workflows for energy analysis:The next few sections describe the steps involved in Option 1 to perform data collection on a target system using Intel SoC Watch.Step 1: Install Intel SoC Watch on Target SystemThe Installation section of the Intel SoC Watch Release Notes (for your preferred target operating system) contains detailed instructions for instruction and configuration (if necessary).Download Intel® oneAPI Base Toolkit and install Intel® VTune™ Profiler, which contains Intel SoC Watch.The Installation section of the Intel SoC Watch Release Notes (for your preferred target operating system) contains detailed instructions for instruction and configuration (if necessary).3•Intel SoC Watch for Windows Release Notes •Intel SoC Watch for Linux Release Notes •Intel SoC Watch for Android Release NotesFind release notes and an OS-specific user guide in the documentation\en\socwatch directory after you install Intel ® VTune ™ Profiler.Step 2: Collect Data1.Open a command prompt with administrative/root privileges on the target system where Intel SoC Watch was installed.2.Enter the command below to capture CPU time in low power states over a 60-second period.socwatch -t 60 -f cpu-cstate -m -o results/testStep 3: View ResultsWhen collection completes, a message appears with the location of the result files. In this example, the summary report is located in the current directory in the results/test.csv file.1.Open the test.csv file using a spreadsheet viewer (such as Microsoft Excel*) or a text viewer (such as vi/vim or Microsoft Wordpad*).NOTESome text viewers give better column alignment than others.2.Review the tables in the report file. A partial set of tables is shown in the example report below.Example report:Example report interpretation : When reading C-State tables, a higher C-State number means lowerpower consumption. C0 indicates high energy consumption and C7 or C10 is the lowest energy consumption.Looking at the table in the example report, the system spent 93.65% of the collection time in the package-level C2 state while the cores were in C7, their lowest state. An area for further exploration would be what prevented the package from going into its lowest energy state.1Get Started with Energy Analysis4Get Started with Energy Analysis 1 Next StepsAfter running a basic collection on a target system, consider one of these steps:•Learn about additional data that you can collect on the target system. Run the help command: socwatch -h. The Intel SoC Watch User's Guide has a list of all provided metrics. Some metrics may not besupported on your platform.•Define a scenario you want to analyze for energy use. For example:•System idle scenario, where the system is not in use during the collection time and is expected to drop its energy use to the lowest possible. Use a longer collection period (several minutes) to give thesystem time to transition to deep sleep or hibernation.•Active workload, such as video or audio playback. Start both an activity and collection for a predetermined time or let the collection run until manually stopped. Use the help command to learn about Intel SoC Watch options that allow launching a workload, delaying a collection start, and running for indefinite time.•Generate a trace file (*.pwr) to import and view in Intel® VTune™ Profiler. Add the -r vtune option to the command line. For more information, see https:///en-us/energy-analysis-user-guide-intel-energy-analysis.Additional ResourcesLegal InformationIntel, the Intel logo, Intel Atom, Intel Core, Intel Xeon Phi, VTune and Xeon are trademarks of Intel Corporation in the U.S. and/or other countries.*Other names and brands may be claimed as the property of others.Microsoft, Windows, and the Windows logo are trademarks, or registered trademarks of Microsoft Corporation in the United States and/or other countries.51 Get Started with Energy AnalysisCopyright © Intel Corporation.This software and the related documents are Intel copyrighted materials, and your use of them is governed by the express license under which they were provided to you (License). Unless the License provides otherwise, you may not use, modify, copy, publish, distribute, disclose or transmit this software or the related documents without Intel's prior written permission.This software and the related documents are provided as is, with no express or implied warranties, other than those that are expressly stated in the License.6。
vtune命令行使用方法VTune是一款性能分析工具,可以帮助开发人员找出应用程序的性能瓶颈。
VTune提供了图形用户界面和命令行界面两种使用方式。
本文将介绍如何使用VTune命令行界面进行性能分析。
1. 安装VTune首先需要安装VTune,可以从Intel官网下载安装包,然后按照提示进行安装。
2. 创建项目使用VTune命令行界面需要先创建一个项目。
可以使用以下命令创建一个名为“myproject”的项目:```amplxe-cl -project-dir myproject -create-project myproject```3. 配置分析类型VTune支持多种分析类型,如CPU性能分析、内存分析、线程分析等。
可以使用以下命令配置分析类型:```amplxe-cl -project-dir myproject -r cpu-hotspots -collect hotspots```上述命令将配置CPU性能分析,并选择hotspots分析类型。
4. 运行分析配置好分析类型后,可以使用以下命令运行分析:```amplxe-cl -project-dir myproject -r cpu-hotspots -collect hotspots -- ./myapp```上述命令将运行CPU性能分析,选择hotspots分析类型,并指定要分析的应用程序为“myapp”。
5. 查看分析结果分析完成后,可以使用以下命令查看分析结果:```amplxe-cl -report hotspots -r r001hs -format text -report-output result.txt```上述命令将生成一个名为“result.txt”的文本文件,其中包含了CPU 性能分析的结果。
除了hotspots分析类型外,VTune还支持多种其他分析类型,如memory-access、threading等。
可以根据需要选择不同的分析类型进行性能分析。
1.VTune工具的作用VTune是INTEL一个比较强大的性能分析软件包含三个工具:1.Performance Analyzer:性能分析找到软件性能的热点部分,一般也就是性能瓶颈的关键点。
2.Intel Threading Checker:用于查找线程错误,能够监测资源竞争、线程死锁等问题。
3.Inter Threading Profiler: 线程性能监测工具,多线程可能存在负载比平衡,同步开销过大等线程相关的性能问题,该工具可以帮你发现每一个线程每一时刻的状态。
2.读懂串行的Pi和Matrix的程序.//PI#include <windows.h>#include <stdio.h>static long num_steps=100000;double step, pi;void main(){ int i;double x, sum = 0.0;step = 1.0/(double) num_steps;for (i=0; i< num_steps; i++){x = (i+0.5)*step;sum = sum + 4.0/(1.0 + x*x);}pi = step * sum;printf("Pi = %12.9f\n",pi);}// Matrix.cpp : 定义控制台应用程序的入口点。
#include "stdafx.h"#include <stdio.h>#include <stdlib.h>#include <math.h>#include <time.h>//#include <advisor-annotate.h>//#include <cilk/cilk.h>//#include <cilk/reducer_opadd.h>#define N 1000int a[N][N],b[N][N],c[N][N];void computmatrix(){int i,j,k;int sum = 0;//cilk::reducer_opadd<int> sum;//ANNOTATE_SITE_BEGIN(MySite1);//cilk_for(i=0;i<N;i++)for(i=0;i<N;i++){//cilk_for(j=0;j<N;j++)for(j=0;j<N;j++){c[i][j]=0;//cilk_for(k=0;k<N;k++)for(k=0;k<N;k++) //先给矩阵C赋初始值0,然后循环计算A矩阵的行和B矩{//ANNOTATE_TASK_BEGIN(MyTask1);sum+=a[i][k]*b[k][j];//c[i][j]=a[i][k]*b[k][j];;//ANNOTATE_TASK_END(MyTask1);}//c[i][j]=sum.get_value();//c[i][j]=sum;}printf("sum = %d\n",sum);}//printf("sum = %d\n",sum);//ANNOTATE_SITE_END(MySite1);}int main(){clock_t start,end;double timepast;//int i,j,k,m;int o,p,m;for(o=0;o<N;o++){for(p=0;p<N;p++){srand((unsigned int)time(NULL)); //产生随机数种子m=( rand() % 100);a[o][p]=b[o][p]=m; //产生0-100的随机数,给矩阵A,B赋初始值}}start=clock();computmatrix();end=clock();timepast=((double)(end-start))/1000;printf("the time is %12.5f seconds\n",timepast);system("pause");}3.Win32关于多线程编程几个重点地函数。