[llvm-dev] profile the llvm JITed code

张建 via llvm-dev llvm-dev at lists.llvm.org
Fri Sep 11 00:40:15 PDT 2015


Hi llvm,


It is the second time I post this kind of message.


My llvm version is 3.3, can anyone tell me how to profile the JITed code using OProfile?


I build llvm with the '--enable-optimized --enable-debug-runtime --enable-debug-symbols --disable-assertions --with-oprofile=/usr/local/ --enable-profiling' option, but get the 'anon (tgid:105186 range:0x7f028c6c9000-0x7f028c748fff)' instead of the full message about the profiling results.


I know llvm using the libopagent.so to communicate with OProfile daemon, so I try to use 'ldd' command to show the dependencies, and the outputs are:


$ ldd fibonacci
    linux-vdso.so.1 =>  (0x00007fff168f4000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00000031edc00000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00000031ed800000)
    libz.so.1 => /lib64/libz.so.1 (0x00000031ee400000)
    librt.so.1 => /lib64/librt.so.1 (0x00000031ef000000)
    libopagent.so.1 => /usr/local//lib/oprofile/libopagent.so.1 (0x00007ffabeaf6000)
    libm.so.6 => /lib64/libm.so.6 (0x00000031ee000000)
    libstdc++.so.6 => /home/admin/jianzhang.zj/gcc-4.8.2-install/lib64/libstdc++.so.6 (0x00007ffabe7f2000)
    libgcc_s.so.1 => /home/admin/jianzhang.zj/gcc-4.8.2-install/lib64/libgcc_s.so.1 (0x00007ffabe5db000)
    libc.so.6 => /lib64/libc.so.6 (0x00000031ed400000)
    /lib64/ld-linux-x86-64.so.2 (0x00000031ed000000)
    libbfd-2.25.1.so => /usr/local/lib/libbfd-2.25.1.so (0x00007ffabe2d9000)
    libiberty.so => /usr/lib/libiberty.so (0x00007ffabe098000)
$ ldd -ufibonacci
Unused direct dependencies:
 
    /lib64/libdl.so.2
    /lib64/libz.so.1
    /lib64/librt.so.1
    /usr/local//lib/oprofile/libopagent.so.1


as the outputs says, libopagent.so is the direct dependency but unused. So the 'anon (tgid:105186 range:0x7f028c6c9000-0x7f028c748fff)' message show in the profiling result.


Can somebody help me with this issue?


Thanks!
Jian Zhang.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150911/21fa3802/attachment-0001.html>


More information about the llvm-dev mailing list