aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/slowpow.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2013-10-11 22:37:53 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2013-10-11 22:37:53 +0530
commit10e1cf6b73f1598e57d24933a0949dbeffa2c8a0 (patch)
tree2dd2ce2fe7144de439047f6dddbeb2f660746d94 /sysdeps/ieee754/dbl-64/slowpow.c
parent3d110c7c6e6549bd4124fce49cdc672f9e449799 (diff)
downloadglibc-10e1cf6b73f1598e57d24933a0949dbeffa2c8a0.zip
glibc-10e1cf6b73f1598e57d24933a0949dbeffa2c8a0.tar.gz
glibc-10e1cf6b73f1598e57d24933a0949dbeffa2c8a0.tar.bz2
Add systemtap markers to math function slow paths
Add systemtap probes to various slow paths in libm so that application developers may use systemtap to find out if their applications are hitting these slow paths. We have added probes for pow, exp, log, tan, atan and atan2.
Diffstat (limited to 'sysdeps/ieee754/dbl-64/slowpow.c')
-rw-r--r--sysdeps/ieee754/dbl-64/slowpow.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sysdeps/ieee754/dbl-64/slowpow.c b/sysdeps/ieee754/dbl-64/slowpow.c
index a379728..d200c39 100644
--- a/sysdeps/ieee754/dbl-64/slowpow.c
+++ b/sysdeps/ieee754/dbl-64/slowpow.c
@@ -34,6 +34,8 @@
#include "mpa.h"
#include <math_private.h>
+#include <stap-probe.h>
+
#ifndef SECTION
# define SECTION
#endif
@@ -97,7 +99,12 @@ __slowpow (double x, double y, double z)
__sub (&mpp, &eps, &mpr1, p);
__mp_dbl (&mpr1, &res1, p);
if (res == res1)
- return res;
+ {
+ /* Track how often we get to the slow pow code plus
+ its input/output values. */
+ LIBC_PROBE (slowpow_p10, 4, &x, &y, &z, &res);
+ return res;
+ }
/* If we don't, then we repeat using a higher precision. 768 bits of
precision ought to be enough for anybody. */
@@ -109,5 +116,10 @@ __slowpow (double x, double y, double z)
__mul (&mpy, &mpz, &mpw, p);
__mpexp (&mpw, &mpp, p);
__mp_dbl (&mpp, &res, p);
+
+ /* Track how often we get to the uber-slow pow code plus
+ its input/output values. */
+ LIBC_PROBE (slowpow_p32, 4, &x, &y, &z, &res);
+
return res;
}