diff options
Diffstat (limited to 'gprofng/libcollector')
-rw-r--r-- | gprofng/libcollector/Makefile.am | 2 | ||||
-rw-r--r-- | gprofng/libcollector/Makefile.in | 7 | ||||
-rw-r--r-- | gprofng/libcollector/aclocal.m4 | 2 | ||||
-rw-r--r-- | gprofng/libcollector/collector.c | 59 | ||||
-rwxr-xr-x | gprofng/libcollector/configure | 425 | ||||
-rw-r--r-- | gprofng/libcollector/descendants.h | 14 | ||||
-rw-r--r-- | gprofng/libcollector/envmgmt.c | 3 | ||||
-rw-r--r-- | gprofng/libcollector/libcol-i386-dis.c | 2 | ||||
-rw-r--r-- | gprofng/libcollector/libcol_util.h | 2 | ||||
-rw-r--r-- | gprofng/libcollector/linetrace.c | 4 |
10 files changed, 448 insertions, 72 deletions
diff --git a/gprofng/libcollector/Makefile.am b/gprofng/libcollector/Makefile.am index 32eb071..e085c03 100644 --- a/gprofng/libcollector/Makefile.am +++ b/gprofng/libcollector/Makefile.am @@ -17,7 +17,7 @@ # <http://www.gnu.org/licenses/>. AUTOMAKE_OPTIONS = foreign -ACLOCAL_AMFLAGS = -I . -I ../.. +ACLOCAL_AMFLAGS = -I . -I ../.. -I ../../config CSOURCES = \ gethrtime.c \ diff --git a/gprofng/libcollector/Makefile.in b/gprofng/libcollector/Makefile.in index 4448745..a856f47 100644 --- a/gprofng/libcollector/Makefile.in +++ b/gprofng/libcollector/Makefile.in @@ -109,7 +109,9 @@ host_triplet = @host@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/../../config/clang-plugin.m4 \ + $(top_srcdir)/../../config/depstand.m4 \ + $(top_srcdir)/../../config/gcc-plugin.m4 \ $(top_srcdir)/../../config/lead-dot.m4 \ $(top_srcdir)/../../config/override.m4 \ $(top_srcdir)/../../config/warnings.m4 \ @@ -337,6 +339,7 @@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ +LLVM_CONFIG = @LLVM_CONFIG@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ @@ -420,7 +423,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = foreign -ACLOCAL_AMFLAGS = -I . -I ../.. +ACLOCAL_AMFLAGS = -I . -I ../.. -I ../../config CSOURCES = \ gethrtime.c \ dispatcher.c \ diff --git a/gprofng/libcollector/aclocal.m4 b/gprofng/libcollector/aclocal.m4 index 2d13dba..b269df7 100644 --- a/gprofng/libcollector/aclocal.m4 +++ b/gprofng/libcollector/aclocal.m4 @@ -1227,7 +1227,9 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([../../config/clang-plugin.m4]) m4_include([../../config/depstand.m4]) +m4_include([../../config/gcc-plugin.m4]) m4_include([../../config/lead-dot.m4]) m4_include([../../config/override.m4]) m4_include([../../config/warnings.m4]) diff --git a/gprofng/libcollector/collector.c b/gprofng/libcollector/collector.c index 8d978a6..3bb3fc3 100644 --- a/gprofng/libcollector/collector.c +++ b/gprofng/libcollector/collector.c @@ -182,11 +182,12 @@ static void init_tracelevel () { #if DEBUG - char *s = CALL_UTIL (getenv)("SP_COLLECTOR_TRACELEVEL"); + char *s = CALL_UTIL (getenv)(SP_COLLECTOR_TRACELEVEL); if (s != NULL) __collector_tracelevel = CALL_UTIL (atoi)(s); - TprintfT (DBG_LT0, "collector: SP_COLLECTOR_TRACELEVEL=%d\n", __collector_tracelevel); - s = CALL_UTIL (getenv)("SP_COLLECTOR_DEBUG"); + TprintfT (DBG_LT0, "collector: %s=%d\n", SP_COLLECTOR_TRACELEVEL, + __collector_tracelevel); + s = CALL_UTIL (getenv)(SP_COLLECTOR_DEBUG); if (s != NULL) collector_debug_opt = CALL_UTIL (atoi)(s) & ~(SP_DUMP_TIME | SP_DUMP_FLAG); #endif @@ -239,21 +240,24 @@ collector_init () collector_module_init (get_collector_interface ()); /* determine experiment name */ - char *exp = CALL_UTIL (getenv)("SP_COLLECTOR_EXPNAME"); + char *exp = CALL_UTIL (getenv)(SP_COLLECTOR_EXPNAME); if ((exp == NULL) || (CALL_UTIL (strlen)(exp) == 0)) { - TprintfT (DBG_LT0, "collector_init: SP_COLLECTOR_EXPNAME undefined - no experiment to start\n"); + TprintfT (DBG_LT0, "collector_init: %s undefined. no experiment to start\n", + SP_COLLECTOR_EXPNAME); /* not set -- no experiment to run */ return; } else - TprintfT (DBG_LT1, "collector_init: found SP_COLLECTOR_EXPNAME = %s\n", exp); + TprintfT (DBG_LT1, "collector_init: found %s = %s\n", + SP_COLLECTOR_EXPNAME, exp); /* determine the data descriptor for the experiment */ - char *params = CALL_UTIL (getenv)("SP_COLLECTOR_PARAMS"); + char *params = CALL_UTIL (getenv)(SP_COLLECTOR_PARAMS); if (params == NULL) { - TprintfT (0, "collector_init: SP_COLLECTOR_PARAMS undefined - no experiment to start\n"); + TprintfT (0, "collector_init: %s undefined - no experiment to start\n", + SP_COLLECTOR_EXPNAME); return; } @@ -494,7 +498,8 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or return COL_ERROR_EXPOPEN; } __collector_start_time = collector_interface.getHiResTime (); - TprintfT (DBG_LT1, "\n\t\t__collector_open_experiment(SP_COLLECTOR_EXPNAME=%s, params=%s, origin=%d); setting start_time\n", + TprintfT (DBG_LT1, "\n\t\t__collector_open_experiment(%s=%s, params=%s, " + "origin=%d); setting start_time\n", SP_COLLECTOR_EXPNAME, exp, params, origin); if (environ) __collector_env_printall ("__collector_open_experiment", environ); @@ -548,23 +553,20 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or is_founder = getpid (); if (origin != SP_ORIGIN_DBX_ATTACH) { - envar = CALL_UTIL (getenv)("SP_COLLECTOR_FOUNDER"); + envar = CALL_UTIL (getenv)(SP_COLLECTOR_FOUNDER); if (envar) is_founder = CALL_UTIL (atoi)(envar); if (is_founder != 0) { if (is_founder != getpid ()) { - TprintfT (0, "__collector_open_experiment SP_COLLECTOR_FOUNDER=%d != pid(%d)\n", - is_founder, getpid ()); - //CALL_UTIL(fprintf)(stderr, "__collector_open_experiment SP_COLLECTOR_FOUNDER=%d != pid(%d); not recording experiment\n", - //is_founder, getpid() ); - //return COL_ERROR_UNEXP_FOUNDER; + TprintfT (0, "__collector_open_experiment %s=%d != pid(%d)\n", + SP_COLLECTOR_FOUNDER, is_founder, getpid ()); is_founder = 0; // Special case (CR 22917352) } /* clear FOUNDER for descendant experiments */ - TprintfT (0, "__collector_open_experiment setting SP_COLLECTOR_FOUNDER=0\n"); - CALL_UTIL (strlcpy)(buffer, "SP_COLLECTOR_FOUNDER=0", sizeof (buffer)); + TprintfT (0, "__collector_open_experiment setting %s=0\n", SP_COLLECTOR_FOUNDER); + CALL_UTIL (snprintf)(buffer, sizeof (buffer), "%s=0", SP_COLLECTOR_FOUNDER); CALL_UTIL (putenv)(buffer); } } @@ -617,8 +619,10 @@ __collector_open_experiment (const char *exp, const char *params, sp_origin_t or return COL_ERROR_BADDIR; } static char exp_name_env[MAXPATHLEN + 1]; - TprintfT (DBG_LT1, "collector_open_experiment: setting SP_COLLECTOR_EXPNAME to %s\n", __collector_exp_dir_name); - CALL_UTIL (snprintf)(exp_name_env, sizeof (exp_name_env), "SP_COLLECTOR_EXPNAME=%s", __collector_exp_dir_name); + TprintfT (DBG_LT1, "collector_open_experiment: setting %s to %s\n", + SP_COLLECTOR_EXPNAME, __collector_exp_dir_name); + CALL_UTIL (snprintf)(exp_name_env, sizeof (exp_name_env), "%s=%s", + SP_COLLECTOR_EXPNAME, __collector_exp_dir_name); CALL_UTIL (putenv)(exp_name_env); } /* Check that the name is that of a directory (new structure) */ @@ -1049,8 +1053,10 @@ collector_tail_init (const char *parent_exp_name) if (collector_exp_dir_append_x (linenum, parent_exp_name) != 0) return COL_ERROR_BADDIR; static char exp_name_env[MAXPATHLEN + 1]; - CALL_UTIL (snprintf)(exp_name_env, sizeof (exp_name_env), "SP_COLLECTOR_EXPNAME=%s", __collector_exp_dir_name); - TprintfT (DBG_LT1, "collector_tail_init: setting SP_COLLECTOR_EXPNAME to %s\n", __collector_exp_dir_name); + CALL_UTIL (snprintf)(exp_name_env, sizeof (exp_name_env), "%s=%s", + SP_COLLECTOR_EXPNAME, __collector_exp_dir_name); + TprintfT (DBG_LT1, "collector_tail_init: setting %s to %s\n", + SP_COLLECTOR_EXPNAME, __collector_exp_dir_name); CALL_UTIL (putenv)(exp_name_env); } /* initialize the segments map and mmap interposition */ @@ -2045,8 +2051,15 @@ log_header_write (sp_origin_t origin) { long page_size = CALL_UTIL (sysconf)(_SC_PAGESIZE); long npages = CALL_UTIL (sysconf)(_SC_PHYS_PAGES); - __collector_log_write ("<system hostname=\"%s\" arch=\"%s\" os=\"%s %s\" pagesz=\"%ld\" npages=\"%ld\">\n", - sysinfo.nodename, sysinfo.machine, sysinfo.sysname, sysinfo.release, page_size, npages); +#ifdef WORDS_BIGENDIAN + int bigendian = 1; +#else + int bigendian = 0; +#endif + __collector_log_write ("<system hostname=\"%s\" arch=\"%s\" os=\"%s %s\" " + "pagesz=\"%ld\" npages=\"%ld\" bigendian=\"%d\">\n", + sysinfo.nodename, sysinfo.machine, sysinfo.sysname, + sysinfo.release, page_size, npages, bigendian); } //YXXX Updating this section? Check similar cut/paste code in: diff --git a/gprofng/libcollector/configure b/gprofng/libcollector/configure index 0baad7c..6e2429a 100755 --- a/gprofng/libcollector/configure +++ b/gprofng/libcollector/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gprofng 2.44.50. +# Generated by GNU Autoconf 2.69 for gprofng 2.45.50. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gprofng' PACKAGE_TARNAME='gprofng' -PACKAGE_VERSION='2.44.50' -PACKAGE_STRING='gprofng 2.44.50' +PACKAGE_VERSION='2.45.50' +PACKAGE_STRING='gprofng 2.45.50' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -640,6 +640,7 @@ OTOOL LIPO NMEDIT DSYMUTIL +LLVM_CONFIG OBJDUMP LN_S NM @@ -1324,7 +1325,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gprofng 2.44.50 to adapt to many kinds of systems. +\`configure' configures gprofng 2.45.50 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1395,7 +1396,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gprofng 2.44.50:";; + short | recursive ) echo "Configuration of gprofng 2.45.50:";; esac cat <<\_ACEOF @@ -1504,7 +1505,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gprofng configure 2.44.50 +gprofng configure 2.45.50 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1990,7 +1991,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gprofng $as_me 2.44.50, which was +It was created by gprofng $as_me 2.45.50, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2967,7 +2968,7 @@ fi # Define the identity of the package. PACKAGE='gprofng' - VERSION='2.44.50' + VERSION='2.45.50' cat >>confdefs.h <<_ACEOF @@ -7110,8 +7111,266 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown -plugin_option= + +# Try CLANG_PLUGIN_FILE first since GCC_PLUGIN_OPTION may return the +# wrong plugin_option with clang. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 +$as_echo_n "checking for clang... " >&6; } +if ${clang_cv_is_clang+:} false; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#ifdef __clang__ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then : + clang_cv_is_clang=yes +else + clang_cv_is_clang=no +fi +rm -f conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $clang_cv_is_clang" >&5 +$as_echo "$clang_cv_is_clang" >&6; } + plugin_file= + if test $clang_cv_is_clang = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang plugin file" >&5 +$as_echo_n "checking for clang plugin file... " >&6; } + plugin_names="LLVMgold.so" + for plugin in $plugin_names; do + plugin_file=`${CC} ${CFLAGS} --print-file-name $plugin` + if test x$plugin_file = x$plugin; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}llvm-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}llvm-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_LLVM_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$LLVM_CONFIG"; then + ac_cv_prog_LLVM_CONFIG="$LLVM_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LLVM_CONFIG="${ac_tool_prefix}llvm-config" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LLVM_CONFIG=$ac_cv_prog_LLVM_CONFIG +if test -n "$LLVM_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LLVM_CONFIG" >&5 +$as_echo "$LLVM_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LLVM_CONFIG"; then + ac_ct_LLVM_CONFIG=$LLVM_CONFIG + # Extract the first word of "llvm-config", so it can be a program name with args. +set dummy llvm-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_LLVM_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_LLVM_CONFIG"; then + ac_cv_prog_ac_ct_LLVM_CONFIG="$ac_ct_LLVM_CONFIG" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_LLVM_CONFIG="llvm-config" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LLVM_CONFIG=$ac_cv_prog_ac_ct_LLVM_CONFIG +if test -n "$ac_ct_LLVM_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LLVM_CONFIG" >&5 +$as_echo "$ac_ct_LLVM_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LLVM_CONFIG" = x; then + LLVM_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LLVM_CONFIG=$ac_ct_LLVM_CONFIG + fi +else + LLVM_CONFIG="$ac_cv_prog_LLVM_CONFIG" +fi + + if test "$?" != 0; then + as_fn_error $? "Required tool 'llvm-config' not found on PATH." "$LINENO" 5 + fi + clang_lib_dir=`$LLVM_CONFIG --libdir` + if test -f $clang_lib_dir/$plugin; then + plugin_file=$clang_lib_dir/$plugin + fi + if test x$plugin_file != x$plugin; then + break; + fi + fi + done + if test -z $plugin_file; then + as_fn_error $? "Couldn't find clang plugin file for $CC." "$LINENO" 5 + fi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + + if test "${AR}" = "" ; then + as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 + fi + plugin_option="--plugin $plugin_file" + touch conftest.c + ${AR} $plugin_option rc conftest.a conftest.c + if test "$?" != 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} + plugin_file= + fi + rm -f conftest.* + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_file" >&5 +$as_echo "$plugin_file" >&6; } + fi + plugin_file="$plugin_file" + +if test -n "$plugin_file"; then + plugin_option="--plugin $plugin_file" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -plugin option" >&5 +$as_echo_n "checking for -plugin option... " >&6; } + plugin_names="liblto_plugin.so liblto_plugin-0.dll cyglto_plugin-0.dll" +plugin_option= for plugin in $plugin_names; do plugin_so=`${CC} ${CFLAGS} --print-prog-name $plugin` if test x$plugin_so = x$plugin; then @@ -7122,7 +7381,119 @@ for plugin in $plugin_names; do break fi done +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="ar" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +else + AR="$ac_cv_prog_AR" +fi + +if test "${AR}" = "" ; then + as_fn_error $? "Required archive tool 'ar' not found on PATH." "$LINENO" 5 +fi +touch conftest.c +${AR} $plugin_option rc conftest.a conftest.c +if test "$?" != 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 +$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} + plugin_option= +fi +rm -f conftest.* +if test -n "$plugin_option"; then + plugin_option="$plugin_option" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $plugin_option" >&5 +$as_echo "$plugin_option" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + +fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 @@ -7217,17 +7588,15 @@ fi test -z "$AR" && AR=ar if test -n "$plugin_option"; then - if $AR --help 2>&1 | grep -q "\--plugin"; then - touch conftest.c - $AR $plugin_option rc conftest.a conftest.c - if test "$?" != 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Failed: $AR $plugin_option rc" >&5 -$as_echo "$as_me: WARNING: Failed: $AR $plugin_option rc" >&2;} - else + case "$AR" in + *"$plugin_option"*) + ;; + *) + if $AR --help 2>&1 | grep -q "\--plugin"; then AR="$AR $plugin_option" fi - rm -f conftest.* - fi + ;; + esac fi test -z "$AR_FLAGS" && AR_FLAGS=cru @@ -7434,9 +7803,15 @@ fi test -z "$RANLIB" && RANLIB=: if test -n "$plugin_option" && test "$RANLIB" != ":"; then - if $RANLIB --help 2>&1 | grep -q "\--plugin"; then - RANLIB="$RANLIB $plugin_option" - fi + case "$RANLIB" in + *"$plugin_option"*) + ;; + *) + if $RANLIB --help 2>&1 | grep -q "\--plugin"; then + RANLIB="$RANLIB $plugin_option" + fi + ;; + esac fi @@ -12094,7 +12469,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12097 "configure" +#line 12472 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12200,7 +12575,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12203 "configure" +#line 12578 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16136,7 +16511,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gprofng $as_me 2.44.50, which was +This file was extended by gprofng $as_me 2.45.50, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16202,7 +16577,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gprofng config.status 2.44.50 +gprofng config.status 2.45.50 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/gprofng/libcollector/descendants.h b/gprofng/libcollector/descendants.h index 0148410..7d594b3 100644 --- a/gprofng/libcollector/descendants.h +++ b/gprofng/libcollector/descendants.h @@ -44,7 +44,6 @@ typedef enum LM_TRACK_LINEAGE = 1, /* env vars preserved, recording */ } line_mode_t; -extern line_mode_t line_mode; extern int user_follow_mode; extern int java_mode; extern int dbg_current_mode; /* for debug only */ @@ -56,19 +55,6 @@ extern char **sp_env_backup; #define PUSH_REENTRANCE(x) ((*(x))++) #define POP_REENTRANCE(x) ((*(x))--) -/* environment variables that must be forwarded to descendents */ -#define SP_COLLECTOR_PARAMS "SP_COLLECTOR_PARAMS" -#define SP_COLLECTOR_EXPNAME "SP_COLLECTOR_EXPNAME" -#define SP_COLLECTOR_FOLLOW_SPEC "SP_COLLECTOR_FOLLOW_SPEC" -#define SP_COLLECTOR_FOUNDER "SP_COLLECTOR_FOUNDER" -#define SP_PRELOAD_STRINGS "SP_COLLECTOR_PRELOAD" -#define LD_PRELOAD_STRINGS "LD_PRELOAD" -#define SP_LIBPATH_STRINGS "SP_COLLECTOR_LIBRARY_PATH" -#define LD_LIBPATH_STRINGS "LD_LIBRARY_PATH" -#define JAVA_TOOL_OPTIONS "JAVA_TOOL_OPTIONS" -#define COLLECTOR_JVMTI_OPTION "-agentlib:gp-collector" - -extern int __collector_linetrace_shutdown_hwcs_6830763_XXXX; extern void __collector_env_unset (char *envp[]); extern void __collector_env_save_preloads (); extern char ** __collector_env_backup (); diff --git a/gprofng/libcollector/envmgmt.c b/gprofng/libcollector/envmgmt.c index 0c3bea1..0a2add9 100644 --- a/gprofng/libcollector/envmgmt.c +++ b/gprofng/libcollector/envmgmt.c @@ -285,9 +285,6 @@ env_ld_preload_strip (char *envv) for (int v = 0; SP_PRELOAD[v]; v++) if (env_strip (envv, sp_preloads[v])) return 0; - if (line_mode != LM_CLOSED) - TprintfT (DBG_LT2, "env_ld_preload_strip(): WARNING - could not strip SP_PRELOADS from '%s'\n", - envv); return -2; } diff --git a/gprofng/libcollector/libcol-i386-dis.c b/gprofng/libcollector/libcol-i386-dis.c index 81ca366..15c91f7 100644 --- a/gprofng/libcollector/libcol-i386-dis.c +++ b/gprofng/libcollector/libcol-i386-dis.c @@ -18,7 +18,7 @@ Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ -#if defined(__i386__) || defined(__x86_64) +#if defined(__i386__) || defined(__x86_64__) #include "opcodes/i386-dis.c" #undef _ diff --git a/gprofng/libcollector/libcol_util.h b/gprofng/libcollector/libcol_util.h index afe75f8..08e34a1 100644 --- a/gprofng/libcollector/libcol_util.h +++ b/gprofng/libcollector/libcol_util.h @@ -183,7 +183,7 @@ static __attribute__ ((always_inline)) inline void * __collector_getpc () { void *r; -#if defined(__x86_64) +#if defined(__x86_64__) __asm__ __volatile__("lea (%%rip), %0" : "=r" (r)); #else __asm__ __volatile__("call 1f \n" diff --git a/gprofng/libcollector/linetrace.c b/gprofng/libcollector/linetrace.c index 86d9955..0e3e7cd 100644 --- a/gprofng/libcollector/linetrace.c +++ b/gprofng/libcollector/linetrace.c @@ -37,10 +37,10 @@ #define LT_MAXNAMELEN 1024 #define LT_MAXPATHLEN 1024 -int __collector_linetrace_shutdown_hwcs_6830763_XXXX = 0; +static int __collector_linetrace_shutdown_hwcs_6830763_XXXX = 0; int dbg_current_mode = FOLLOW_NONE; /* for debug only */ unsigned line_key = COLLECTOR_TSD_INVALID_KEY; -line_mode_t line_mode = LM_DORMANT; +static line_mode_t line_mode = LM_DORMANT; int user_follow_mode = FOLLOW_ON; int java_mode = 0; |