diff options
author | Jeffrey Yasskin <jyasskin@google.com> | 2009-07-10 21:08:20 +0000 |
---|---|---|
committer | Jeffrey Yasskin <jyasskin@google.com> | 2009-07-10 21:08:20 +0000 |
commit | 1fa7e521c90a90c4d2b07dfa75fba75708b34b1c (patch) | |
tree | cc36f28605ec5b69c13d845ae6b3d555b5f44fe4 /autoconf | |
parent | 7a975f824470f7d8394795e275441f849f7a4c66 (diff) | |
download | external_llvm-1fa7e521c90a90c4d2b07dfa75fba75708b34b1c.zip external_llvm-1fa7e521c90a90c4d2b07dfa75fba75708b34b1c.tar.gz external_llvm-1fa7e521c90a90c4d2b07dfa75fba75708b34b1c.tar.bz2 |
Add a --with-oprofile flag to configure, which uses OProfile's agent
library to tell it the addresses of JITted functions. For a
particular program, this changes the opreport -l output from:
samples % image name symbol name
48182 98.9729 anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000) anon (tgid:19412 range:0x7f12ccaab000-0x7f12cdaab000)
11 0.0226 libstdc++.so.6.0.9 /usr/lib/libstdc++.so.6.0.9
to:
samples % image name symbol name
24565 60.7308 19814.jo fib_left
15365 37.9861 19814.jo fib_right
22 0.0544 ld-2.7.so do_lookup_x
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf')
-rw-r--r-- | autoconf/configure.ac | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/autoconf/configure.ac b/autoconf/configure.ac index b3940f0..71afc3a 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -922,6 +922,43 @@ AC_ARG_WITH(udis86, AC_DEFINE_UNQUOTED([USE_UDIS86],$USE_UDIS86, [Define if use udis86 library]) +dnl Allow OProfile support for JIT output. +AC_ARG_WITH(oprofile, + AS_HELP_STRING([--with-oprofile=<prefix>], + [Tell OProfile >= 0.9.4 how to symbolize JIT output]), + [ + AC_SUBST(USE_OPROFILE, [1]) + case "$withval" in + /usr|yes) llvm_cv_oppath=/usr/lib/oprofile ;; + *) llvm_cv_oppath="${withval}/lib/oprofile" + CPPFLAGS="-I${withval}/include";; + esac + LIBS="$LIBS -L${llvm_cv_oppath} -Wl,-rpath,${llvm_cv_oppath}" + AC_SEARCH_LIBS(op_open_agent, opagent, [], [ + echo "Error! You need to have libopagent around." + exit -1 + ]) + AC_CHECK_HEADER([opagent.h], [], [ + echo "Error! You need to have opagent.h around." + exit -1 + ]) + ], + [ + llvm_cv_old_LIBS="$LIBS" + LIBS="$LIBS -L/usr/lib/oprofile -Wl,-rpath,/usr/lib/oprofile" + dnl If either the library or header aren't present, omit oprofile support. + AC_SEARCH_LIBS(op_open_agent, opagent, + [AC_SUBST(USE_OPROFILE, [1])], + [LIBS="$llvm_cv_old_LIBS" + AC_SUBST(USE_OPROFILE, [0])]) + AC_CHECK_HEADER([opagent.h], [], [ + LIBS="$llvm_cv_old_LIBS" + AC_SUBST(USE_OPROFILE, [0]) + ]) + ]) +AC_DEFINE_UNQUOTED([USE_OPROFILE],$USE_OPROFILE, + [Define if we have the oprofile JIT-support library]) + dnl===-----------------------------------------------------------------------=== dnl=== dnl=== SECTION 6: Check for header files |