diff options
Diffstat (limited to 'gprofng/libcollector')
-rw-r--r-- | gprofng/libcollector/collector.c | 59 | ||||
-rwxr-xr-x | gprofng/libcollector/configure | 20 | ||||
-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 |
7 files changed, 50 insertions, 54 deletions
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..ecd1542 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='' @@ -1324,7 +1324,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 +1395,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 +1504,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 +1990,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 +2967,7 @@ fi # Define the identity of the package. PACKAGE='gprofng' - VERSION='2.44.50' + VERSION='2.45.50' cat >>confdefs.h <<_ACEOF @@ -16136,7 +16136,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 +16202,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; |