【问题标题】:Creating Basic block vectors for SimPoints为 SimPoints 创建基本块向量
【发布时间】:2020-01-27 15:06:30
【问题描述】:

出于我博士论文的目的,我正在尝试使用SimPoints 方法跟踪 GAP 基准套件,您可能知道,这样做的第一步是为您想要的应用程序获取基本块向量追踪。

我正在尝试使用几种可用的方法,例如 valgrind 的实验工具:

valgrind --tool=exp-bbv /bin/ls

但是当我尝试生成基本块矢量文件时,我会遇到这样的错误:

==177076== exp-bbv, a SimPoint basic block vector generator
==177076== NOTE: This is an Experimental-Class Valgrind Tool
==177076== Copyright (C) 2006-2015 Vince Weaver
==177076== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==177076== Command: /gpfs/scratch/bsc28/bsc28798/GAP/gapbs/pr -f /gpfs/scratch/bsc28/bsc28798/GAP/gapbs/benchmark/graphs/road.sg -i1000 -tle-4 -n16
==177076== 
vex amd64->IR: unhandled instruction bytes: 0x62 0xF1 0x7D 0x28 0xEF 0xC0 0xBF 0x0
vex amd64->IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=NONE
vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
==177076== valgrind: Unrecognised instruction at address 0x4cb88a4.
==177076==    at 0x4CB88A4: ??? (in /gpfs/apps/MN4/GCC/7.2.0/lib64/libstdc++.so.6.0.24)
==177076==    by 0x400ECB9: call_init.part.0 (in /lib64/ld-2.22.so)
==177076==    by 0x400EDA2: _dl_init (in /lib64/ld-2.22.so)
==177076==    by 0x4001229: ??? (in /lib64/ld-2.22.so)
==177076==    by 0x5: ???
==177076==    by 0xFFEFFEE6A: ???
==177076==    by 0xFFEFFEE94: ???
==177076==    by 0xFFEFFEE97: ???
==177076==    by 0xFFEFFEED7: ???
==177076==    by 0xFFEFFEEDE: ???
==177076==    by 0xFFEFFEEE5: ???
==177076== Your program just tried to execute an instruction that Valgrind
==177076== did not recognise.  There are two possible reasons for this.
==177076== 1. Your program has a bug and erroneously jumped to a non-code
==177076==    location.  If you are running Memcheck and you just saw a
==177076==    warning about a bad jump, it's probably your program's fault.
==177076== 2. The instruction is legitimate but Valgrind doesn't handle it,
==177076==    i.e. it's Valgrind's fault.  If you think this is the case or
==177076==    you are not sure, please let us know and we'll try to fix it.
==177076== Either way, Valgrind will now raise a SIGILL signal which will
==177076== probably kill your program.
==177076== 
==177076== Process terminating with default action of signal 4 (SIGILL)
==177076==  Illegal opcode at address 0x4CB88A4
==177076==    at 0x4CB88A4: ??? (in /gpfs/apps/MN4/GCC/7.2.0/lib64/libstdc++.so.6.0.24)
==177076==    by 0x400ECB9: call_init.part.0 (in /lib64/ld-2.22.so)
==177076==    by 0x400EDA2: _dl_init (in /lib64/ld-2.22.so)
==177076==    by 0x4001229: ??? (in /lib64/ld-2.22.so)
==177076==    by 0x5: ???
==177076==    by 0xFFEFFEE6A: ???
==177076==    by 0xFFEFFEE94: ???
==177076==    by 0xFFEFFEE97: ???
==177076==    by 0xFFEFFEED7: ???
==177076==    by 0xFFEFFEEDE: ???
==177076==    by 0xFFEFFEEE5: ???
==177076== 
==177076== 
==177076== 
==177076== # Thread 1

我也一直在尝试使用 SimPoints 网站上提出的不同选项,但到目前为止它一直处于死胡同。所以我在这里,询问社区,你是否知道实现这一目标的方法。 :)

注意:此外,工作负载本身运行良好,当我们想要跟踪它们时,我们会遇到问题。

【问题讨论】:

  • clang asm 输出包括基本块标记(作为标签或 cmets)。见this answer
  • 你的意思是我可以从 clang 中解析出汇编代码并通过这种方式获得基本块?
  • 是的。使用clang -O3 -S foo.c 编译。 IDK 如果有一种方便的方法可以为整个程序(而不仅仅是单个编译单元)获取它。也许有一种方法可以让链接时优化 (LTO) 发出一个大的 asm 文件而不是链接的可执行文件?

标签: benchmarking trace cpu-architecture simulator workload


【解决方案1】:

让我们假设您要测试的二进制文件名为 bin 并且您已经创建了它。然后简单地说:

valgrind --tool=exp-bbv ./

【讨论】:

    猜你喜欢
    • 2012-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-19
    • 2015-03-01
    • 1970-01-01
    • 2013-07-18
    • 1970-01-01
    相关资源
    最近更新 更多