]>
Commit | Line | Data |
---|---|---|
3c926509 MT |
1 | 2011-01-14 Tom Tromey <tromey@redhat.com> |
2 | ||
3 | * unwind-dw2.c: Include sys/sdt.h if it exists. | |
4 | (_Unwind_DebugHook): Use STAP_PROBE2. | |
5 | * config.in, configure: Rebuild. | |
6 | * configure.ac: Check for sys/sdt.h. | |
7 | ||
8 | --- gcc/configure.ac | |
9 | +++ gcc/configure.ac | |
10 | @@ -4313,6 +4313,16 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then | |
11 | [Define if your target C library provides stack protector support]) | |
12 | fi | |
13 | ||
14 | +# Test for <sys/sdt.h> on the target. | |
15 | +GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H]) | |
16 | +AC_MSG_CHECKING(sys/sdt.h in the target C library) | |
17 | +have_sys_sdt_h=no | |
18 | +if test -f $target_header_dir/sys/sdt.h; then | |
19 | + AC_DEFINE(HAVE_SYS_SDT_H, 1, | |
20 | + [Define if your target C library provides sys/sdt.h]) | |
21 | +fi | |
22 | +AC_MSG_RESULT($have_sys_sdt_h) | |
23 | + | |
24 | # Check if TFmode long double should be used by default or not. | |
25 | # Some glibc targets used DFmode long double, but with glibc 2.4 | |
26 | # and later they can use TFmode. | |
27 | --- gcc/unwind-dw2.c | |
28 | +++ gcc/unwind-dw2.c | |
29 | @@ -37,6 +37,10 @@ | |
30 | #include "gthr.h" | |
31 | #include "unwind-dw2.h" | |
32 | ||
33 | +#ifdef HAVE_SYS_SDT_H | |
34 | +#include <sys/sdt.h> | |
35 | +#endif | |
36 | + | |
37 | #ifndef __USING_SJLJ_EXCEPTIONS__ | |
38 | ||
39 | #ifndef STACK_GROWS_DOWNWARD | |
40 | @@ -1493,7 +1497,13 @@ static void | |
41 | _Unwind_DebugHook (void *cfa __attribute__ ((__unused__)), | |
42 | void *handler __attribute__ ((__unused__))) | |
43 | { | |
44 | + /* We only want to use stap probes starting with v3. Earlier | |
45 | + versions added too much startup cost. */ | |
46 | +#if defined (HAVE_SYS_SDT_H) && defined (STAP_PROBE2) && _SDT_NOTE_TYPE >= 3 | |
47 | + STAP_PROBE2 (libgcc, unwind, cfa, handler); | |
48 | +#else | |
49 | asm (""); | |
50 | +#endif | |
51 | } | |
52 | ||
53 | /* Install TARGET into CURRENT so that we can return to it. This is a | |
54 | ||
55 | --- gcc/config.in.jj 2011-01-22 10:21:47.000000000 +0100 | |
56 | +++ gcc/config.in 2011-01-22 11:10:39.000000000 +0100 | |
57 | @@ -1405,6 +1407,9 @@ | |
58 | #endif | |
59 | ||
60 | ||
61 | +/* Define if your target C library provides sys/sdt.h */ | |
62 | +#undef HAVE_SYS_SDT_H | |
63 | + | |
64 | /* Define to 1 if you have the <sys/stat.h> header file. */ | |
65 | #ifndef USED_FOR_TARGET | |
66 | #undef HAVE_SYS_STAT_H | |
67 | --- gcc/configure.jj 2011-01-22 10:20:55.000000000 +0100 | |
68 | +++ gcc/configure 2011-01-22 11:10:34.990648298 +0100 | |
69 | @@ -25757,6 +25757,19 @@ $as_echo "#define TARGET_LIBC_PROVIDES_S | |
70 | ||
71 | fi | |
72 | ||
73 | +# Test for <sys/sdt.h> on the target. | |
74 | + | |
75 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5 | |
76 | +$as_echo_n "checking sys/sdt.h in the target C library... " >&6; } | |
77 | +have_sys_sdt_h=no | |
78 | +if test -f $target_header_dir/sys/sdt.h; then | |
79 | + | |
80 | +$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h | |
81 | + | |
82 | +fi | |
83 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5 | |
84 | +$as_echo "$have_sys_sdt_h" >&6; } | |
85 | + | |
86 | # Check if TFmode long double should be used by default or not. | |
87 | # Some glibc targets used DFmode long double, but with glibc 2.4 | |
88 | # and later they can use TFmode. |