Blame SOURCES/glibc-rh711927.patch

b9ba6d
Index: glibc-2.12-2-gc4ccff1/config.h.in
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/config.h.in
b9ba6d
+++ glibc-2.12-2-gc4ccff1/config.h.in
b9ba6d
@@ -201,6 +201,9 @@
b9ba6d
 /* Define if multi-arch DSOs should be generated.  */
b9ba6d
 #undef USE_MULTIARCH
b9ba6d
 
b9ba6d
+/* Define if Systemtap <sys/sdt.h> probes should be defined.  */
b9ba6d
+#undef USE_STAP_PROBE
b9ba6d
+
b9ba6d
 /*
b9ba6d
  */
b9ba6d
 
b9ba6d
Index: glibc-2.12-2-gc4ccff1/configure
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/configure
b9ba6d
+++ glibc-2.12-2-gc4ccff1/configure
b9ba6d
@@ -830,6 +830,7 @@ enable_all_warnings
b9ba6d
 enable_multi_arch
b9ba6d
 enable_experimental_malloc
b9ba6d
 enable_nss_crypt
b9ba6d
+enable_systemtap
b9ba6d
 with_cpu
b9ba6d
 '
b9ba6d
       ac_precious_vars='build_alias
b9ba6d
@@ -1501,6 +1502,7 @@ Optional Features:
b9ba6d
   --enable-experimental-malloc
b9ba6d
                           enable experimental malloc features
b9ba6d
   --enable-nss-crypt      enable libcrypt to use nss
b9ba6d
+  --enable-systemtap      enable systemtap static probe points [default=no]
b9ba6d
 
b9ba6d
 Optional Packages:
b9ba6d
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
b9ba6d
@@ -3932,6 +3934,79 @@ else
b9ba6d
 fi
b9ba6d
 
b9ba6d
 
