glibc/glibc-stap.patch

560 lines
20 KiB
Diff
Raw Normal View History

2012-05-23 18:18:07 +00:00
diff -Nrup c/config.h.in d/config.h.in
--- c/config.h.in 2012-05-20 19:47:38.000000000 -0600
+++ d/config.h.in 2012-05-20 23:51:59.511489307 -0600
@@ -208,6 +208,9 @@
#endif
2012-05-23 18:18:07 +00:00
+/* Define if Systemtap <sys/sdt.h> probes should be defined. */
+#undef USE_STAP_PROBE
+
/*
*/
2012-05-23 18:18:07 +00:00
diff -Nrup c/configure d/configure
--- c/configure 2012-05-20 23:51:08.075734606 -0600
+++ d/configure 2012-05-20 23:53:48.520969358 -0600
@@ -1441,6 +1441,7 @@ Optional Features:
--enable-nss-crypt enable libcrypt to use nss
--enable-obsolete-rpc build and install the obsolete RPC code for
link-time usage
+ --enable-systemtap enable systemtap static probe points [default=no]
2012-05-23 18:18:07 +00:00
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -3767,6 +3768,51 @@ if test "$link_obsolete_rpc" = yes; then
2012-05-23 18:18:07 +00:00
fi
2012-05-23 18:18:07 +00:00
+# Check whether --enable-systemtap was given.
+if test "${enable_systemtap+set}" = set; then :
+ enableval=$enable_systemtap; systemtap=$enableval
+else
+ systemtap=no
+fi
+
+if test x$systemtap != xno; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for systemtap static probe support" >&5
+$as_echo_n "checking for systemtap static probe support... " >&6; }
+if test "${libc_cv_sdt+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="-std=gnu99 $CFLAGS"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/sdt.h>
+void foo (int i, void *p)
+{
+ asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
+ :: STAP_PROBE_ASM_OPERANDS (2, i, p));
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libc_cv_sdt=yes
+else
+ libc_cv_sdt=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ CFLAGS="$old_CFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sdt" >&5
+$as_echo "$libc_cv_sdt" >&6; }
+ if test $libc_cv_sdt = yes; then
+ $as_echo "#define USE_STAP_PROBE 1" >>confdefs.h
+
+ else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "systemtap support needs sys/sdt.h with asm support
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+fi
+
# The way shlib-versions is used to generate soversions.mk uses a
# fairly simplistic model for name recognition that can't distinguish
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
diff -Nrup c/configure.in d/configure.in
--- c/configure.in 2012-05-20 19:47:38.000000000 -0600
+++ d/configure.in 2012-05-20 23:51:59.558489083 -0600
@@ -263,6 +263,29 @@ if test "$link_obsolete_rpc" = yes; then
AC_DEFINE(LINK_OBSOLETE_RPC)
fi
2012-05-23 18:18:07 +00:00
+AC_ARG_ENABLE([systemtap],
+ [AS_HELP_STRING([--enable-systemtap],
+ [enable systemtap static probe points @<:@default=no@:>@])],
+ [systemtap=$enableval],
+ [systemtap=no])
+if test x$systemtap != xno; then
+ AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="-std=gnu99 $CFLAGS"
+ AC_COMPILE_IFELSE([#include <sys/sdt.h>
+void foo (int i, void *p)
+{
+ asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
+ :: STAP_PROBE_ASM_OPERANDS (2, i, p));
+}], [libc_cv_sdt=yes], [libc_cv_sdt=no])
+ CFLAGS="$old_CFLAGS"])
+ if test $libc_cv_sdt = yes; then
+ AC_DEFINE([USE_STAP_PROBE])
+ else
+ AC_MSG_FAILURE([systemtap support needs sys/sdt.h with asm support])
+ fi
+fi
+
# The way shlib-versions is used to generate soversions.mk uses a
# fairly simplistic model for name recognition that can't distinguish
# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os
diff -Nrup c/elf/Makefile d/elf/Makefile
--- c/elf/Makefile 2012-05-20 23:51:07.907735407 -0600
+++ d/elf/Makefile 2012-05-20 23:51:59.561489070 -0600
@@ -423,7 +423,8 @@ CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
CFLAGS-cache.c = $(SYSCONF-FLAGS)
CFLAGS-rtld.c = $(SYSCONF-FLAGS)
2012-05-23 18:18:07 +00:00
-CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
+CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
+ -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
2012-05-23 18:18:07 +00:00
test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
generated += $(addsuffix .so,$(strip $(modules-names)))
diff -Nrup c/elf/rtld-Rules d/elf/rtld-Rules
--- c/elf/rtld-Rules 2012-05-20 19:47:38.000000000 -0600
+++ d/elf/rtld-Rules 2012-05-20 23:51:59.561489070 -0600
@@ -1,7 +1,7 @@
# Subroutine makefile for compiling libc modules linked into dynamic linker.
2012-05-23 18:18:07 +00:00
# Copyright (C) 2002,2003,2005,2006,2008,2010,2011
-# Free Software Foundation, Inc.
+# Free Software Foundation, Inc.
# This file is part of the GNU C Library.
2012-05-23 18:18:07 +00:00
# The GNU C Library is free software; you can redistribute it and/or
@@ -130,6 +130,6 @@ ifdef rtld-depfiles
endif
2012-05-23 18:18:07 +00:00
# This here is the whole point of all the shenanigans.
-rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1
+rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
2012-05-23 18:18:07 +00:00
endif
diff -Nrup c/extra-lib.mk d/extra-lib.mk
--- c/extra-lib.mk 2012-05-20 19:47:38.000000000 -0600
+++ d/extra-lib.mk 2012-05-20 23:51:59.559489078 -0600
@@ -101,4 +101,4 @@ ifneq (,$(cpp-srcs-left))
include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
endif
2012-05-23 18:18:07 +00:00
-CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
+CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 -DIN_LIB=$(lib)
diff -Nrup c/include/stap-probe.h d/include/stap-probe.h
--- c/include/stap-probe.h 1969-12-31 17:00:00.000000000 -0700
+++ d/include/stap-probe.h 2012-05-20 23:51:59.510489312 -0600
@@ -0,0 +1,140 @@
+/* Macros for defining Systemtap <sys/sdt.h> static probe points.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _STAP_PROBE_H
+#define _STAP_PROBE_H 1
+
+#ifdef USE_STAP_PROBE
+
+# include <sys/sdt.h>
+
+/* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn).
+
+ Without USE_STAP_PROBE, that does nothing but evaluates all
+ its arguments (to prevent bit rot, unlike e.g. assert).
+
+ Systemtap's header defines the macros STAP_PROBE (provider, name) and
+ STAP_PROBEn (provider, name, arg1, ..., argn). For "provider" we paste
+ in the IN_LIB name (libc, libpthread, etc.) automagically. */
+
+# ifndef NOT_IN_libc
+# define IN_LIB libc
+# elif !defined IN_LIB
+/* This is intentionally defined with extra unquoted commas in it so
+ that macro substitution will bomb out when it is used. We don't
+ just use #error here, so that this header can be included by
+ other headers that use LIBC_PROBE inside their own macros. We
+ only want such headers to fail to compile if those macros are
+ actually used in a context where IN_LIB has not been defined. */
+# define IN_LIB ,,,missing -DIN_LIB=... -- not extra-lib.mk?,,,
+# endif
+
+# define LIBC_PROBE(name, n, ...) \
+ LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
+
+# define LIBC_PROBE_1(lib, name, n, ...) \
+ STAP_PROBE##n (lib, name, ## __VA_ARGS__)
+
+# define STAP_PROBE0 STAP_PROBE
+
+# define LIBC_PROBE_ASM(name, template) \
+ STAP_PROBE_ASM (IN_LIB, name, template)
+
+# define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
+
+#else /* Not USE_STAP_PROBE. */
+
+# ifndef __ASSEMBLER__
+# define LIBC_PROBE(name, n, ...) DUMMY_PROBE##n (__VA_ARGS__)
+# else
+# define LIBC_PROBE(name, n, ...) /* Nothing. */
+# endif
+
+# define LIBC_PROBE_ASM(name, template) /* Nothing. */
+# define LIBC_PROBE_ASM_OPERANDS(n, ...) /* Nothing. */
+
+/* This silliness lets us evaluate all the arguments for each arity
+ of probe. My kingdom for a real macro system. */
+
+# define DUMMY_PROBE0() do {} while (0)
+# define DUMMY_PROBE1(a1) do {} while ((void) (a1), 0)
+# define DUMMY_PROBE2(a1, a2) do {} while ((void) (a1), \
+ (void) (a2), 0)
+# define DUMMY_PROBE3(a1, a2, a3) do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), 0)
+# define DUMMY_PROBE4(a1, a2, a3, a4) do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), 0)
+# define DUMMY_PROBE5(a1, a2, a3, a4, a5) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), 0)
+# define DUMMY_PROBE6(a1, a2, a3, a4, a5, a6) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), 0)
+# define DUMMY_PROBE7(a1, a2, a3, a4, a5, a6, a7) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), \
+ (void) (a7), 0)
+# define DUMMY_PROBE8(a1, a2, a3, a4, a5, a6, a7, a8) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), \
+ (void) (a7), \
+ (void) (a8), 0)
+# define DUMMY_PROBE9(a1, a2, a3, a4, a5, a6, a7, a8, a9) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), \
+ (void) (a7), \
+ (void) (a8), \
+ (void) (a9), 0)
+# define DUMMY_PROBE10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) \
+ do {} while ((void) (a1), \
+ (void) (a2), \
+ (void) (a3), \
+ (void) (a4), \
+ (void) (a5), \
+ (void) (a6), \
+ (void) (a7), \
+ (void) (a8), \
+ (void) (a9), \
+ (void) (a10), 0)
+
+#endif /* USE_STAP_PROBE. */
+
+#endif /* stap-probe.h */
2012-05-23 18:18:07 +00:00
diff -Nrup c/scripts/check-local-headers.sh d/scripts/check-local-headers.sh
--- c/scripts/check-local-headers.sh 2012-05-20 19:47:38.000000000 -0600
+++ d/scripts/check-local-headers.sh 2012-05-20 23:54:51.258670072 -0600
@@ -28,7 +28,7 @@ exec ${AWK} -v includedir="$includedir"
BEGIN {
status = 0
exclude = "^" includedir \
- "/(.*-.*-.*/|)(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|libaudit\\.h)"
+ "/(.*-.*-.*/|)(asm[-/]|linux/|selinux/|gd|nss3/|sys/capability\\.h|libaudit\\.h|sys/sdt(-config)?\\.h))"
}
/^[^ ]/ && $1 ~ /.*:/ { obj = $1 }
{
diff -Nrup c/sysdeps/i386/__longjmp.S d/sysdeps/i386/__longjmp.S
--- c/sysdeps/i386/__longjmp.S 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/i386/__longjmp.S 2012-05-20 23:51:59.478489471 -0600
@@ -1,5 +1,5 @@
/* longjmp for i386.
- Copyright (C) 1995-1998,2000,2002,2005,2006,2009
+ Copyright (C) 1995-1998,2000,2002,2005,2006,2009,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
2012-05-23 18:18:07 +00:00
@@ -20,6 +20,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
2012-05-23 18:18:07 +00:00
.text
ENTRY (__longjmp)
@@ -32,6 +33,7 @@ ENTRY (__longjmp)
movl (JB_SP*4)(%eax), %ecx
PTR_DEMANGLE (%edx)
PTR_DEMANGLE (%ecx)
+ LIBC_PROBE (longjmp, 3, 4@%eax, -4@8(%esp), 4@%edx)
cfi_def_cfa(%eax, 0)
cfi_register(%eip, %edx)
cfi_register(%esp, %ecx)
@@ -49,6 +51,7 @@ ENTRY (__longjmp)
cfi_restore(%edi)
cfi_restore(%ebp)
2012-05-23 18:18:07 +00:00
+ LIBC_PROBE (longjmp_target, 3, 4@%eax, -4@8(%esp), 4@%edx)
movl 8(%esp), %eax /* Second argument is return value. */
movl %ecx, %esp
#else
@@ -56,12 +59,14 @@ ENTRY (__longjmp)
movl 8(%esp), %eax /* Second argument is return value. */
/* Save the return address now. */
movl (JB_PC*4)(%ecx), %edx
+ LIBC_PROBE (longjmp, 3, 4@%ecx, -4@%eax, 4@%edx)
/* Restore registers. */
movl (JB_BX*4)(%ecx), %ebx
movl (JB_SI*4)(%ecx), %esi
movl (JB_DI*4)(%ecx), %edi
movl (JB_BP*4)(%ecx), %ebp
movl (JB_SP*4)(%ecx), %esp
+ LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%ecx, 4@%edx)
#endif
/* Jump to saved PC. */
jmp *%edx
diff -Nrup c/sysdeps/i386/bsd-_setjmp.S d/sysdeps/i386/bsd-_setjmp.S
--- c/sysdeps/i386/bsd-_setjmp.S 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/i386/bsd-_setjmp.S 2012-05-20 23:51:59.479489464 -0600
@@ -1,5 +1,6 @@
/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. i386 version.
- Copyright (C) 1994-1997,2000-2002,2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997,2000-2002,2005,2006,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
2012-05-23 18:18:07 +00:00
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +25,7 @@
#include <jmpbuf-offsets.h>
#include "bp-sym.h"
#include "bp-asm.h"
+#include <stap-probe.h>
2012-05-23 18:18:07 +00:00
#define PARMS LINKAGE /* no space for saved regs */
#define JMPBUF PARMS
@@ -46,6 +48,7 @@ ENTRY (BP_SYM (_setjmp))
#endif
movl %ecx, (JB_SP*4)(%edx)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 4@%edx, -4@$0, 4@%ecx)
#ifdef PTR_MANGLE
PTR_MANGLE (%ecx)
#endif
diff -Nrup c/sysdeps/i386/bsd-setjmp.S d/sysdeps/i386/bsd-setjmp.S
--- c/sysdeps/i386/bsd-setjmp.S 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/i386/bsd-setjmp.S 2012-05-20 23:51:59.505489337 -0600
@@ -1,5 +1,6 @@
/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. i386 version.
- Copyright (C) 1994-1997,2000,2001,2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 1994-1997,2000,2001,2005,2006,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
2012-05-23 18:18:07 +00:00
The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +25,7 @@
#include <jmpbuf-offsets.h>
#include "bp-sym.h"
#include "bp-asm.h"
+#include <stap-probe.h>
2012-05-23 18:18:07 +00:00
#define PARMS LINKAGE /* no space for saved regs */
#define JMPBUF PARMS
@@ -48,6 +50,7 @@ ENTRY (BP_SYM (setjmp))
#endif
movl %ecx, (JB_SP*4)(%eax)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 4@%eax, -4@$1, 4@%ecx)
#ifdef PTR_MANGLE
PTR_MANGLE (%ecx)
#endif
diff -Nrup c/sysdeps/i386/setjmp.S d/sysdeps/i386/setjmp.S
--- c/sysdeps/i386/setjmp.S 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/i386/setjmp.S 2012-05-20 23:51:59.507489327 -0600
@@ -1,5 +1,5 @@
/* setjmp for i386.
- Copyright (C) 1995,1996,1997,2000,2001,2005,2006
+ Copyright (C) 1995,1996,1997,2000,2001,2005,2006,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
2012-05-23 18:18:07 +00:00
@@ -22,6 +22,7 @@
#include <asm-syntax.h>
#include "bp-sym.h"
#include "bp-asm.h"
+#include <stap-probe.h>
2012-05-23 18:18:07 +00:00
#define PARMS LINKAGE /* no space for saved regs */
#define JMPBUF PARMS
@@ -43,6 +44,7 @@ ENTRY (BP_SYM (__sigsetjmp))
#endif
movl %ecx, (JB_SP*4)(%eax)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 4@%eax, -4@SIGMSK(%esp), 4@%ecx)
#ifdef PTR_MANGLE
PTR_MANGLE (%ecx)
#endif
diff -Nrup c/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S d/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S
--- c/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/unix/sysv/linux/i386/____longjmp_chk.S 2012-05-20 23:51:59.507489327 -0600
@@ -1,4 +1,5 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2004,2005,2006,2009,2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
2012-05-23 18:18:07 +00:00
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +19,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
2012-05-23 18:18:07 +00:00
.section .rodata.str1.1,"aMS",@progbits,1
@@ -78,7 +80,9 @@ ENTRY (____longjmp_chk)
cfi_adjust_cfa_offset(-12)
movl 4(%esp), %ecx
2012-05-23 18:18:07 +00:00
-.Lok: /* We add unwind information for the target here. */
+.Lok:
+ LIBC_PROBE (longjmp, 3, 4@%ecx, -4@8(%esp), 4@%edx)
+ /* We add unwind information for the target here. */
cfi_def_cfa(%ecx, 0)
cfi_register(%eip, %edx)
cfi_register(%esp, %edi)
@@ -101,5 +105,6 @@ ENTRY (____longjmp_chk)
cfi_restore(%ebp)
/* Jump to saved PC. */
+ LIBC_PROBE (longjmp_target, 3, 4@%ecx, -4@%eax, 4@%edx)
jmp *%edx
END (____longjmp_chk)
diff -Nrup c/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S d/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S
--- c/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S 2012-05-20 23:51:59.508489322 -0600
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
#include <sigaltstack-offsets.h>
@@ -95,7 +96,9 @@ ENTRY(____longjmp_chk)
movl %ebx, %esi
cfi_restore (%rsi)
-.Lok: /* We add unwind information for the target here. */
+.Lok:
+ LIBC_PROBE (longjmp, 3, 8@%rdi, -4@%esi, 8@%rdx)
+ /* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
cfi_register(%rsp,%r8)
cfi_register(%rbp,%r9)
@@ -114,5 +117,6 @@ ENTRY(____longjmp_chk)
movl %esi, %eax
mov %R8_LP, %RSP_LP
movq %r9,%rbp
+ LIBC_PROBE (longjmp_target, 3, 8@%rdi, -4@%eax, 8@%rdx)
jmpq *%rdx
END (____longjmp_chk)
diff -Nrup c/sysdeps/x86_64/__longjmp.S d/sysdeps/x86_64/__longjmp.S
--- c/sysdeps/x86_64/__longjmp.S 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/x86_64/__longjmp.S 2012-05-20 23:51:59.509489317 -0600
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001,2004,2005,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001,2004,2005,2006,2009,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
/* Jump to the position specified by ENV, causing the
setjmp call there to return VAL, or 1 if VAL is 0.
@@ -33,6 +34,7 @@ ENTRY(__longjmp)
PTR_DEMANGLE (%r9)
PTR_DEMANGLE (%RDX_LP)
#endif
+ LIBC_PROBE (longjmp, 3, 8@%rdi, -4@%esi, 8@%rdx)
/* We add unwind information for the target here. */
cfi_def_cfa(%rdi, 0)
cfi_register(%rsp,%r8)
@@ -52,5 +54,6 @@ ENTRY(__longjmp)
mov %esi, %eax
mov %R8_LP,%RSP_LP
movq %r9,%rbp
+ LIBC_PROBE (longjmp_target, 3, 8@%rdi, -4@%eax, 8@%rdx)
jmpq *%rdx
END (__longjmp)
diff -Nrup c/sysdeps/x86_64/setjmp.S d/sysdeps/x86_64/setjmp.S
--- c/sysdeps/x86_64/setjmp.S 2012-05-20 19:47:38.000000000 -0600
+++ d/sysdeps/x86_64/setjmp.S 2012-05-20 23:52:44.907272800 -0600
@@ -1,5 +1,5 @@
/* setjmp for x86-64.
- Copyright (C) 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001,2003,2005,2006,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
#include <sysdep.h>
#include <jmpbuf-offsets.h>
#include <asm-syntax.h>
+#include <stap-probe.h>
ENTRY (__sigsetjmp)
/* Save registers. */
@@ -40,6 +41,7 @@ ENTRY (__sigsetjmp)
#endif
movq %rdx, (JB_RSP*8)(%rdi)
mov (%rsp), %RAX_LP /* Save PC we are returning to now. */
+ LIBC_PROBE (setjmp, 3, 8@%rdi, -4@%esi, 8@%rax)
#ifdef PTR_MANGLE
PTR_MANGLE (%RAX_LP)
#endif