assembly - 如何将 Vtune 分析限制为特定函数

标签 assembly x86 64-bit profiling intel-vtune

我有一个程序,其基本结构如下:

<c language headers>
main() {
    some malloc() allocations and file reads into these buffers
    call to an assembly language routine that needs to be optimized to the maximum
    write back the output of to files and do free()
exit()
}

汇编语言程序本质上是计算缓冲区中数据的校验和,我的意图是将其优化到绝对最大值。它不进行任何系统调用或任何库函数调用。

我刚刚将 Intel vTune Amplifier XE 套件安装到 VS 2015 中。

如何指定vtune严格关注汇编语言例程部分,而跳过所有对“C”语言准备部分的分析。我似乎正在累积所有数据,如指令计数或 CPI 等。是否可以仅获取汇编语言子例程中的循环和分支的数据。如果是这样,请告诉我该怎么做。

谢谢

最佳答案

您可以通过 VTune 提供的 API 检测您的代码,以分析工作负载中的特定区域。使用 Task API用于跟踪特定于线程的事件或 Frame API用于分析工作量的全局阶段。

配置分析类型,选择“分析用户任务”选项来处理检测任务。收集完成后,选择以 Task 或 Frame 开头的分组,以查看聚合到您的检测间隔的性能数据。您还会在时间线中看到您的任务/框架。

例如,您可以将代码更改为:

<c language headers>
#include "ittnotify.h"

main() {

  __itt_domain* domain = __itt_domain_create("MyDomain");
  __itt_string_handle* task = __itt_string_handle_create("MyTask");

  some malloc() allocations and file reads into these buffers

  __itt_task_begin(domain, __itt_null, __itt_null, task);

  call to an assembly language routine that needs to be optimized to the maximum

  __itt_task_end(domain);

  write back the output of to files and do free()
  exit()
}

别忘了关注basic configuration编译这段代码。

关于assembly - 如何将 Vtune 分析限制为特定函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36731457/

相关文章:

pointers - 学习汇编有哪些实际优势?

linux - 识别汇编中的库调用

c - 不知道为什么我会收到链接错误

assembly - 理解 cmp 指令

c# - Winform 应用程序在 WINDOWS 7 -64 位上崩溃

assembly - x86 SIMD 指令汇编中的 16 字节对齐(无 C 内在函数)

c - 从 ARM 汇编到 C 的函数调用的参数传递约定

assembly - 为什么要使用ROL指令?

.net - Visual Studio加载正确的(x86或x64)dll

无法从 Windows 64 位进程获取线程上下文