b9ba6d
+# Check whether --enable-systemtap was given.
b9ba6d
+if test "${enable_systemtap+set}" = set; then
b9ba6d
+  enableval=$enable_systemtap; systemtap=$enableval
b9ba6d
+else
b9ba6d
+  systemtap=no
b9ba6d
+fi
b9ba6d
+
b9ba6d
+if test x$systemtap != xno; then
b9ba6d
+
b9ba6d
+  { $as_echo "$as_me:$LINENO: checking for systemtap static probe support" >&5
b9ba6d
+$as_echo_n "checking for systemtap static probe support... " >&6; }
b9ba6d
+if test "${libc_cv_sdt+set}" = set; then
b9ba6d
+  $as_echo_n "(cached) " >&6
b9ba6d
+else
b9ba6d
+    old_CFLAGS="$CFLAGS"
b9ba6d
+  CFLAGS="-std=gnu99 $CFLAGS"
b9ba6d
+  cat >conftest.$ac_ext <<_ACEOF
b9ba6d
+#include <sys/sdt.h>
b9ba6d
+void foo (int i, void *p)
b9ba6d
+{
b9ba6d
+  asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
b9ba6d
+       :: STAP_PROBE_ASM_OPERANDS (2, i, p));
b9ba6d
+}
b9ba6d
+_ACEOF
b9ba6d
+rm -f conftest.$ac_objext
b9ba6d
+if { (ac_try="$ac_compile"
b9ba6d
+case "(($ac_try" in
b9ba6d
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
b9ba6d
+  *) ac_try_echo=$ac_try;;
b9ba6d
+esac
b9ba6d
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
b9ba6d
+$as_echo "$ac_try_echo") >&5
b9ba6d
+  (eval "$ac_compile") 2>conftest.er1
b9ba6d
+  ac_status=$?
b9ba6d
+  grep -v '^ *+' conftest.er1 >conftest.err
b9ba6d
+  rm -f conftest.er1
b9ba6d
+  cat conftest.err >&5
b9ba6d
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
b9ba6d
+  (exit $ac_status); } && {
b9ba6d
+	 test -z "$ac_c_werror_flag" ||
b9ba6d
+	 test ! -s conftest.err
b9ba6d
+       } && test -s conftest.$ac_objext; then
b9ba6d
+  libc_cv_sdt=yes
b9ba6d
+else
b9ba6d
+  $as_echo "$as_me: failed program was:" >&5
b9ba6d
+sed 's/^/| /' conftest.$ac_ext >&5
b9ba6d
+
b9ba6d
+	libc_cv_sdt=no
b9ba6d
+fi
b9ba6d
+
b9ba6d
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
b9ba6d
+  CFLAGS="$old_CFLAGS"
b9ba6d
+fi
b9ba6d
+{ $as_echo "$as_me:$LINENO: result: $libc_cv_sdt" >&5
b9ba6d
+$as_echo "$libc_cv_sdt" >&6; }
b9ba6d
+  if test $libc_cv_sdt = yes; then
b9ba6d
+    cat >>confdefs.h <<\_ACEOF
b9ba6d
+#define USE_STAP_PROBE 1
b9ba6d
+_ACEOF
b9ba6d
+
b9ba6d
+  else
b9ba6d
+    { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
b9ba6d
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
b9ba6d
+{ { $as_echo "$as_me:$LINENO: error: systemtap support needs sys/sdt.h with asm support
b9ba6d
+See \`config.log' for more details." >&5
b9ba6d
+$as_echo "$as_me: error: systemtap support needs sys/sdt.h with asm support
b9ba6d
+See \`config.log' for more details." >&2;}
b9ba6d
+   { (exit 1); exit 1; }; }; }
b9ba6d
+  fi
b9ba6d
+
b9ba6d
+fi
b9ba6d
+
b9ba6d
+
b9ba6d
 # The way shlib-versions is used to generate soversions.mk uses a
b9ba6d
 # fairly simplistic model for name recognition that can't distinguish
b9ba6d
 # i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a $host_os
b9ba6d
Index: glibc-2.12-2-gc4ccff1/configure.in
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/configure.in
b9ba6d
+++ glibc-2.12-2-gc4ccff1/configure.in
b9ba6d
@@ -319,6 +319,29 @@ else
b9ba6d
 fi
b9ba6d
 AC_SUBST(libc_cv_nss_crypt)
b9ba6d
 
b9ba6d
+AC_ARG_ENABLE([systemtap],
b9ba6d
+              [AS_HELP_STRING([--enable-systemtap],
b9ba6d
+	       [enable systemtap static probe points @<:@default=no@:>@])],
b9ba6d
+              [systemtap=$enableval],
b9ba6d
+	      [systemtap=no])
b9ba6d
+AS_IF([test x$systemtap != xno], [
b9ba6d
+  AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
b9ba6d
+  old_CFLAGS="$CFLAGS"
b9ba6d
+  CFLAGS="-std=gnu99 $CFLAGS"
b9ba6d
+  AC_COMPILE_IFELSE([#include <sys/sdt.h>
b9ba6d
+void foo (int i, void *p)
b9ba6d
+{
b9ba6d
+  asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
b9ba6d
+       :: STAP_PROBE_ASM_OPERANDS (2, i, p));
b9ba6d
+}], [libc_cv_sdt=yes], [libc_cv_sdt=no])
b9ba6d
+  CFLAGS="$old_CFLAGS"])
b9ba6d
+  if test $libc_cv_sdt = yes; then
b9ba6d
+    AC_DEFINE([USE_STAP_PROBE])
b9ba6d
+  else
b9ba6d
+    AC_MSG_FAILURE([systemtap support needs sys/sdt.h with asm support])
b9ba6d
+  fi
b9ba6d
+])
b9ba6d
+
b9ba6d
 # The way shlib-versions is used to generate soversions.mk uses a
b9ba6d
 # fairly simplistic model for name recognition that can't distinguish
b9ba6d
 # i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a $host_os
b9ba6d
Index: glibc-2.12-2-gc4ccff1/elf/Makefile
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/elf/Makefile
b9ba6d
+++ glibc-2.12-2-gc4ccff1/elf/Makefile
b9ba6d
@@ -458,7 +458,8 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'
b9ba6d
 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
b9ba6d
 CFLAGS-cache.c = $(SYSCONF-FLAGS)
b9ba6d
 
b9ba6d
-CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
b9ba6d
+CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
b9ba6d
+		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
b9ba6d
 
b9ba6d
 test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
b9ba6d
 generated += $(addsuffix .so,$(strip $(modules-names)))
b9ba6d
Index: glibc-2.12-2-gc4ccff1/elf/dl-close.c
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/elf/dl-close.c
b9ba6d
+++ glibc-2.12-2-gc4ccff1/elf/dl-close.c
b9ba6d
@@ -32,6 +32,7 @@
b9ba6d
 #include <sys/mman.h>
b9ba6d
 #include <sysdep-cancel.h>
b9ba6d
 #include <tls.h>
b9ba6d
+#include <stap-probe.h>
b9ba6d
 
b9ba6d
 
b9ba6d
 /* Type of the constructor functions.  */
b9ba6d
@@ -469,6 +470,7 @@ _dl_close_worker (struct link_map *map)
b9ba6d
   struct r_debug *r = _dl_debug_initialize (0, nsid);
b9ba6d
   r->r_state = RT_DELETE;
b9ba6d
   _dl_debug_state ();
b9ba6d
+  LIBC_PROBE (rtld_unmap_start, 2, nsid, r);
b9ba6d
 
b9ba6d
   if (unload_global)
b9ba6d
     {
b9ba6d
@@ -722,6 +724,7 @@ _dl_close_worker (struct link_map *map)
b9ba6d
   /* Notify the debugger those objects are finalized and gone.  */
b9ba6d
   r->r_state = RT_CONSISTENT;
b9ba6d
   _dl_debug_state ();
b9ba6d
+  LIBC_PROBE (rtld_unmap_complete, 2, nsid, r);
b9ba6d
 
b9ba6d
   /* Recheck if we need to retry, release the lock.  */
b9ba6d
  out:
b9ba6d
Index: glibc-2.12-2-gc4ccff1/elf/dl-load.c
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/elf/dl-load.c
b9ba6d
+++ glibc-2.12-2-gc4ccff1/elf/dl-load.c
b9ba6d
@@ -36,6 +36,7 @@
b9ba6d
 #include <stackinfo.h>
b9ba6d
 #include <caller.h>
b9ba6d
 #include <sysdep.h>
b9ba6d
+#include <stap-probe.h>
b9ba6d
 
b9ba6d
 #include <dl-dst.h>
b9ba6d
 
b9ba6d
@@ -806,7 +807,7 @@ _dl_init_paths (const char *llp)
b9ba6d
 static void
b9ba6d
 __attribute__ ((noreturn, noinline))
b9ba6d
 lose (int code, int fd, const char *name, char *realname, struct link_map *l,
b9ba6d
-      const char *msg, struct r_debug *r)
b9ba6d
+      const char *msg, struct r_debug *r, Lmid_t nsid)
b9ba6d
 {
b9ba6d
   /* The file might already be closed.  */
b9ba6d
   if (fd != -1)
b9ba6d
@@ -818,6 +819,7 @@ lose (int code, int fd, const char *name
b9ba6d
     {
b9ba6d
       r->r_state = RT_CONSISTENT;
b9ba6d
       _dl_debug_state ();
b9ba6d
+      LIBC_PROBE (rtld_map_complete, 2, nsid, r);
b9ba6d
     }
b9ba6d
 
b9ba6d
   _dl_signal_error (code, name, NULL, msg);
b9ba6d
@@ -856,7 +858,7 @@ _dl_map_object_from_fd (const char *name
b9ba6d
       errval = errno;
b9ba6d
     call_lose:
b9ba6d
       lose (errval, fd, name, realname, l, errstring,
b9ba6d
-	    make_consistent ? r : NULL);
b9ba6d
+	    make_consistent ? r : NULL, nsid);
b9ba6d
     }
b9ba6d
 
b9ba6d
   /* Look again to see if the real name matched another already loaded.  */
b9ba6d
@@ -963,6 +965,7 @@ _dl_map_object_from_fd (const char *name
b9ba6d
 	 linking has not been used before.  */
b9ba6d
       r->r_state = RT_ADD;
b9ba6d
       _dl_debug_state ();
b9ba6d
+      LIBC_PROBE (rtld_map_start, 2, nsid, r);
b9ba6d
       make_consistent = true;
b9ba6d
     }
b9ba6d
   else
b9ba6d
@@ -1656,7 +1659,7 @@ open_verify (const char *name, struct fi
b9ba6d
 	      name = strdupa (realname);
b9ba6d
 	      free (realname);
b9ba6d
 	    }
b9ba6d
-	  lose (errval, fd, name, NULL, NULL, errstring, NULL);
b9ba6d
+	  lose (errval, fd, name, NULL, NULL, errstring, NULL, 0);
b9ba6d
 	}
b9ba6d
 
b9ba6d
       /* See whether the ELF header is what we expect.  */
b9ba6d
Index: glibc-2.12-2-gc4ccff1/elf/dl-open.c
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/elf/dl-open.c
b9ba6d
+++ glibc-2.12-2-gc4ccff1/elf/dl-open.c
b9ba6d
@@ -33,6 +33,7 @@
b9ba6d
 #include <caller.h>
b9ba6d
 #include <sysdep-cancel.h>
b9ba6d
 #include <tls.h>
b9ba6d
+#include <stap-probe.h>
b9ba6d
 
b9ba6d
 #include <dl-dst.h>
b9ba6d
 
b9ba6d
@@ -297,6 +298,7 @@ dl_open_worker (void *a)
b9ba6d
   struct r_debug *r = _dl_debug_initialize (0, args->nsid);
b9ba6d
   r->r_state = RT_CONSISTENT;
b9ba6d
   _dl_debug_state ();
b9ba6d
+  LIBC_PROBE (rtld_map_complete, 2, args->nsid, r);
b9ba6d
 
b9ba6d
   /* Only do lazy relocation if `LD_BIND_NOW' is not set.  */
b9ba6d
   int reloc_mode = mode & __RTLD_AUDIT;
b9ba6d
@@ -309,10 +311,18 @@ dl_open_worker (void *a)
b9ba6d
   struct link_map *l = new;
b9ba6d
   while (l->l_next)
b9ba6d
     l = l->l_next;
b9ba6d
+  int relocation_in_progress = 0;
b9ba6d
   while (1)
b9ba6d
     {
b9ba6d
       if (! l->l_real->l_relocated)
b9ba6d
 	{
b9ba6d
+	  if (! relocation_in_progress)
b9ba6d
+	    {
b9ba6d
+	      /* Notify the debugger that relocations are about to happen.  */
b9ba6d
+	      LIBC_PROBE (rtld_reloc_start, 2, args->nsid, r);
b9ba6d
+	      relocation_in_progress = 1;
b9ba6d
+	    }
b9ba6d
+
b9ba6d
 #ifdef SHARED
b9ba6d
 	  if (__builtin_expect (GLRO(dl_profile) != NULL, 0))
b9ba6d
 	    {
b9ba6d
@@ -460,6 +470,10 @@ cannot load any more object with static 
b9ba6d
     _dl_fatal_printf (N_("\
b9ba6d
 TLS generation counter wrapped!  Please report this."));
b9ba6d
 
b9ba6d
+  /* Notify the debugger all new objects have been relocated.  */
b9ba6d
+  if (relocation_in_progress)
b9ba6d
+    LIBC_PROBE (rtld_reloc_complete, 2, args->nsid, r);
b9ba6d
+
b9ba6d
   /* Run the initializer functions of new objects.  */
b9ba6d
   _dl_init (new, args->argc, args->argv, args->env);
b9ba6d
 
b9ba6d
Index: glibc-2.12-2-gc4ccff1/elf/rtld-Rules
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/elf/rtld-Rules
b9ba6d
+++ glibc-2.12-2-gc4ccff1/elf/rtld-Rules
b9ba6d
@@ -122,6 +122,6 @@ ifdef rtld-depfiles
b9ba6d
 endif
b9ba6d
 
b9ba6d
 # This here is the whole point of all the shenanigans.
b9ba6d
-rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1
b9ba6d
+rtld-CPPFLAGS := -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld
b9ba6d
 
b9ba6d
 endif
b9ba6d
Index: glibc-2.12-2-gc4ccff1/elf/rtld.c
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/elf/rtld.c
b9ba6d
+++ glibc-2.12-2-gc4ccff1/elf/rtld.c
b9ba6d
@@ -40,6 +40,7 @@
b9ba6d
 #include <dl-osinfo.h>
b9ba6d
 #include <dl-procinfo.h>
b9ba6d
 #include <tls.h>
b9ba6d
+#include <stap-probe.h>
b9ba6d
 
b9ba6d
 #include <assert.h>
b9ba6d
 
b9ba6d
@@ -1656,6 +1657,7 @@ ERROR: ld.so: object '%s' cannot be load
b9ba6d
   /* We start adding objects.  */
b9ba6d
   r->r_state = RT_ADD;
b9ba6d
   _dl_debug_state ();
b9ba6d
+  LIBC_PROBE (rtld_init_start, 2, LM_ID_BASE, r);
b9ba6d
 
b9ba6d
   /* Auditing checkpoint: we are ready to signal that the initial map
b9ba6d
      is being constructed.  */
b9ba6d
@@ -2353,6 +2355,7 @@ ERROR: ld.so: object '%s' cannot be load
b9ba6d
   r = _dl_debug_initialize (0, LM_ID_BASE);
b9ba6d
   r->r_state = RT_CONSISTENT;
b9ba6d
   _dl_debug_state ();
b9ba6d
+  LIBC_PROBE (rtld_init_complete, 2, LM_ID_BASE, r);
b9ba6d
 
b9ba6d
 #ifndef MAP_COPY
b9ba6d
   /* We must munmap() the cache file.  */
b9ba6d
Index: glibc-2.12-2-gc4ccff1/extra-lib.mk
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/extra-lib.mk
b9ba6d
+++ glibc-2.12-2-gc4ccff1/extra-lib.mk
b9ba6d
@@ -101,4 +101,4 @@ ifneq (,$(cpp-srcs-left))
b9ba6d
 include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
b9ba6d
 endif
b9ba6d
 
b9ba6d
-CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1
b9ba6d
+CPPFLAGS-$(lib) := -DNOT_IN_libc=1 -DIS_IN_$(lib)=1 -DIN_LIB=$(lib)
b9ba6d
Index: glibc-2.12-2-gc4ccff1/include/stap-probe.h
b9ba6d
===================================================================
b9ba6d
--- /dev/null
b9ba6d
+++ glibc-2.12-2-gc4ccff1/include/stap-probe.h
b9ba6d
@@ -0,0 +1,140 @@
b9ba6d
+/* Macros for defining Systemtap <sys/sdt.h> static probe points.
b9ba6d
+   Copyright (C) 2011 Free Software Foundation, Inc.
b9ba6d
+   This file is part of the GNU C Library.
b9ba6d
+
b9ba6d
+   The GNU C Library is free software; you can redistribute it and/or
b9ba6d
+   modify it under the terms of the GNU Lesser General Public
b9ba6d
+   License as published by the Free Software Foundation; either
b9ba6d
+   version 2.1 of the License, or (at your option) any later version.
b9ba6d
+
b9ba6d
+   The GNU C Library is distributed in the hope that it will be useful,
b9ba6d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
b9ba6d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
b9ba6d
+   Lesser General Public License for more details.
b9ba6d
+
b9ba6d
+   You should have received a copy of the GNU Lesser General Public
b9ba6d
+   License along with the GNU C Library; if not, write to the Free
b9ba6d
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
b9ba6d
+   02111-1307 USA.  */
b9ba6d
+
b9ba6d
+#ifndef _STAP_PROBE_H
b9ba6d
+#define _STAP_PROBE_H 1
b9ba6d
+
b9ba6d
+#ifdef USE_STAP_PROBE
b9ba6d
+
b9ba6d
+# include <sys/sdt.h>
b9ba6d
+
b9ba6d
+/* Our code uses one macro LIBC_PROBE (name, n, arg1, ..., argn).
b9ba6d
+
b9ba6d
+   Without USE_STAP_PROBE, that does nothing but evaluates all
b9ba6d
+   its arguments (to prevent bit rot, unlike e.g. assert).
b9ba6d
+
b9ba6d
+   Systemtap's header defines the macros STAP_PROBE (provider, name) and
b9ba6d
+   STAP_PROBEn (provider, name, arg1, ..., argn).  For "provider" we paste
b9ba6d
+   in the IN_LIB name (libc, libpthread, etc.) automagically.  */
b9ba6d
+
b9ba6d
+# ifndef NOT_IN_libc
b9ba6d
+#  define IN_LIB	libc
b9ba6d
+# elif !defined IN_LIB
b9ba6d
+/* This is intentionally defined with extra unquoted commas in it so
b9ba6d
+   that macro substitution will bomb out when it is used.  We don't
b9ba6d
+   just use #error here, so that this header can be included by
b9ba6d
+   other headers that use LIBC_PROBE inside their own macros.  We
b9ba6d
+   only want such headers to fail to compile if those macros are
b9ba6d
+   actually used in a context where IN_LIB has not been defined.  */
b9ba6d
+#  define IN_LIB	,,,missing -DIN_LIB=... -- not extra-lib.mk?,,,
b9ba6d
+# endif
b9ba6d
+
b9ba6d
+# define LIBC_PROBE(name, n, ...)	\
b9ba6d
+  LIBC_PROBE_1 (IN_LIB, name, n, ## __VA_ARGS__)
b9ba6d
+
b9ba6d
+# define LIBC_PROBE_1(lib, name, n, ...) \
b9ba6d
+  STAP_PROBE##n (lib, name, ## __VA_ARGS__)
b9ba6d
+
b9ba6d
+# define STAP_PROBE0		STAP_PROBE
b9ba6d
+
b9ba6d
+# define LIBC_PROBE_ASM(name, template) \
b9ba6d
+  STAP_PROBE_ASM (IN_LIB, name, template)
b9ba6d
+
b9ba6d
+# define LIBC_PROBE_ASM_OPERANDS STAP_PROBE_ASM_OPERANDS
b9ba6d
+
b9ba6d
+#else  /* Not USE_STAP_PROBE.  */
b9ba6d
+
b9ba6d
+# ifndef __ASSEMBLER__
b9ba6d
+#  define LIBC_PROBE(name, n, ...)		DUMMY_PROBE##n (__VA_ARGS__)
b9ba6d
+# else
b9ba6d
+#  define LIBC_PROBE(name, n, ...)		/* Nothing.  */
b9ba6d
+# endif
b9ba6d
+
b9ba6d
+# define LIBC_PROBE_ASM(name, template)		/* Nothing.  */
b9ba6d
+# define LIBC_PROBE_ASM_OPERANDS(n, ...)	/* Nothing.  */
b9ba6d
+
b9ba6d
+/* This silliness lets us evaluate all the arguments for each arity
b9ba6d
+   of probe.  My kingdom for a real macro system.  */
b9ba6d
+
b9ba6d
+# define DUMMY_PROBE0()			do {} while (0)
b9ba6d
+# define DUMMY_PROBE1(a1)		do {} while ((void) (a1), 0)
b9ba6d
+# define DUMMY_PROBE2(a1, a2)		do {} while ((void) (a1), \
b9ba6d
+						     (void) (a2), 0)
b9ba6d
+# define DUMMY_PROBE3(a1, a2, a3)	do {} while ((void) (a1), \
b9ba6d
+						     (void) (a2), \
b9ba6d
+						     (void) (a3), 0)
b9ba6d
+# define DUMMY_PROBE4(a1, a2, a3, a4)	do {} while ((void) (a1), \
b9ba6d
+						     (void) (a2), \
b9ba6d
+						     (void) (a3), \
b9ba6d
+						     (void) (a4), 0)
b9ba6d
+# define DUMMY_PROBE5(a1, a2, a3, a4, a5)			  \
b9ba6d
+					do {} while ((void) (a1), \
b9ba6d
+						     (void) (a2), \
b9ba6d
+						     (void) (a3), \
b9ba6d
+						     (void) (a4), \
b9ba6d
+						     (void) (a5), 0)
b9ba6d
+# define DUMMY_PROBE6(a1, a2, a3, a4, a5, a6)			  \
b9ba6d
+					do {} while ((void) (a1), \
b9ba6d
+						     (void) (a2), \
b9ba6d
+						     (void) (a3), \
b9ba6d
+						     (void) (a4), \
b9ba6d
+						     (void) (a5), \
b9ba6d
+						     (void) (a6), 0)
b9ba6d
+# define DUMMY_PROBE7(a1, a2, a3, a4, a5, a6, a7)		  \
b9ba6d
+					do {} while ((void) (a1), \
b9ba6d
+						     (void) (a2), \
b9ba6d
+						     (void) (a3), \
b9ba6d
+						     (void) (a4), \
b9ba6d
+						     (void) (a5), \
b9ba6d
+						     (void) (a6), \
b9ba6d
+						     (void) (a7), 0)
b9ba6d
+# define DUMMY_PROBE8(a1, a2, a3, a4, a5, a6, a7, a8)		  \
b9ba6d
+					do {} while ((void) (a1), \
b9ba6d
+						     (void) (a2), \
b9ba6d
+						     (void) (a3), \
b9ba6d
+						     (void) (a4), \
b9ba6d
+						     (void) (a5), \
b9ba6d
+						     (void) (a6), \
b9ba6d
+						     (void) (a7), \
b9ba6d
+						     (void) (a8), 0)
b9ba6d
+# define DUMMY_PROBE9(a1, a2, a3, a4, a5, a6, a7, a8, a9)	  \
b9ba6d
+					do {} while ((void) (a1), \
b9ba6d
+						     (void) (a2), \
b9ba6d
+						     (void) (a3), \
b9ba6d
+						     (void) (a4), \
b9ba6d
+						     (void) (a5), \
b9ba6d
+						     (void) (a6), \
b9ba6d
+						     (void) (a7), \
b9ba6d
+						     (void) (a8), \
b9ba6d
+						     (void) (a9), 0)
b9ba6d
+# define DUMMY_PROBE10(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)	  \
b9ba6d
+					do {} while ((void) (a1), \
b9ba6d
+						     (void) (a2), \
b9ba6d
+						     (void) (a3), \
b9ba6d
+						     (void) (a4), \
b9ba6d
+						     (void) (a5), \
b9ba6d
+						     (void) (a6), \
b9ba6d
+						     (void) (a7), \
b9ba6d
+						     (void) (a8), \
b9ba6d
+						     (void) (a9), \
b9ba6d
+						     (void) (a10), 0)
b9ba6d
+
b9ba6d
+#endif	/* USE_STAP_PROBE.  */
b9ba6d
+
b9ba6d
+#endif	/* stap-probe.h */
b9ba6d
Index: glibc-2.12-2-gc4ccff1/scripts/check-local-headers.sh
b9ba6d
===================================================================
b9ba6d
--- glibc-2.12-2-gc4ccff1.orig/scripts/check-local-headers.sh
b9ba6d
+++ glibc-2.12-2-gc4ccff1/scripts/check-local-headers.sh
b9ba6d
@@ -31,6 +31,8 @@ fgrep -v "$includedir/asm" |
b9ba6d
 fgrep -v "$includedir/linux" |
b9ba6d
 fgrep -v "$includedir/selinux" |
b9ba6d
 fgrep -v "$includedir/sys/capability.h" |
b9ba6d
+fgrep -v "$includedir/sys/sdt.h" |
b9ba6d
+fgrep -v "$includedir/sys/sdt-config.h" |
b9ba6d
 fgrep -v "$includedir/gd" |
b9ba6d
 fgrep -v "$includedir/nss3"; then
b9ba6d
   # If we found a match something is wrong.