From 10e1cf6b73f1598e57d24933a0949dbeffa2c8a0 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Fri, 11 Oct 2013 22:37:53 +0530 Subject: 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. --- sysdeps/ieee754/dbl-64/slowexp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'sysdeps/ieee754/dbl-64/slowexp.c') diff --git a/sysdeps/ieee754/dbl-64/slowexp.c b/sysdeps/ieee754/dbl-64/slowexp.c index 8f353f634f..525224f44a 100644 --- a/sysdeps/ieee754/dbl-64/slowexp.c +++ b/sysdeps/ieee754/dbl-64/slowexp.c @@ -29,6 +29,8 @@ /**************************************************************************/ #include +#include + #ifndef USE_LONG_DOUBLE_FOR_MP # include "mpa.h" void __mpexp (mp_no *x, mp_no *y, int p); @@ -60,13 +62,22 @@ __slowexp (double x) __mp_dbl (&mpw, &w, p); __mp_dbl (&mpz, &z, p); if (w == z) - return w; + { + /* Track how often we get to the slow exp code plus + its input/output values. */ + LIBC_PROBE (slowexp_p6, 2, &x, &w); + return w; + } else { p = 32; __dbl_mp (x, &mpx, p); __mpexp (&mpx, &mpy, p); __mp_dbl (&mpy, &res, p); + + /* Track how often we get to the uber-slow exp code plus + its input/output values. */ + LIBC_PROBE (slowexp_p32, 2, &x, &res); return res; } #else -- cgit 1.4.1