diff options
author | Tom Tromey <tromey@redhat.com> | 2011-03-14 19:47:58 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2011-03-14 19:47:58 +0000 |
commit | f4e749b49840f856b460fdf2a8e501d4436fbc16 (patch) | |
tree | a7d216e75ae40a2e56ee400b56f3a35b1d77e17b | |
parent | d34abfd27199742109a50122c3ee545a57b8fa6f (diff) | |
download | gcc-f4e749b49840f856b460fdf2a8e501d4436fbc16.zip gcc-f4e749b49840f856b460fdf2a8e501d4436fbc16.tar.gz gcc-f4e749b49840f856b460fdf2a8e501d4436fbc16.tar.bz2 |
unwind-dw2.c: Include sys/sdt.h if it exists.
* unwind-dw2.c: Include sys/sdt.h if it exists.
(_Unwind_DebugHook): Use STAP_PROBE2.
* config.in, configure: Rebuild.
* configure.ac: Check for sys/sdt.h.
From-SVN: r170954
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config.in | 3 | ||||
-rwxr-xr-x | gcc/configure | 13 | ||||
-rw-r--r-- | gcc/configure.ac | 10 | ||||
-rw-r--r-- | gcc/unwind-dw2.c | 12 |
5 files changed, 44 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9a4f888..0c9102c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-01-14 Tom Tromey <tromey@redhat.com> + + * unwind-dw2.c: Include sys/sdt.h if it exists. + (_Unwind_DebugHook): Use STAP_PROBE2. + * config.in, configure: Rebuild. + * configure.ac: Check for sys/sdt.h. + 2011-03-14 Uros Bizjak <ubizjak@gmail.com> * config/i386/i386.md (ROUND_FLOOR): New constant. diff --git a/gcc/config.in b/gcc/config.in index 584ec65..7604b68 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1408,6 +1408,9 @@ #endif +/* Define if your target C library provides sys/sdt.h */ +#undef HAVE_SYS_SDT_H + /* Define to 1 if you have the <sys/stat.h> header file. */ #ifndef USED_FOR_TARGET #undef HAVE_SYS_STAT_H diff --git a/gcc/configure b/gcc/configure index a454946..e5e6164 100755 --- a/gcc/configure +++ b/gcc/configure @@ -25792,6 +25792,19 @@ $as_echo "#define TARGET_LIBC_PROVIDES_SSP 1" >>confdefs.h fi +# Test for <sys/sdt.h> on the target. + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 +$as_echo_n "checking sys/sdt.h in the target C library... " >&6; } +have_sys_sdt_h=no +if test -f $target_header_dir/sys/sdt.h; then + +$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 +$as_echo "$have_sys_sdt_h" >&6; } + # Check if TFmode long double should be used by default or not. # Some glibc targets used DFmode long double, but with glibc 2.4 # and later they can use TFmode. diff --git a/gcc/configure.ac b/gcc/configure.ac index 03a8cef..fd4dd46 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -4381,6 +4381,16 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then [Define if your target C library provides stack protector support]) fi +# Test for <sys/sdt.h> on the target. +GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) +AC_MSG_CHECKING(sys/sdt.h in the target C library) +have_sys_sdt_h=no +if test -f $target_header_dir/sys/sdt.h; then + AC_DEFINE(HAVE_SYS_SDT_H, 1, + [Define if your target C library provides sys/sdt.h]) +fi +AC_MSG_RESULT($have_sys_sdt_h) + # Check if TFmode long double should be used by default or not. # Some glibc targets used DFmode long double, but with glibc 2.4 # and later they can use TFmode. diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c index 2ea9adb..25990b4 100644 --- a/gcc/unwind-dw2.c +++ b/gcc/unwind-dw2.c @@ -1,6 +1,6 @@ /* DWARF2 exception handling and frame unwind runtime interface routines. Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2008, 2009, 2010 Free Software Foundation, Inc. + 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This file is part of GCC. @@ -37,6 +37,10 @@ #include "gthr.h" #include "unwind-dw2.h" +#ifdef HAVE_SYS_SDT_H +#include <sys/sdt.h> +#endif + #ifndef __USING_SJLJ_EXCEPTIONS__ #ifndef STACK_GROWS_DOWNWARD @@ -1493,7 +1497,13 @@ static void _Unwind_DebugHook (void *cfa __attribute__ ((__unused__)), void *handler __attribute__ ((__unused__))) { + /* We only want to use stap probes starting with v3. Earlier + versions added too much startup cost. */ +#if defined (HAVE_SYS_SDT_H) && defined (STAP_PROBE2) && _SDT_NOTE_TYPE >= 3 + STAP_PROBE2 (libgcc, unwind, cfa, handler); +#else asm (""); +#endif } /* Install TARGET into CURRENT so that we can return to it. This is a |