fa3bfd
Related upstream commit:
fa3bfd
fa3bfd
commit 10e1cf6b73f1598e57d24933a0949dbeffa2c8a0
fa3bfd
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
fa3bfd
Date:   Fri Oct 11 22:37:53 2013 +0530
fa3bfd
fa3bfd
    Add systemtap markers to math function slow paths
fa3bfd
12745e
diff -rup glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowexp.c glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowexp.c
12745e
--- glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowexp.c	2012-05-20 19:47:38.000000000 -0600
12745e
+++ glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowexp.c	2012-05-21 10:02:51.693957300 -0600
29e444
@@ -30,6 +30,8 @@
29e444
 #include "mpa.h"
29e444
 #include <math_private.h>
29e444
 
29e444
+#include <stap-probe.h>
29e444
+
29e444
 #ifndef SECTION
29e444
 # define SECTION
29e444
 #endif
29e444
@@ -60,12 +62,21 @@ __slowexp(double x) {
29e444
   __sub(&mpy,&mpcor,&mpz,p);
29e444
   __mp_dbl(&mpw, &w, p);
29e444
   __mp_dbl(&mpz, &z, p);
29e444
-  if (w == z) return w;
29e444
+  if (w == z) {
29e444
+    /* Track how often we get to the slow exp code plus
29e444
+       its input/output values.  */
29e444
+    LIBC_PROBE (slowexp_p6, 2, &x, &w);
29e444
+    return w;
29e444
+  }
29e444
   else  {                   /* if calculating is not exactly   */
29e444
     p = 32;
29e444
     __dbl_mp(x,&mpx,p);
29e444
     __mpexp(&mpx, &mpy, p);
29e444
     __mp_dbl(&mpy, &res, p);
29e444
+ 
29e444
+    /* Track how often we get to the uber-slow exp code plus
29e444
+       its input/output values.  */
29e444
+    LIBC_PROBE (slowexp_p32, 2, &x, &res;;
29e444
     return res;
29e444
   }
29e444
 }
12745e
diff -rup glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowpow.c glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowpow.c
12745e
--- glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowpow.c	2012-05-20 19:47:38.000000000 -0600
12745e
+++ glibc-2.17-c758a686/sysdeps/ieee754/dbl-64/slowpow.c	2012-05-21 10:02:51.694957291 -0600
29e444
@@ -34,6 +34,8 @@
29e444
 #include "mpa.h"
29e444
 #include <math_private.h>
29e444
 
29e444
+#include <stap-probe.h>
29e444
+
29e444
 #ifndef SECTION
29e444
 # define SECTION
29e444
 #endif
29e444
@@ -65,7 +67,12 @@ __slowpow(double x, double y, double z)
29e444
   __mp_dbl(&mpr, &res, p);
29e444
   __sub(&mpp,&eps,&mpr1,p);   /*  pp -eps =r1 */
29e444
   __mp_dbl(&mpr1, &res1, p);  /*  converting into double precision */
29e444
-  if (res == res1) return res;
29e444
+  if (res == res1) {
29e444
+    /* Track how often we get to the slow pow code plus
29e444
+       its input/output values.  */
29e444
+    LIBC_PROBE (slowpow_p10, 4, &x, &y, &z, &res;;
29e444
+    return res;
29e444
+  }
29e444
 
29e444
   p = 32;     /* if we get here result wasn't calculated exactly, continue */
29e444
   __dbl_mp(x,&mpx,p);                          /* for more exact calculation */
29e444
@@ -75,5 +82,10 @@ __slowpow(double x, double y, double z)
29e444
   __mul(&mpy,&mpz,&mpw,p);  /* y*z =w    */
29e444
   __mpexp(&mpw, &mpp, p);   /* e^w=pp    */
29e444
   __mp_dbl(&mpp, &res, p);  /* converting into double precision */
29e444
+
29e444
+  /* Track how often we get to the uber-slow pow code plus
29e444
+     its input/output values.  */
29e444
+    LIBC_PROBE (slowpow_p32, 4, &x, &y, &z, &res;;
29e444
+
29e444
   return res;
29e444
 }