This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch siddhesh/benchmarks created. glibc-2.19-89-ga3da6df


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, siddhesh/benchmarks has been created
        at  a3da6df7e290d1d4cd59f36bb2ab1cdf096e9244 (commit)

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a3da6df7e290d1d4cd59f36bb2ab1cdf096e9244

commit a3da6df7e290d1d4cd59f36bb2ab1cdf096e9244
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Mon Feb 24 23:22:24 2014 +0530

    benchtest: script to compare two benchmarks
    
    This script is a sample implementation that uses import_bench to
    construct two benchmark objects and compare them.  If detailed timing
    information is available (when one does `make DETAILED=1 bench`), it
    writes out graphs for all functions it benchmarks and prints
    significant differences in timings of the two benchmark runs.  If
    detailed timing information is not available, it points out
    significant differences in aggregate times.
    
    Call this script as follows:
    
      compare_bench.py schema_file.json bench1.out bench2.out
    
    Alternatively, if one wants to set a different threshold for warnings
    (default is a 10% difference):
    
      compare_bench.py schema_file.json bench1.out bench2.out 25
    
    The threshold in the example above is 25%.  schema_file.json is the
    JSON schema (which is $srcdir/benchtests/scripts/benchout.schema.json
    for the benchmark output file) and bench1.out and bench2.out are the
    two benchmark output files to compare.

diff --git a/benchtests/scripts/compare_bench.py b/benchtests/scripts/compare_bench.py
new file mode 100755
index 0000000..45840ff
--- /dev/null
+++ b/benchtests/scripts/compare_bench.py
@@ -0,0 +1,195 @@
+#!/usr/bin/python
+# Copyright (C) 2014 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, see
+# <http://www.gnu.org/licenses/>.
+"""Compare two benchmark results
+
+Given two benchmark result files and a threshold, this script compares the
+benchmark results and flags differences in performance beyond a given
+threshold.
+"""
+import sys
+import os
+import pylab
+import import_bench as bench
+
+def do_compare(func, var, tl1, tl2, par, threshold):
+    """Compare one of the aggregate measurements
+
+    Helper function to compare one of the aggregate measurements of a function
+    variant.
+
+    Args:
+        func: Function name
+        var: Function variant name
+        tl1: The first timings list
+        tl2: The second timings list
+        par: The aggregate to measure
+        threshold: The threshold for differences, beyond which the script should
+        print a warning.
+    """
+    d = abs(tl2[par] - tl1[par]) * 100 / tl1[str(par)]
+    if d > threshold:
+        if tl1[par] > tl2[par]:
+            ind = '+++'
+        else:
+            ind = '---'
+        print('%s %s(%s)[%s]: (%.2lf%%) from %g to %g' %
+                (ind, func, var, par, d, tl1[par], tl2[par]))
+
+
+def compare_runs(pts1, pts2, threshold):
+    """Compare two benchmark runs
+
+    For now, assume that machine1 and machine2 are the same.  In future, we may
+    have to add an additional condition to ensure that we are comparing apples
+    to apples.
+
+    Args:
+        machine1: Machine info from the first machine
+        machine2: machine info from the second machine
+        pts1: Timing data from first machine
+        pts2: Timing data from second machine
+    """
+    # Just print the machines for now.  We would want to do something more
+    # interesting with this in future.
+    print 'Machine 1:', pts1['machine']
+    print 'Machine 2:', pts2['machine']
+    print
+
+    # XXX We assume that the two benchmarks have identical functions and
+    # variants.  We cannot compare two benchmarks that may have different
+    # functions or variants.  Maybe that is something for the future.
+    for func in pts1['functions'].keys():
+        for var in pts1['functions'][func].keys():
+            tl1 = pts1['functions'][func][var]
+            tl2 = pts2['functions'][func][var]
+
+            # Compare the consolidated numbers
+            # do_compare(func, var, tl1, tl2, 'max', threshold)
+            do_compare(func, var, tl1, tl2, 'min', threshold)
+            do_compare(func, var, tl1, tl2, 'mean', threshold)
+
+            # Skip over to the next variant or function if there is no detailed
+            # timing info for the function variant.
+            if 'timings' not in pts1['functions'][func][var].keys() or \
+                'timings' not in pts2['functions'][func][var].keys():
+                    return
+
+            # If two lists do not have the same length then it is likely that
+            # the performance characteristics of the function have changed.
+            # XXX: It is also likely that there was some measurement that
+            # strayed outside the usual range.  Such ouiers should not
+            # happen on an idle machine with identical hardware and
+            # configuration, but ideal environments are hard to come by.
+            if len(tl1['timings']) != len(tl2['timings']):
+                print('* %s(%s): Timing characteristics changed' %
+                        (func, var))
+                print('\tBefore: [%s]' %
+                        ', '.join([str(x) for x in tl1['timings']]))
+                print('\tAfter: [%s]' %
+                        ', '.join([str(x) for x in tl2['timings']]))
+                continue
+
+            # Collect numbers whose differences cross the threshold we have
+            # set.
+            issues = [(x, y) for x, y in zip(tl1['timings'], tl2['timings']) \
+                        if abs(y - x) * 100 / x > threshold]
+
+            # Now print them.
+            for t1, t2 in issues:
+                d = abs(t2 - t1) * 100 / t1
+                if t2 > t1:
+                    ind = '-'
+                else:
+                    ind = '+'
+
+                print("%s %s(%s): (%.2lf%%) from %g to %g" %
+                        (ind, func, var, d, t1, t2))
+
+
+def plot_graphs(bench1, bench2):
+    """Plot graphs for functions
+
+    Make scatter plots for the functions and their variants.
+
+    Args:
+        bench1: Set of points from the first machine
+        bench2: Set of points from the second machine.
+    """
+    for func in bench1['functions'].keys():
+        for var in bench1['functions'][func].keys():
+            # No point trying to print a graph if there are no detailed
+            # timings.
+            if u'timings' not in bench1['functions'][func][var].keys():
+                print('Skipping graph for %s(%s)' % (func, var))
+                continue
+
+            pylab.clf()
+            pylab.ylabel('Time (cycles)')
+
+            # First set of points
+            length = len(bench1['functions'][func][var]['timings'])
+            X = [float(x) for x in range(length)]
+            lines = pylab.scatter(X, bench1['functions'][func][var]['timings'],
+                    1.5 + 100 / length)
+            pylab.setp(lines, 'color', 'r')
+
+            # Second set of points
+            length = len(bench2['functions'][func][var]['timings'])
+            X = [float(x) for x in range(length)]
+            lines = pylab.scatter(X, bench2['functions'][func][var]['timings'],
+                    1.5 + 100 / length)
+            pylab.setp(lines, 'color', 'g')
+
+            if var:
+                filename = "%s-%s.png" % (func, var)
+            else:
+                filename = "%s.png" % func
+            print('Writing out %s' % filename)
+            pylab.savefig(filename)
+
+
+def main(args):
+    """Program Entry Point
+
+    Take two benchmark output files and compare their timings.
+    """
+    if len(args) > 4 or len(args) < 3:
+        print('Usage: %s <schema> <file1> <file2> [threshold in %%]' % sys.argv[0])
+        sys.exit(os.EX_USAGE)
+
+    bench1 = bench.parse_bench(args[1], args[0])
+    bench2 = bench.parse_bench(args[2], args[0])
+    if len(args) == 4:
+        threshold = float(args[3])
+    else:
+        threshold = 10.0
+
+    if (bench1['timing-type'] != bench2['timing-type']):
+        print('Cannot compare benchmark outputs: timing types are different')
+        return
+
+    plot_graphs(bench1, bench2)
+
+    bench.compress_timings(bench1)
+    bench.compress_timings(bench2)
+
+    compare_runs(bench1, bench2, threshold)
+
+
+if __name__ == '__main__':
+    main(sys.argv[1:])

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0b052e5e05770c0430ae7b8b89339814ef55472b

commit 0b052e5e05770c0430ae7b8b89339814ef55472b
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Mon Feb 24 23:11:28 2014 +0530

    New script to import and process benchmark output
    
    This is a utility script to import and process benchmark outputs.  It
    loads a benchmark output file and validates it against a schema.  It
    can then compress timing data and present the benchmark object with
    reduced timings that should be representative of the detailed timings
    data.
    
    Programs can use this as a building block to construct their use cases
    for analysis of the benchmarks.

diff --git a/benchtests/scripts/import_bench.py b/benchtests/scripts/import_bench.py
new file mode 100755
index 0000000..f982bea
--- /dev/null
+++ b/benchtests/scripts/import_bench.py
@@ -0,0 +1,132 @@
+#!/usr/bin/python
+# Copyright (C) 2014 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, see
+# <http://www.gnu.org/licenses/>.
+"""Functions to import benchmark data and process it"""
+
+import json
+import jsonschema
+
+def mean(lst):
+    """Compute and return mean of numbers in a list
+
+    The pypy average function has horrible performance, so implement our
+    own mean function.
+
+    Args:
+        lst: The list of numbers to average.
+    """
+    return sum(lst) / len(lst)
+
+
+def split_list(bench, func, var):
+    """ Split the list into a smaller set of more distinct points
+
+    Group together points such that the difference between the smallest
+    point and the mean is less than 1/3rd of the mean.  This means that
+    the mean is at most 1.5x the smalles member of that group.
+
+    mean - xmin < mean / 3
+    i.e. 2 * mean / 3 < xmin
+    i.e. mean < 3 * xmin / 2
+
+    For an evenly distributed group, the largest member will be less than
+    twice the smalles member of the group.
+    Derivation:
+
+    An evenly distributed series would be xmin, xmin + d, xmin + 2d...
+
+    mean = (2 * n * xmin + n * (n - 1) * d) / 2 * n
+    and max element is xmin + (n - 1) * d
+
+    Now, mean < 3 * xmin / 2
+
+    3 * xmin > 2 * mean
+    3 * xmin > (2 * n * xmin + n * (n - 1) * d) / n
+    3 * n * xmin > 2 * n * xmin + n * (n - 1) * d
+    n * xmin > n * (n - 1) * d
+    xmin > (n - 1) * d
+    2 * xmin > xmin + (n-1) * d
+    2 * xmin > xmax
+
+    Hence, proved.
+
+    Similarly, it is trivial to prove that for a similar aggregation by using
+    the maximum element, the maximum element in the group must be at most 4/3
+    times the mean.
+
+    Args:
+        bench: The benchmark object
+        func: The function name
+        var: The function variant name
+    """
+    means = []
+    lst = bench['functions'][func][var]['timings']
+    last = len(lst) - 1
+    while lst:
+        for i in range(last + 1):
+            avg = mean(lst[i:])
+            if avg > 0.75 * lst[last]:
+                means.insert(0, avg)
+                lst = lst[:i]
+                last = i - 1
+                break
+    bench['functions'][func][var]['timings'] = means
+
+
+def do_for_all_timings(bench, callback):
+    """Call a function for all timing objects for each function and its
+    variants.
+    
+    Args:
+        bench: The benchmark object
+        callback: The callback function
+    """
+    for func in bench['functions'].keys():
+        for k in bench['functions'][func].keys():
+            if 'timings' not in bench['functions'][func][k].keys():
+                continue
+
+            callback(bench, func, k)
+
+
+def compress_timings(points):
+    """Club points with close enough values into a single mean value
+
+    See split_list for details on how the clubbing is done.
+
+    Args:
+        points: The set of points.
+    """
+    do_for_all_timings(points, split_list)
+
+
+def parse_bench(filename, schema_filename):
+    """Parse the input file
+
+    Parse and validate the json file containing the benchmark outputs.  Return
+    the resulting object.
+    Args:
+        filename: Name of the benchmark output file.
+    """
+    with open(schema_filename, 'r') as schemafile:
+        schema = json.load(schemafile)
+        with open(filename, 'r') as benchfile:
+            bench = json.load(benchfile)
+            jsonschema.validate(bench, schema)
+            do_for_all_timings(bench, lambda b, f, v:
+                    b['functions'][f][v]['timings'].sort())
+            return bench

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b7084a4b62829bdb24d88fd7d5857485369a9dd8

commit b7084a4b62829bdb24d88fd7d5857485369a9dd8
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Mon Feb 24 17:05:54 2014 +0530

    Print out timing type as a benchmark level value
    
    Print out the timing type as a benchmark level value instead of the
    current function level value.

diff --git a/benchtests/Makefile b/benchtests/Makefile
index a6647fa..1ce2107 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -102,11 +102,14 @@ run-bench = $(test-wrapper-env) \
 	    GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
 	    $($*-ENV) $(rtld-prefix) $${run}
 
+timing-type := $(objpfx)bench-timing-type
+
 bench-clean:
 	rm -f $(binaries-bench) $(addsuffix .o,$(binaries-bench))
 	rm -f $(binaries-benchset) $(addsuffix .o,$(binaries-benchset))
+	rm -f $(timing-type) $(addsuffix .o,$(timing-type))
 
-bench: bench-set bench-func
+bench: $(timing-type) bench-set bench-func
 
 bench-set: $(binaries-benchset)
 	for run in $^; do \
@@ -122,6 +125,8 @@ bench-func: $(binaries-bench)
 	{ echo "{"; \
 	echo "  \"machine\":"; \
 	$(.)scripts/machine-info.sh; \
+	echo ","; \
+	$(timing-type); \
 	echo "  ,\"functions\": {"; \
 	for run in $^; do \
 	  if ! [ "x$${run}" = "x$<" ]; then \
@@ -139,7 +144,7 @@ bench-func: $(binaries-bench)
 	$(.)scripts/validate_benchout.py $(objpfx)bench.out \
 		$(.)scripts/benchout.schema.json
 
-$(binaries-bench) $(binaries-benchset): %: %.o \
+$(timing-type) $(binaries-bench) $(binaries-benchset): %: %.o \
   $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
   $(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
 	$(+link)
diff --git a/benchtests/bench-skeleton.c b/benchtests/bench-skeleton.c
index ad7c1ec..0c7d744 100644
--- a/benchtests/bench-skeleton.c
+++ b/benchtests/bench-skeleton.c
@@ -66,11 +66,11 @@ main (int argc, char **argv)
 
   /* Begin function.  */
   printf ("\"%s\": {\n", FUNCNAME);
-  printf ("\"timing-type\": \"%s\"\n", TIMING_TYPE);
 
   for (int v = 0; v < NUM_VARIANTS; v++)
     {
-      putc (',', stdout);
+      if (v)
+	putc (',', stdout);
       /* Run for approximately DURATION seconds.  */
       clock_gettime (CLOCK_MONOTONIC_RAW, &runtime);
       runtime.tv_sec += DURATION;
diff --git a/benchtests/bench-timing-type.c b/benchtests/bench-timing-type.c
new file mode 100644
index 0000000..903a61f
--- /dev/null
+++ b/benchtests/bench-timing-type.c
@@ -0,0 +1,27 @@
+/* Print out the timing type used by the benchmark run.
+   Copyright (C) 2014 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include "bench-timing.h"
+#include <stdio.h>
+
+int
+main (int argc, char **argv)
+{
+  printf ("\"timing-type\": \"%s\"\n", TIMING_TYPE);
+  return 0;
+}
diff --git a/benchtests/scripts/benchout.schema.json b/benchtests/scripts/benchout.schema.json
index 9b2545a..3f39823 100644
--- a/benchtests/scripts/benchout.schema.json
+++ b/benchtests/scripts/benchout.schema.json
@@ -17,6 +17,9 @@
       "required": ["vendor-id", "cpu-family", "model", "cpu-cores",
                    "processors", "cache-size", "memory", "swap"]
     },
+    "timing-type": {
+      "type": "string"
+    },
     "functions": {
       "title": "Associative array of functions",
       "type": "object",
@@ -24,10 +27,6 @@
         "^[_a-zA-Z][_a-zA-Z0-9]+$": {
           "title": "Function names",
           "type": "object",
-          "properties": {
-            "timing-type": {"type": "string"}
-          },
-          "required": ["timing-type"],
           "patternProperties": {
             "^[_a-zA-Z0-9]*$": {
               "title": "Function variants",
@@ -53,6 +52,6 @@
       "minProperties": 1
     }
   },
-  "required": ["machine", "functions"],
+  "required": ["machine", "timing-type", "functions"],
   "additionalProperties": false
 }

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ae82145633a954ee90a1e9c65caf082e22f321d3

commit ae82145633a954ee90a1e9c65caf082e22f321d3
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Feb 21 16:16:45 2014 +0530

    Include the mean again in the summary

diff --git a/benchtests/bench-skeleton.c b/benchtests/bench-skeleton.c
index 656d508..ad7c1ec 100644
--- a/benchtests/bench-skeleton.c
+++ b/benchtests/bench-skeleton.c
@@ -121,8 +121,9 @@ main (int argc, char **argv)
 
       printf ("\"%s\": {\n", VARIANT (v));
       printf ("\"duration\": %g, \"iterations\": %g, "
-	      "\"max\": %g, \"min\": %g\n",
-	      d_total_s, d_total_i, max / d_iters, min / d_iters);
+	      "\"max\": %g, \"min\": %g, \"mean\": %g\n",
+	      d_total_s, d_total_i, max / d_iters, min / d_iters,
+	      d_total_s / d_total_i);
 
       if (detailed)
 	{
diff --git a/benchtests/scripts/benchout.schema.json b/benchtests/scripts/benchout.schema.json
index 3a6c5cd..9b2545a 100644
--- a/benchtests/scripts/benchout.schema.json
+++ b/benchtests/scripts/benchout.schema.json
@@ -37,12 +37,13 @@
                 "iterations": {"type": "number"},
                 "max": {"type": "number"},
                 "min": {"type": "number"},
+                "mean": {"type": "number"},
                 "timings": {
                   "type": "array",
                   "items": {"type": "number"}
                 }
               },
-              "required": ["duration", "iterations", "max", "min"],
+              "required": ["duration", "iterations", "max", "min", "mean"],
               "additionalProperties": false
             }
           },

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8f5359749e06bbc73dcc5b766fd7b9ba928fca34

commit 8f5359749e06bbc73dcc5b766fd7b9ba928fca34
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 16:49:46 2014 +0530

    Validate bench.out against a JSON schema

diff --git a/benchtests/Makefile b/benchtests/Makefile
index a43a754..a6647fa 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -136,6 +136,8 @@ bench-func: $(binaries-bench)
 	  mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
 	fi; \
 	mv -f $(objpfx)bench.out-tmp $(objpfx)bench.out
+	$(.)scripts/validate_benchout.py $(objpfx)bench.out \
+		$(.)scripts/benchout.schema.json
 
 $(binaries-bench) $(binaries-benchset): %: %.o \
   $(sort $(filter $(common-objpfx)lib%,$(link-libc))) \
diff --git a/benchtests/scripts/benchout.schema.json b/benchtests/scripts/benchout.schema.json
new file mode 100644
index 0000000..3a6c5cd
--- /dev/null
+++ b/benchtests/scripts/benchout.schema.json
@@ -0,0 +1,57 @@
+{
+  "title": "benchmark",
+  "type": "object",
+  "properties": {
+    "machine": {
+      "type": "object",
+      "properties": {
+        "vendor-id": {"type": "string"},
+        "cpu-family": {"type": "number"},
+        "model": {"type": "number"},
+        "cpu-cores": {"type": "number"},
+        "processors": {"type": "number"},
+        "cache-size": {"type": "number"},
+        "memory": {"type": "number"},
+        "swap": {"type": "number"}
+      },
+      "required": ["vendor-id", "cpu-family", "model", "cpu-cores",
+                   "processors", "cache-size", "memory", "swap"]
+    },
+    "functions": {
+      "title": "Associative array of functions",
+      "type": "object",
+      "patternProperties": {
+        "^[_a-zA-Z][_a-zA-Z0-9]+$": {
+          "title": "Function names",
+          "type": "object",
+          "properties": {
+            "timing-type": {"type": "string"}
+          },
+          "required": ["timing-type"],
+          "patternProperties": {
+            "^[_a-zA-Z0-9]*$": {
+              "title": "Function variants",
+              "type": "object",
+              "properties": {
+                "duration": {"type": "number"},
+                "iterations": {"type": "number"},
+                "max": {"type": "number"},
+                "min": {"type": "number"},
+                "timings": {
+                  "type": "array",
+                  "items": {"type": "number"}
+                }
+              },
+              "required": ["duration", "iterations", "max", "min"],
+              "additionalProperties": false
+            }
+          },
+          "additionalProperties": false
+        }
+      },
+      "minProperties": 1
+    }
+  },
+  "required": ["machine", "functions"],
+  "additionalProperties": false
+}
diff --git a/benchtests/scripts/validate_benchout.py b/benchtests/scripts/validate_benchout.py
new file mode 100755
index 0000000..b6a34e2
--- /dev/null
+++ b/benchtests/scripts/validate_benchout.py
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+# Copyright (C) 2014 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, see
+# <http://www.gnu.org/licenses/>.
+"""Benchmark output validator
+
+Given a benchmark output file in json format and a benchmark schema file,
+validate the output against the schema.
+"""
+
+from __future__ import print_function
+import jsonschema
+import json
+import sys
+import os
+
+
+def validate_bench(benchfile, schemafile):
+    """Validate benchmark file
+
+    Validate a benchmark output file against a JSON schema.
+
+    Args:
+        benchfile: The file name of the bench.out file.
+        schemafile: The file name of the JSON schema file to validate
+        bench.out against.
+
+    Exceptions:
+        jsonschema.ValidationError: When bench.out is not valid
+        jsonschema.SchemaError: When the JSON schema is not valid
+        IOError: If any of the files are not found.
+    """
+    with open(benchfile, 'r') as bfile:
+        with open(schemafile, 'r') as sfile:
+            bench = json.load(bfile)
+            schema = json.load(sfile)
+            jsonschema.validate(bench, schema)
+
+    # If we reach here, we're all good.
+    print("Benchmark output in %s is valid." % benchfile)
+
+
+def main(args):
+    """Main entry point
+
+    Args:
+        args: The command line arguments to the program
+
+    Returns:
+        0 on success or a non-zero failure code
+
+    Exceptions:
+        Exceptions thrown by validate_bench
+    """
+    if len(args) != 2:
+        print("Usage: %s <bench.out file> <bench.out schema>" % sys.argv[0],
+                file=sys.stderr)
+        return os.EX_USAGE
+
+    validate_bench(args[0], args[1])
+    return os.EX_OK
+
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv[1:]))

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=55e2e2b7326ac89537da017f2838d3f58757ac84

commit 55e2e2b7326ac89537da017f2838d3f58757ac84
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 15:57:22 2014 +0530

    benchtests: move machine-info.sh into benchtests/scripts/

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 57c40fe..a43a754 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -121,7 +121,7 @@ bench-set: $(binaries-benchset)
 bench-func: $(binaries-bench)
 	{ echo "{"; \
 	echo "  \"machine\":"; \
-	./machine-info.sh; \
+	$(.)scripts/machine-info.sh; \
 	echo "  ,\"functions\": {"; \
 	for run in $^; do \
 	  if ! [ "x$${run}" = "x$<" ]; then \
diff --git a/benchtests/machine-info.sh b/benchtests/scripts/machine-info.sh
similarity index 100%
rename from benchtests/machine-info.sh
rename to benchtests/scripts/machine-info.sh

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=47536082b4aa98c5a91fcee7483d19d6ef2c2f46

commit 47536082b4aa98c5a91fcee7483d19d6ef2c2f46
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 15:55:10 2014 +0530

    benchtests: Move bench.py to benchtests/scripts/

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 0886a45..57c40fe 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -146,5 +146,5 @@ $(objpfx)bench-%.c: %-inputs $(bench-deps)
 	{ if [ -n "$($*-INCLUDE)" ]; then \
 	  cat $($*-INCLUDE); \
 	fi; \
-	$(..)scripts/bench.py $(patsubst %-inputs,%,$<); } > $@-tmp
+	$(.)scripts/bench.py $(patsubst %-inputs,%,$<); } > $@-tmp
 	mv -f $@-tmp $@
diff --git a/scripts/bench.py b/benchtests/scripts/bench.py
similarity index 100%
rename from scripts/bench.py
rename to benchtests/scripts/bench.py

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f81822472553a12c46c843aaa04ce544e31f91f4

commit f81822472553a12c46c843aaa04ce544e31f91f4
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Feb 5 15:50:31 2014 +0530

    benchtests: Mention a constraint on a valid variant name

diff --git a/benchtests/README b/benchtests/README
index 2a940fa..ebccaf7 100644
--- a/benchtests/README
+++ b/benchtests/README
@@ -78,7 +78,8 @@ the same file by using the `name' directive that looks something like this:
   ##name: 240bit
 
 See the pow-inputs file for an example of what such a partitioned input file
-would look like.
+would look like.  The valid value is a string that can contain numbers,
+alphabets and underscores.
 
 Benchmark Sets:
 ==============

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=31fb7b73449eb849795d05d318ad16a182be12a6

commit 31fb7b73449eb849795d05d318ad16a182be12a6
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Tue Feb 4 21:31:23 2014 +0530

    Actually do json output

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 0e0704a..0886a45 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -114,13 +114,23 @@ bench-set: $(binaries-benchset)
 	  $(run-bench) > $${run}.out; \
 	done
 
+# Build and execute the benchmark functions.  This target generates JSON
+# formatted bench.out.  Each of the programs produce independent JSON output,
+# so one could even execute them individually and process it using any JSON
+# capable language or tool.
 bench-func: $(binaries-bench)
 	{ echo "{"; \
+	echo "  \"machine\":"; \
 	./machine-info.sh; \
+	echo "  ,\"functions\": {"; \
 	for run in $^; do \
+	  if ! [ "x$${run}" = "x$<" ]; then \
+	    echo ","; \
+	  fi; \
 	  echo "Running $${run}" >&2; \
 	  $(run-bench) $(DETAILED_OPT); \
 	done; \
+	echo "  }"; \
 	echo "}"; } > $(objpfx)bench.out-tmp; \
 	if [ -f $(objpfx)bench.out ]; then \
 	  mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
diff --git a/benchtests/bench-skeleton.c b/benchtests/bench-skeleton.c
index 1a124a2..656d508 100644
--- a/benchtests/bench-skeleton.c
+++ b/benchtests/bench-skeleton.c
@@ -64,11 +64,13 @@ main (int argc, char **argv)
 
   iters = 1000 * res;
 
-  if (detailed)
-    printf ("%s\n", FUNCNAME);
+  /* Begin function.  */
+  printf ("\"%s\": {\n", FUNCNAME);
+  printf ("\"timing-type\": \"%s\"\n", TIMING_TYPE);
 
   for (int v = 0; v < NUM_VARIANTS; v++)
     {
+      putc (',', stdout);
       /* Run for approximately DURATION seconds.  */
       clock_gettime (CLOCK_MONOTONIC_RAW, &runtime);
       runtime.tv_sec += DURATION;
@@ -117,18 +119,27 @@ main (int argc, char **argv)
       d_total_s = total;
       d_iters = iters;
 
-      if (!detailed)
-	{
-	  TIMING_PRINT_STATS (VARIANT (v), d_total_s, d_iters, d_total_i, max,
-			      min);
-	}
-      else
+      printf ("\"%s\": {\n", VARIANT (v));
+      printf ("\"duration\": %g, \"iterations\": %g, "
+	      "\"max\": %g, \"min\": %g\n",
+	      d_total_s, d_total_i, max / d_iters, min / d_iters);
+
+      if (detailed)
 	{
-	  printf ("\t%s\n", VARIANT (v));
+	  printf (",\n\"timings\": [");
 	  for (int i = 0; i < NUM_SAMPLES (v); i++)
-	    printf ("\t\t%g\n", RESULT (v, i));
+	    {
+	      if (i > 0)
+		putc (',', stdout);
+	      printf ("%g", RESULT (v, i));
+	    }
+	  puts ("]");
 	}
+      puts ("}");
     }
 
+  /* End function.  */
+  puts ("}");
+
   return 0;
 }
diff --git a/benchtests/bench-timing.h b/benchtests/bench-timing.h
index 13fc946..ccde601 100644
--- a/benchtests/bench-timing.h
+++ b/benchtests/bench-timing.h
@@ -25,6 +25,8 @@
 hp_timing_t _dl_hp_timing_overhead;
 typedef hp_timing_t timing_t;
 
+# define TIMING_TYPE "hp_timing"
+
 # define TIMING_INIT(res) \
 ({									      \
   HP_TIMING_DIFF_INIT();						      \
@@ -35,16 +37,13 @@ typedef hp_timing_t timing_t;
 # define TIMING_DIFF(diff, start, end) HP_TIMING_DIFF ((diff), (start), (end))
 # define TIMING_ACCUM(sum, diff) HP_TIMING_ACCUM_NT ((sum), (diff))
 
-# define TIMING_PRINT_STATS(func, d_total_s, d_iters, d_total_i, max, min) \
-  printf ("%s: ITERS:%g: TOTAL:%gMcy, MAX:%gcy, MIN:%gcy, %g calls/Mcy\n",    \
-	  (func), (d_total_i), (d_total_s) * 1e-6, (max) / (d_iters),	      \
-	  (min) / (d_iters), 1e6 * (d_total_i) / (d_total_s));
-
 #else
 
 #include <time.h>
 typedef uint64_t timing_t;
 
+# define TIMING_TYPE "clock_gettime"
+
 /* Measure the resolution of the clock so we can scale the number of
    benchmark iterations by this value.  */
 # define TIMING_INIT(res) \
@@ -64,11 +63,6 @@ typedef uint64_t timing_t;
 # define TIMING_DIFF(diff, start, end) (diff) = (end) - (start)
 # define TIMING_ACCUM(sum, diff) (sum) += (diff)
 
-# define TIMING_PRINT_STATS(func, d_total_s, d_iters, d_total_i, max, min) \
-  printf ("%s: ITERS:%g: TOTAL:%gs, MAX:%gns, MIN:%gns, %g iter/s\n",	      \
-	  (func), (d_total_i), (d_total_s) * 1e-9, (max) / (d_iters),		      \
-	  (min) / (d_iters), 1e9 * (d_total_i) / (d_total_s))
-
 #endif
 
 #define TIMING_PRINT_MEAN(d_total_s, d_iters) \
diff --git a/benchtests/machine-info.sh b/benchtests/machine-info.sh
index 041da30..3e51f1c 100755
--- a/benchtests/machine-info.sh
+++ b/benchtests/machine-info.sh
@@ -1,12 +1,14 @@
 #!/bin/sh
 # Simple script to get some basic machine information
 
-sed -n  -e 's/vendor_id[ \t]\+:\(.*\)/  "vendor-id": \1,/p' \
-	-e 's/cpu family[ \t]\+:\(.*\)/  "cpu-family": \1,/p' \
-	-e 's/\(model\)[ \t]\+:\(.*\)/  "\1": \1,/p' \
-	-e 's/cpu cores[ \t]\+:\(.*\)/  "cpu-cores": \1,/p' \
-	-e 's/cache size[ \t]\+:\([0-9]\+\).*/  "cache-size": \1,/p' \
+echo "{"
+sed -n  -e 's/vendor_id[ \t]\+: \(.*\)/  "vendor-id": "\1",/p' \
+	-e 's/cpu family[ \t]\+: \(.*\)/  "cpu-family": \1,/p' \
+	-e 's/\(model\)[ \t]\+: \(.*\)/  "\1": \2,/p' \
+	-e 's/cpu cores[ \t]\+: \(.*\)/  "cpu-cores": \1,/p' \
+	-e 's/cache size[ \t]\+: \([0-9]\+\).*/  "cache-size": \1,/p' \
 	-e 's/MemTotal:[ \t]\+\([0-9]\+\).*/  "memory": \1,/p' \
 	-e 's/SwapTotal:[ \t]\+\([0-9]\+\).*/  "swap": \1,/p' \
 	 /proc/cpuinfo /proc/meminfo | sort -u
-echo "  \"processors\": $(grep -c 'processor' /proc/cpuinfo),"
+echo "  \"processors\": $(grep -c 'processor' /proc/cpuinfo)"
+echo "}"
diff --git a/scripts/bench.py b/scripts/bench.py
index 11f616f..2a5d250 100755
--- a/scripts/bench.py
+++ b/scripts/bench.py
@@ -176,7 +176,7 @@ def _print_arg_data(func, directives, all_vals):
 
         # Members for the variants structure list that we will
         # print later.
-        variants.append('  {"%s(%s)", %d, in%d},' % (func, k, len(vals), i))
+        variants.append('  {"%s", %d, in%d},' % (k, len(vals), i))
         print(ARGS_TEMPLATE % {'argnum': i, 'num_args': len(vals),
                                'args': '\n'.join(out)})
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=fc21e2d320e4156341edd9e181461dd74a8844ae

commit fc21e2d320e4156341edd9e181461dd74a8844ae
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Mon Feb 3 12:36:15 2014 +0530

    Make bench.out in json format

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 7f7145a..0e0704a 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -115,11 +115,13 @@ bench-set: $(binaries-benchset)
 	done
 
 bench-func: $(binaries-bench)
-	{ ./machine-info.sh; \
+	{ echo "{"; \
+	./machine-info.sh; \
 	for run in $^; do \
 	  echo "Running $${run}" >&2; \
 	  $(run-bench) $(DETAILED_OPT); \
-	done; } > $(objpfx)bench.out-tmp; \
+	done; \
+	echo "}"; } > $(objpfx)bench.out-tmp; \
 	if [ -f $(objpfx)bench.out ]; then \
 	  mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
 	fi; \
diff --git a/benchtests/machine-info.sh b/benchtests/machine-info.sh
index aa09da5..041da30 100755
--- a/benchtests/machine-info.sh
+++ b/benchtests/machine-info.sh
@@ -1,13 +1,12 @@
 #!/bin/sh
 # Simple script to get some basic machine information
 
-{ sed -n -e 's/\(vendor_id\)[ \t]\+:/1. \1:/p' \
-	 -e 's/\(cpu family\)[ \t]\+:/2. \1:/p' \
-	 -e 's/\(model\)[ \t]\+:/3. \1:/p' \
-	 -e 's/\(cpu cores\)[ \t]\+:/4. \1:/p' \
-	 -e 's/\(cache size\)[ \t]\+:/6. \1:/p' \
-	 -e 's/MemTotal:[ \t]\+\(.*\)/7. memory: \1/p' \
-	 -e 's/SwapTotal:[ \t]\+\(.*\)/8. swap: \1/p' \
-	 /proc/cpuinfo /proc/meminfo; \
-	echo 5. processors: $(grep -c 'processor' /proc/cpuinfo); } | 
-	sort -u
+sed -n  -e 's/vendor_id[ \t]\+:\(.*\)/  "vendor-id": \1,/p' \
+	-e 's/cpu family[ \t]\+:\(.*\)/  "cpu-family": \1,/p' \
+	-e 's/\(model\)[ \t]\+:\(.*\)/  "\1": \1,/p' \
+	-e 's/cpu cores[ \t]\+:\(.*\)/  "cpu-cores": \1,/p' \
+	-e 's/cache size[ \t]\+:\([0-9]\+\).*/  "cache-size": \1,/p' \
+	-e 's/MemTotal:[ \t]\+\([0-9]\+\).*/  "memory": \1,/p' \
+	-e 's/SwapTotal:[ \t]\+\([0-9]\+\).*/  "swap": \1,/p' \
+	 /proc/cpuinfo /proc/meminfo | sort -u
+echo "  \"processors\": $(grep -c 'processor' /proc/cpuinfo),"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8d0c519df6a96f0f03c222cc639a8ba48b77c4cc

commit 8d0c519df6a96f0f03c222cc639a8ba48b77c4cc
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Jan 17 18:14:57 2014 +0530

    Add machine info

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 9e6c58e..7f7145a 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -115,7 +115,8 @@ bench-set: $(binaries-benchset)
 	done
 
 bench-func: $(binaries-bench)
-	{ for run in $^; do \
+	{ ./machine-info.sh; \
+	for run in $^; do \
 	  echo "Running $${run}" >&2; \
 	  $(run-bench) $(DETAILED_OPT); \
 	done; } > $(objpfx)bench.out-tmp; \
diff --git a/benchtests/machine-info.sh b/benchtests/machine-info.sh
new file mode 100755
index 0000000..aa09da5
--- /dev/null
+++ b/benchtests/machine-info.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# Simple script to get some basic machine information
+
+{ sed -n -e 's/\(vendor_id\)[ \t]\+:/1. \1:/p' \
+	 -e 's/\(cpu family\)[ \t]\+:/2. \1:/p' \
+	 -e 's/\(model\)[ \t]\+:/3. \1:/p' \
+	 -e 's/\(cpu cores\)[ \t]\+:/4. \1:/p' \
+	 -e 's/\(cache size\)[ \t]\+:/6. \1:/p' \
+	 -e 's/MemTotal:[ \t]\+\(.*\)/7. memory: \1/p' \
+	 -e 's/SwapTotal:[ \t]\+\(.*\)/8. swap: \1/p' \
+	 /proc/cpuinfo /proc/meminfo; \
+	echo 5. processors: $(grep -c 'processor' /proc/cpuinfo); } | 
+	sort -u

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1bbb9d18573e964d897817921e1eb865e7081535

commit 1bbb9d18573e964d897817921e1eb865e7081535
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Thu Jan 16 15:09:10 2014 +0530

    Remove bench-modf.c

diff --git a/benchtests/bench-modf.c b/benchtests/bench-modf.c
deleted file mode 100644
index 407360c..0000000
--- a/benchtests/bench-modf.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright (C) 2013-2014 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, see
-   <http://www.gnu.org/licenses/>.  */
-
-extern double modf (double, double *);
-
-#define CALL_BENCH_FUNC(j, i) modf (in[j].arg0, &i);
-
-struct args
-{
-  volatile double arg0;
-} in[] =
-{
-  {  42.42 },
-  { -42.42 }
-};
-
-#define NUM_VARIANTS 1
-#define NUM_SAMPLES(v) (sizeof (in) / sizeof (struct args))
-
-static volatile double ret = 0.0;
-#define BENCH_FUNC(v, j) \
-({									      \
-  double iptr;								      \
-  ret =  CALL_BENCH_FUNC (j, iptr);					      \
-})
-
-#define FUNCNAME "modf"
-#define VARIANT(v) FUNCNAME "()"
-
-#include "bench-skeleton.c"
diff --git a/benchtests/modf-inputs b/benchtests/modf-inputs
new file mode 100644
index 0000000..4fcc99b
--- /dev/null
+++ b/benchtests/modf-inputs
@@ -0,0 +1,4 @@
+## includes: math.h
+## args: double:<double *>
+42.0
+-42.0

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=27ad3eb0cb553af4b7dc6031dac1d2605c9e22e3

commit 27ad3eb0cb553af4b7dc6031dac1d2605c9e22e3
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Wed Jan 15 12:48:09 2014 +0530

    Detailed benchmark numbers
    
    Store timings per input.

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 792f61f..9e6c58e 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -84,6 +84,12 @@ ifdef USE_CLOCK_GETTIME
 CPPFLAGS-nonlib += -DUSE_CLOCK_GETTIME
 endif
 
+DETAILED_OPT :=
+
+ifdef DETAILED
+DETAILED_OPT := -d
+endif
+
 # This makes sure CPPFLAGS-nonlib and CFLAGS-nonlib are passed
 # for all these modules.
 cpp-srcs-left := $(binaries-benchset:=.c) $(binaries-bench:=.c)
@@ -111,7 +117,7 @@ bench-set: $(binaries-benchset)
 bench-func: $(binaries-bench)
 	{ for run in $^; do \
 	  echo "Running $${run}" >&2; \
-	  $(run-bench); \
+	  $(run-bench) $(DETAILED_OPT); \
 	done; } > $(objpfx)bench.out-tmp; \
 	if [ -f $(objpfx)bench.out ]; then \
 	  mv -f $(objpfx)bench.out $(objpfx)bench.out.old; \
diff --git a/benchtests/bench-skeleton.c b/benchtests/bench-skeleton.c
index 4290e76..1a124a2 100644
--- a/benchtests/bench-skeleton.c
+++ b/benchtests/bench-skeleton.c
@@ -18,6 +18,7 @@
 
 #include <string.h>
 #include <stdint.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <time.h>
 #include <inttypes.h>
@@ -48,6 +49,10 @@ main (int argc, char **argv)
   unsigned long i, k;
   struct timespec runtime;
   timing_t start, end;
+  bool detailed = false;
+
+  if (argc == 2 && !strcmp (argv[1], "-d"))
+    detailed = true;
 
   startup();
 
@@ -59,6 +64,9 @@ main (int argc, char **argv)
 
   iters = 1000 * res;
 
+  if (detailed)
+    printf ("%s\n", FUNCNAME);
+
   for (int v = 0; v < NUM_VARIANTS; v++)
     {
       /* Run for approximately DURATION seconds.  */
@@ -67,6 +75,7 @@ main (int argc, char **argv)
 
       double d_total_i = 0;
       timing_t total = 0, max = 0, min = 0x7fffffffffffffff;
+      int64_t c = 0;
       while (1)
 	{
 	  for (i = 0; i < NUM_SAMPLES (v); i++)
@@ -86,9 +95,13 @@ main (int argc, char **argv)
 		min = cur;
 
 	      TIMING_ACCUM (total, cur);
+	      /* Accumulate timings for the value.  In the end we will divide
+	         by the total iterations.  */
+	      RESULT_ACCUM (cur, v, i, c * iters, (c + 1) * iters);
 
 	      d_total_i += iters;
 	    }
+	  c++;
 	  struct timespec curtime;
 
 	  memset (&curtime, 0, sizeof (curtime));
@@ -104,8 +117,17 @@ main (int argc, char **argv)
       d_total_s = total;
       d_iters = iters;
 
-      TIMING_PRINT_STATS (VARIANT (v), d_total_s, d_iters, d_total_i, max,
-			  min);
+      if (!detailed)
+	{
+	  TIMING_PRINT_STATS (VARIANT (v), d_total_s, d_iters, d_total_i, max,
+			      min);
+	}
+      else
+	{
+	  printf ("\t%s\n", VARIANT (v));
+	  for (int i = 0; i < NUM_SAMPLES (v); i++)
+	    printf ("\t\t%g\n", RESULT (v, i));
+	}
     }
 
   return 0;
diff --git a/scripts/bench.py b/scripts/bench.py
index 81ffc15..11f616f 100755
--- a/scripts/bench.py
+++ b/scripts/bench.py
@@ -50,6 +50,7 @@ STRUCT_TEMPLATE = '''
 struct args
 {
 %(args)s
+  double timing;
 };
 
 struct _variants
@@ -80,6 +81,9 @@ struct _variants variants[%(num_variants)d] = {
 
 # Epilogue for the generated source file.
 EPILOGUE = '''
+#define RESULT(__v, __i) (variants[(__v)].in[(__i)].timing)
+#define RESULT_ACCUM(r, v, i, old, new) \\
+        ((RESULT ((v), (i))) = (RESULT ((v), (i)) * (old) + (r)) / ((new) + 1))
 #define BENCH_FUNC(i, j) ({%(getret)s CALL_BENCH_FUNC (i, j);})
 #define FUNCNAME "%(func)s"
 #include "bench-skeleton.c"'''
@@ -168,7 +172,7 @@ def _print_arg_data(func, directives, all_vals):
     # Now print the values.
     variants = []
     for (k, vals), i in zip(all_vals.items(), itertools.count()):
-        out = ['  {%s},' % v for v in vals]
+        out = ['  {%s, 0},' % v for v in vals]
 
         # Members for the variants structure list that we will
         # print later.

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c8aa68d2fd5357b8a8b79d109a54c71a2f79c416

commit c8aa68d2fd5357b8a8b79d109a54c71a2f79c416
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Fri Dec 6 13:51:09 2013 +0530

    Implement benchmarking script in python

diff --git a/benchtests/Makefile b/benchtests/Makefile
index 8bfb039..792f61f 100644
--- a/benchtests/Makefile
+++ b/benchtests/Makefile
@@ -127,5 +127,5 @@ $(objpfx)bench-%.c: %-inputs $(bench-deps)
 	{ if [ -n "$($*-INCLUDE)" ]; then \
 	  cat $($*-INCLUDE); \
 	fi; \
-	$(..)scripts/bench.pl $(patsubst %-inputs,%,$<); } > $@-tmp
+	$(..)scripts/bench.py $(patsubst %-inputs,%,$<); } > $@-tmp
 	mv -f $@-tmp $@
diff --git a/benchtests/README b/benchtests/README
index a5fd8da..2a940fa 100644
--- a/benchtests/README
+++ b/benchtests/README
@@ -8,7 +8,9 @@ basic performance properties of the function.
 Running the benchmark:
 =====================
 
-The benchmark can be executed by invoking make as follows:
+The benchmark needs python 2.7 or later in addition to the
+dependencies required to build the GNU C Library.  One may run the
+benchmark by invoking make as follows:
 
   $ make bench
 
diff --git a/scripts/bench.pl b/scripts/bench.pl
deleted file mode 100755
index 569cd51..0000000
--- a/scripts/bench.pl
+++ /dev/null
@@ -1,205 +0,0 @@
-#! /usr/bin/perl -w
-# Copyright (C) 2013-2014 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, see
-# <http://www.gnu.org/licenses/>.
-
-
-use strict;
-use warnings;
-# Generate a benchmark source file for a given input.
-
-if (@ARGV < 1) {
-  die "Usage: bench.pl <function>"
-}
-
-my $func = $ARGV[0];
-my @args;
-my $ret = "void";
-my $getret = "";
-
-# We create a hash of inputs for each variant of the test.
-my $variant = "";
-my @curvals;
-my %vals;
-my @include_headers;
-my @include_sources;
-my $incl;
-
-open INPUTS, "<$func-inputs" or die $!;
-
-LINE:while (<INPUTS>) {
-  chomp;
-
-  # Directives.
-  if (/^## ([\w-]+): (.*)/) {
-    # Function argument types.
-    if ($1 eq "args") {
-      @args = split(":", $2);
-    }
-
-    # Function return type.
-    elsif ($1 eq "ret") {
-      $ret = $2;
-    }
-
-    elsif ($1 eq "includes") {
-      @include_headers = split (",", $2);
-    }
-
-    elsif ($1 eq "include-sources") {
-      @include_sources = split (",", $2);
-    }
-
-    # New variant.  This is the only directive allowed in the body of the
-    # inputs to separate inputs into variants.  All others should be at the
-    # top or else all hell will break loose.
-    elsif ($1 eq "name") {
-
-      # Save values in the previous variant.
-      my @copy = @curvals;
-      $vals{$variant} = \@copy;
-
-      # Prepare for the next.
-      $variant=$2;
-      undef @curvals;
-      next LINE;
-    }
-
-    else {
-      die "Unknown directive: ".$1;
-    }
-  }
-
-  # Skip over comments and blank lines.
-  if (/^#/ || /^$/) {
-    next LINE;
-  }
-  push (@curvals, $_);
-}
-
-
-my $bench_func = "#define CALL_BENCH_FUNC(v, i) $func (";
-
-# Output variables.  These include the return value as well as any pointers
-# that may get passed into the function, denoted by the <> around the type.
-my $outvars = "";
-
-if ($ret ne "void") {
-  $outvars = "static $ret volatile ret;\n";
-}
-
-# Print the definitions and macros.
-foreach $incl (@include_headers) {
-  print "#include <" . $incl . ">\n";
-}
-
-# Print the source files.
-foreach $incl (@include_sources) {
-  print "#include \"" . $incl . "\"\n";
-}
-
-if (@args > 0) {
-  # Save values in the last variant.
-  $vals{$variant} = \@curvals;
-  my $struct =
-    "struct _variants
-    {
-      const char *name;
-      int count;
-      struct args *in;
-    };\n";
-
-  my $arg_struct = "struct args {";
-
-  my $num = 0;
-  my $arg;
-  foreach $arg (@args) {
-    if ($num > 0) {
-      $bench_func = "$bench_func,";
-    }
-
-    $_ = $arg;
-    if (/<(.*)\*>/) {
-      # Output variables.  These have to be pointers, so dereference once by
-      # dropping one *.
-      $outvars = $outvars . "static $1 out$num;\n";
-      $bench_func = "$bench_func &out$num";
-    }
-    else {
-      $arg_struct = "$arg_struct $arg volatile arg$num;";
-      $bench_func = "$bench_func variants[v].in[i].arg$num";
-    }
-
-    $num = $num + 1;
-  }
-
-  $arg_struct = $arg_struct . "};\n";
-  $bench_func = $bench_func . ");\n";
-
-  print $bench_func;
-  print $arg_struct;
-  print $struct;
-
-  my $c = 0;
-  my $key;
-
-  # Print the input arrays.
-  foreach $key (keys %vals) {
-    my @arr = @{$vals{$key}};
-
-    print "struct args in" . $c . "[" . @arr . "] = {\n";
-    foreach (@arr) {
-      print "{$_},\n";
-    }
-    print "};\n\n";
-    $c += 1;
-  }
-
-  # The variants.  Each variant then points to the appropriate input array we
-  # defined above.
-  print "struct _variants variants[" . (keys %vals) . "] = {\n";
-  $c = 0;
-  foreach $key (keys %vals) {
-    print "{\"$func($key)\", " . @{$vals{$key}} . ", in$c},\n";
-    $c += 1;
-  }
-  print "};\n\n";
-  # Finally, print the last set of macros.
-  print "#define NUM_VARIANTS $c\n";
-  print "#define NUM_SAMPLES(i) (variants[i].count)\n";
-  print "#define VARIANT(i) (variants[i].name)\n";
-}
-else {
-  print $bench_func . ");\n";
-  print "#define NUM_VARIANTS (1)\n";
-  print "#define NUM_SAMPLES(v) (1)\n";
-  print "#define VARIANT(v) FUNCNAME \"()\"\n"
-}
-
-# Print the output variable definitions.
-print "$outvars\n";
-
-# In some cases not storing a return value seems to result in the function call
-# being optimized out.
-if ($ret ne "void") {
-  $getret = "ret = ";
-}
-
-# And we're done.
-print "#define BENCH_FUNC(i, j) ({$getret CALL_BENCH_FUNC (i, j);})\n";
-
-print "#define FUNCNAME \"$func\"\n";
-print "#include \"bench-skeleton.c\"\n";
diff --git a/scripts/bench.py b/scripts/bench.py
new file mode 100755
index 0000000..81ffc15
--- /dev/null
+++ b/scripts/bench.py
@@ -0,0 +1,299 @@
+#!/usr/bin/python
+# Copyright (C) 2014 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, see
+# <http://www.gnu.org/licenses/>.
+
+"""Benchmark program generator script
+
+This script takes a function name as input and generates a program using
+an input file located in the benchtests directory.  The name of the
+input file should be of the form foo-inputs where 'foo' is the name of
+the function.
+"""
+
+from __future__ import print_function
+import sys
+import os
+import itertools
+
+# Macro definitions for functions that take no arguments.  For functions
+# that take arguments, the STRUCT_TEMPLATE, ARGS_TEMPLATE and
+# VARIANTS_TEMPLATE are used instead.
+DEFINES_TEMPLATE = '''
+#define CALL_BENCH_FUNC(v, i) %(func)s ()
+#define NUM_VARIANTS (1)
+#define NUM_SAMPLES(v) (1)
+#define VARIANT(v) FUNCNAME "()"
+'''
+
+# Structures to store arguments for the function call.  A function may
+# have its inputs partitioned to represent distinct performance
+# characteristics or distinct flavors of the function.  Each such
+# variant is represented by the _VARIANT structure.  The ARGS structure
+# represents a single set of arguments.
+STRUCT_TEMPLATE = '''
+#define CALL_BENCH_FUNC(v, i) %(func)s (%(func_args)s)
+
+struct args
+{
+%(args)s
+};
+
+struct _variants
+{
+  const char *name;
+  int count;
+  struct args *in;
+};
+'''
+
+# The actual input arguments.
+ARGS_TEMPLATE = '''
+struct args in%(argnum)d[%(num_args)d] = {
+%(args)s
+};
+'''
+
+# The actual variants, along with macros defined to access the variants.
+VARIANTS_TEMPLATE = '''
+struct _variants variants[%(num_variants)d] = {
+%(variants)s
+};
+
+#define NUM_VARIANTS %(num_variants)d
+#define NUM_SAMPLES(i) (variants[i].count)
+#define VARIANT(i) (variants[i].name)
+'''
+
+# Epilogue for the generated source file.
+EPILOGUE = '''
+#define BENCH_FUNC(i, j) ({%(getret)s CALL_BENCH_FUNC (i, j);})
+#define FUNCNAME "%(func)s"
+#include "bench-skeleton.c"'''
+
+
+def gen_source(func, directives, all_vals):
+    """Generate source for the function
+
+    Generate the C source for the function from the values and
+    directives.
+
+    Args:
+      func: The function name
+      directives: A dictionary of directives applicable to this function
+      all_vals: A dictionary input values
+    """
+    # The includes go in first.
+    for header in directives['includes']:
+        print('#include <%s>' % header)
+
+    for header in directives['include-sources']:
+        print('#include "%s"' % header)
+
+    # Print macros.  This branches out to a separate routine if
+    # the function takes arguments.
+    if not directives['args']:
+        print(DEFINES_TEMPLATE % {'func': func})
+        outargs = []
+    else:
+        outargs = _print_arg_data(func, directives, all_vals)
+
+    # Print the output variable definitions if necessary.
+    for out in outargs:
+        print(out)
+
+    # If we have a return value from the function, make sure it is
+    # assigned to prevent the compiler from optimizing out the
+    # call.
+    if directives['ret']:
+        print('static %s volatile ret;' % directives['ret'])
+        getret = 'ret = '
+    else:
+        getret = ''
+
+    print(EPILOGUE % {'getret': getret, 'func': func})
+
+
+def _print_arg_data(func, directives, all_vals):
+    """Print argument data
+
+    This is a helper function for gen_source that prints structure and
+    values for arguments and their variants and returns output arguments
+    if any are found.
+
+    Args:
+      func: Function name
+      directives: A dictionary of directives applicable to this function
+      all_vals: A dictionary input values
+
+    Returns:
+      Returns a list of definitions for function arguments that act as
+      output parameters.
+    """
+    # First, all of the definitions.  We process writing of
+    # CALL_BENCH_FUNC, struct args and also the output arguments
+    # together in a single traversal of the arguments list.
+    func_args = []
+    arg_struct = []
+    outargs = []
+
+    for arg, i in zip(directives['args'], itertools.count()):
+        if arg[0] == '<' and arg[-1] == '>':
+            pos = arg.rfind('*')
+            if pos == -1:
+                die('Output argument must be a pointer type')
+
+            outargs.append('static %s out%d;' % (arg[1:pos], i))
+            func_args.append(' &out%d' % i)
+        else:
+            arg_struct.append('  %s volatile arg%d;' % (arg, i))
+            func_args.append('variants[v].in[i].arg%d' % i)
+
+    print(STRUCT_TEMPLATE % {'args' : '\n'.join(arg_struct), 'func': func,
+                             'func_args': ', '.join(func_args)})
+
+    # Now print the values.
+    variants = []
+    for (k, vals), i in zip(all_vals.items(), itertools.count()):
+        out = ['  {%s},' % v for v in vals]
+
+        # Members for the variants structure list that we will
+        # print later.
+        variants.append('  {"%s(%s)", %d, in%d},' % (func, k, len(vals), i))
+        print(ARGS_TEMPLATE % {'argnum': i, 'num_args': len(vals),
+                               'args': '\n'.join(out)})
+
+    # Print the variants and the last set of macros.
+    print(VARIANTS_TEMPLATE % {'num_variants': len(all_vals),
+                               'variants': '\n'.join(variants)})
+    return outargs
+
+
+def _process_directive(d_name, d_val):
+    """Process a directive.
+
+    Evaluate the directive name and value passed and return the
+    processed value. This is a helper function for parse_file.
+
+    Args:
+      d_name: Name of the directive
+      d_value: The string value to process
+
+    Returns:
+      The processed value, which may be the string as it is or an object
+      that describes the directive.
+    """
+    # Process the directive values if necessary.  name and ret don't
+    # need any processing.
+    if d_name.startswith('include'):
+        d_val = d_val.split(',')
+    elif d_name == 'args':
+        d_val = d_val.split(':')
+
+    # Return the values.
+    return d_val
+
+
+def parse_file(func):
+    """Parse an input file
+
+    Given a function name, open and parse an input file for the function
+    and get the necessary parameters for the generated code and the list
+    of inputs.
+
+    Args:
+      func: The function name
+
+    Returns:
+      A tuple of two elements, one a dictionary of directives and the
+      other a dictionary of all input values.
+    """
+    all_vals = {}
+    # Valid directives.
+    directives = {
+            'name': '',
+            'args': [],
+            'includes': [],
+            'include-sources': [],
+            'ret': ''
+    }
+
+    try:
+        with open('%s-inputs' % func) as f:
+            for line in f:
+                # Look for directives and parse it if found.
+                if line.startswith('##'):
+                    try:
+                        d_name, d_val = line[2:].split(':', 1)
+                        d_name = d_name.strip()
+                        d_val = d_val.strip()
+                        directives[d_name] = _process_directive(d_name, d_val)
+                    except (IndexError, KeyError):
+                        die('Invalid directive: %s' % line[2:])
+
+                # Skip blank lines and comments.
+                line = line.split('#', 1)[0].rstrip()
+                if not line:
+                    continue
+
+                # Otherwise, we're an input.  Add to the appropriate
+                # input set.
+                cur_name = directives['name']
+                all_vals.setdefault(cur_name, [])
+                all_vals[cur_name].append(line)
+    except IOError as ex:
+        die("Failed to open input file (%s): %s" % (ex.filename, ex.strerror))
+
+    return directives, all_vals
+
+
+def die(msg):
+    """Exit with an error
+
+    Prints an error message to the standard error stream and exits with
+    a non-zero status.
+
+    Args:
+      msg: The error message to print to standard error.
+    """
+    print('%s\n' % msg, file=sys.stderr)
+    sys.exit(os.EX_DATAERR)
+
+
+def main(args):
+    """Main function
+
+    Use the first command line argument as function name and parse its
+    input file to generate C source that calls the function repeatedly
+    for the input.
+
+    Args:
+      args: The command line arguments with the program name dropped.
+
+    Returns:
+      os.EX_USAGE on error and os.EX_OK on success.
+    """
+    if len(args) != 1:
+        print('Usage: %s <function>' % sys.argv[0])
+        return os.EX_USAGE
+
+    directives, all_vals = parse_file(args[0])
+    gen_source(args[0], directives, all_vals)
+    return os.EX_OK
+
+
+if __name__ == '__main__':
+    sys.exit(main(sys.argv[1:]))
diff --git a/scripts/pylint b/scripts/pylint
new file mode 100755
index 0000000..49a775e
--- /dev/null
+++ b/scripts/pylint
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Simple wrapper around the pylint program that uses the pylintrc file to
+# validate the source code in files passed on command line.
+
+exec pylint --rcfile "${0%/*}/pylintrc" "$@"
diff --git a/scripts/pylintrc b/scripts/pylintrc
new file mode 100644
index 0000000..a05ddfd
--- /dev/null
+++ b/scripts/pylintrc
@@ -0,0 +1,274 @@
+[MASTER]
+
+# Specify a configuration file.
+#rcfile=
+
+# Python code to execute, usually for sys.path manipulation such as
+# pygtk.require().
+#init-hook=
+
+# Profiled execution.
+profile=no
+
+# Add files or directories to the blacklist. They should be base names, not
+# paths.
+ignore=CVS
+
+# Pickle collected data for later comparisons.
+persistent=yes
+
+# List of plugins (as comma separated values of python modules names) to load,
+# usually to register additional checkers.
+load-plugins=
+
+
+[MESSAGES CONTROL]
+
+# Enable the message, report, category or checker with the given id(s). You can
+# either give multiple identifier separated by comma (,) or put this option
+# multiple time. See also the "--disable" option for examples.
+#enable=
+
+# Disable the message, report, category or checker with the given id(s). You
+# can either give multiple identifiers separated by comma (,) or put this
+# option multiple times (only on the command line, not in the configuration
+# file where it should appear only once).You can also use "--disable=all" to
+# disable everything first and then reenable specific checks. For example, if
+# you want to run only the similarities checker, you can use "--disable=all
+# --enable=similarities". If you want to run only the classes checker, but have
+# no Warning level messages displayed, use"--disable=all --enable=classes
+# --disable=W"
+#disable=
+
+
+[REPORTS]
+
+# Set the output format. Available formats are text, parseable, colorized, msvs
+# (visual studio) and html. You can also give a reporter class, eg
+# mypackage.mymodule.MyReporterClass.
+output-format=text
+
+# Put messages in a separate file for each module / package specified on the
+# command line instead of printing them on stdout. Reports (if any) will be
+# written in a file name "pylint_global.[txt|html]".
+files-output=no
+
+# Tells whether to display a full report or only the messages
+reports=yes
+
+# Python expression which should return a note less than 10 (10 is the highest
+# note). You have access to the variables errors warning, statement which
+# respectively contain the number of errors / warnings messages and the total
+# number of statements analyzed. This is used by the global evaluation report
+# (RP0004).
+evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
+
+# Add a comment according to your evaluation note. This is used by the global
+# evaluation report (RP0004).
+comment=no
+
+# Template used to display messages. This is a python new-style format string
+# used to format the massage information. See doc for all details
+#msg-template=
+
+
+[MISCELLANEOUS]
+
+# List of note tags to take in consideration, separated by a comma.
+notes=FIXME,XXX,TODO
+
+
+[SIMILARITIES]
+
+# Minimum lines number of a similarity.
+min-similarity-lines=4
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+# Ignore imports when computing similarities.
+ignore-imports=no
+
+
+[BASIC]
+
+# Required attributes for module, separated by a comma
+required-attributes=
+
+# List of builtins function names that should not be used, separated by a comma
+bad-functions=map,filter,apply,input
+
+# Regular expression which should only match correct module names
+module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
+
+# Regular expression which should only match correct module level names
+const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
+
+# Regular expression which should only match correct class names
+class-rgx=[A-Z_][a-zA-Z0-9]+$
+
+# Regular expression which should only match correct function names
+function-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression which should only match correct method names
+method-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression which should only match correct instance attribute names
+attr-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression which should only match correct argument names
+argument-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression which should only match correct variable names
+variable-rgx=[a-z_][a-z0-9_]{2,30}$
+
+# Regular expression which should only match correct attribute names in class
+# bodies
+class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
+
+# Regular expression which should only match correct list comprehension /
+# generator expression variable names
+inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
+
+# Good variable names which should always be accepted, separated by a comma
+# f is a useful name for a file descriptor
+good-names=f,i,j,k,ex,Run,_
+
+# Bad variable names which should always be refused, separated by a comma
+bad-names=foo,bar,baz,toto,tutu,tata
+
+# Regular expression which should only match function or class names that do
+# not require a docstring.
+no-docstring-rgx=__.*__
+
+# Minimum line length for functions/classes that require docstrings, shorter
+# ones are exempt.
+docstring-min-length=-1
+
+
+[VARIABLES]
+
+# Tells whether we should check for unused import in __init__ files.
+init-import=no
+
+# A regular expression matching the beginning of the name of dummy variables
+# (i.e. not used).
+dummy-variables-rgx=_$|dummy
+
+# List of additional names supposed to be defined in builtins. Remember that
+# you should avoid to define new builtins when possible.
+additional-builtins=
+
+
+[FORMAT]
+
+# Maximum number of characters on a single line.
+max-line-length=79
+
+# Regexp for a line that is allowed to be longer than the limit.
+ignore-long-lines=^\s*(# )?<?https?://\S+>?$
+
+# Maximum number of lines in a module
+max-module-lines=1000
+
+# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
+# tab).
+indent-string='    '
+
+
+[TYPECHECK]
+
+# Tells whether missing members accessed in mixin class should be ignored. A
+# mixin class is detected if its name ends with "mixin" (case insensitive).
+ignore-mixin-members=yes
+
+# List of classes names for which member attributes should not be checked
+# (useful for classes with attributes dynamically set).
+ignored-classes=SQLObject
+
+# When zope mode is activated, add a predefined set of Zope acquired attributes
+# to generated-members.
+zope=no
+
+# List of members which are set dynamically and missed by pylint inference
+# system, and so shouldn't trigger E0201 when accessed. Python regular
+# expressions are accepted.
+generated-members=REQUEST,acl_users,aq_parent
+
+
+[CLASSES]
+
+# List of interface methods to ignore, separated by a comma. This is used for
+# instance to not check methods defines in Zope's Interface base class.
+ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
+
+# List of method names used to declare (i.e. assign) instance attributes.
+defining-attr-methods=__init__,__new__,setUp
+
+# List of valid names for the first argument in a class method.
+valid-classmethod-first-arg=cls
+
+# List of valid names for the first argument in a metaclass class method.
+valid-metaclass-classmethod-first-arg=mcs
+
+
+[IMPORTS]
+
+# Deprecated modules which should not be used, separated by a comma
+deprecated-modules=regsub,TERMIOS,Bastion,rexec
+
+# Create a graph of every (i.e. internal and external) dependencies in the
+# given file (report RP0402 must not be disabled)
+import-graph=
+
+# Create a graph of external dependencies in the given file (report RP0402 must
+# not be disabled)
+ext-import-graph=
+
+# Create a graph of internal dependencies in the given file (report RP0402 must
+# not be disabled)
+int-import-graph=
+
+
+[DESIGN]
+
+# Maximum number of arguments for function / method
+max-args=5
+
+# Argument names that match this expression will be ignored. Default to name
+# with leading underscore
+ignored-argument-names=_.*
+
+# Maximum number of locals for function / method body
+max-locals=15
+
+# Maximum number of return / yield for function / method body
+max-returns=6
+
+# Maximum number of branch for function / method body
+max-branches=12
+
+# Maximum number of statements in function / method body
+max-statements=50
+
+# Maximum number of parents for a class (see R0901).
+max-parents=7
+
+# Maximum number of attributes for a class (see R0902).
+max-attributes=7
+
+# Minimum number of public methods for a class (see R0903).
+min-public-methods=2
+
+# Maximum number of public methods for a class (see R0904).
+max-public-methods=20
+
+
+[EXCEPTIONS]
+
+# Exceptions that will emit a warning when being caught. Defaults to
+# "Exception"
+overgeneral-exceptions=Exception

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=dfc6b49d92b1db3eb2ad7ea116fddaf750bfc0b1

commit dfc6b49d92b1db3eb2ad7ea116fddaf750bfc0b1
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date:   Tue Oct 8 16:36:19 2013 +0530

    TMP: probes for math functions
    
    Temporary probes at various branch points in the functions.

diff --git a/sysdeps/ieee754/dbl-64/e_asin.c b/sysdeps/ieee754/dbl-64/e_asin.c
index 5bb5aeb..d425fd7 100644
--- a/sysdeps/ieee754/dbl-64/e_asin.c
+++ b/sysdeps/ieee754/dbl-64/e_asin.c
@@ -40,17 +40,18 @@
 #include "MathLib.h"
 #include "uasncs.h"
 #include <math_private.h>
+#include <stap-probe.h>
 
 #ifndef SECTION
 # define SECTION
 #endif
 
-void __doasin(double x, double dx, double w[]);
-void __dubsin(double x, double dx, double v[]);
-void __dubcos(double x, double dx, double v[]);
-void __docos(double x, double dx, double v[]);
-double __sin32(double x, double res, double res1);
-double __cos32(double x, double res, double res1);
+void __doasin (double x, double dx, double w[]);
+void __dubsin (double x, double dx, double v[]);
+void __dubcos (double x, double dx, double v[]);
+void __docos (double x, double dx, double v[]);
+double __sin32 (double x, double res, double res1);
+double __cos32 (double x, double res, double res1);
 
 /***************************************************************************/
 /* An ultimate asin routine. Given an IEEE double machine number x         */
@@ -58,584 +59,1044 @@ double __cos32(double x, double res, double res1);
 /***************************************************************************/
 double
 SECTION
-__ieee754_asin(double x){
-  double x1,x2,xx,s1,s2,res1,p,t,res,r,cor,cc,y,c,z,w[2];
-  mynumber u,v;
-  int4 k,m,n;
+__ieee754_asin (double x)
+{
+  double x1, x2, xx, s1, s2, res1, p, t, res, r, cor, cc, y, c, z, w[2];
+  mynumber u, v;
+  int4 k, m, n;
 
   u.x = x;
   m = u.i[HIGH_HALF];
-  k = 0x7fffffff&m;              /* no sign */
+  k = 0x7fffffff & m;		/* no sign */
 
-  if (k < 0x3e500000) return x;  /* for x->0 => sin(x)=x */
+  if (k < 0x3e500000)
+    return x;			/* for x->0 => sin(x)=x */
   /*----------------------2^-26 <= |x| < 2^ -3    -----------------*/
-  else
-  if (k < 0x3fc00000) {
-    x2 = x*x;
-    t = (((((f6*x2 + f5)*x2 + f4)*x2 + f3)*x2 + f2)*x2 + f1)*(x2*x);
-    res = x+t;         /*  res=arcsin(x) according to Taylor series  */
-    cor = (x-res)+t;
-    if (res == res+1.025*cor) return res;
-    else {
-      x1 = x+big;
-      xx = x*x;
-      x1 -= big;
-      x2 = x - x1;
-      p = x1*x1*x1;
-      s1 = a1.x*p;
-      s2 = ((((((c7*xx + c6)*xx + c5)*xx + c4)*xx + c3)*xx + c2)*xx*xx*x +
-	     ((a1.x+a2.x)*x2*x2+ 0.5*x1*x)*x2) + a2.x*p;
-      res1 = x+s1;
-      s2 = ((x-res1)+s1)+s2;
-      res = res1+s2;
-      cor = (res1-res)+s2;
-      if (res == res+1.00014*cor) return res;
-      else {
-	__doasin(x,0,w);
-	if (w[0]==(w[0]+1.00000001*w[1])) return w[0];
-	else {
-	  y=ABS(x);
-	  res=ABS(w[0]);
-	  res1=ABS(w[0]+1.1*w[1]);
-	  return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1);
-	}
-      }
+  else if (k < 0x3fc00000)
+    {
+      x2 = x * x;
+      t =
+	(((((f6 * x2 + f5) * x2 + f4) * x2 + f3) * x2 + f2) * x2 +
+	 f1) * (x2 * x);
+      res = x + t;		/*  res=arcsin(x) according to Taylor series  */
+      cor = (x - res) + t;
+      if (res == res + 1.025 * cor)
+        {
+	  LIBC_PROBE (asin_probe, 2, 1, &x);
+	  return res;
+	}
+      else
+	{
+	  x1 = x + big;
+	  xx = x * x;
+	  x1 -= big;
+	  x2 = x - x1;
+	  p = x1 * x1 * x1;
+	  s1 = a1.x * p;
+	  s2 =
+	    ((((((c7 * xx + c6) * xx + c5) * xx + c4) * xx + c3) * xx +
+	      c2) * xx * xx * x + ((a1.x + a2.x) * x2 * x2 +
+				   0.5 * x1 * x) * x2) + a2.x * p;
+	  res1 = x + s1;
+	  s2 = ((x - res1) + s1) + s2;
+	  res = res1 + s2;
+	  cor = (res1 - res) + s2;
+	  if (res == res + 1.00014 * cor)
+	    {
+	  LIBC_PROBE (asin_probe, 2, 2, &x);
+	    return res;
+	    }
+	  else
+	    {
+	      __doasin (x, 0, w);
+	      if (w[0] == (w[0] + 1.00000001 * w[1]))
+	      {
+	  LIBC_PROBE (asin_probe, 2, 3, &x);
+		return w[0];
+		}
+	      else
+		{
+		  y = ABS (x);
+		  res = ABS (w[0]);
+		  res1 = ABS (w[0] + 1.1 * w[1]);
+		  return (m > 0) ? __sin32 (y, res, res1) : -__sin32 (y, res,
+								      res1);
+		}
+	    }
+	}
     }
-  }
   /*---------------------0.125 <= |x| < 0.5 -----------------------------*/
-  else if (k < 0x3fe00000) {
-    if (k<0x3fd00000) n = 11*((k&0x000fffff)>>15);
-    else n = 11*((k&0x000fffff)>>14)+352;
-    if (m>0) xx = x - asncs.x[n];
-    else xx = -x - asncs.x[n];
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+xx*(asncs.x[n+5]
-     +xx*asncs.x[n+6]))))+asncs.x[n+7];
-    t+=p;
-    res =asncs.x[n+8] +t;
-    cor = (asncs.x[n+8]-res)+t;
-    if (res == res+1.05*cor) return (m>0)?res:-res;
-    else {
-      r=asncs.x[n+8]+xx*asncs.x[n+9];
-      t=((asncs.x[n+8]-r)+xx*asncs.x[n+9])+(p+xx*asncs.x[n+10]);
-      res = r+t;
-      cor = (r-res)+t;
-      if (res == res+1.0005*cor) return (m>0)?res:-res;
-      else {
-	res1=res+1.1*cor;
-	z=0.5*(res1-res);
-	__dubsin(res,z,w);
-	z=(w[0]-ABS(x))+w[1];
-	if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1);
-	else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1);
-	else {
-	  y=ABS(x);
-	  return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1);
-	}
-      }
-    }
-  }    /*   else  if (k < 0x3fe00000)    */
+  else if (k < 0x3fe00000)
+    {
+      if (k < 0x3fd00000)
+	n = 11 * ((k & 0x000fffff) >> 15);
+      else
+	n = 11 * ((k & 0x000fffff) >> 14) + 352;
+      if (m > 0)
+	xx = x - asncs.x[n];
+      else
+	xx = -x - asncs.x[n];
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * asncs.x[n + 6])))) + asncs.x[n + 7];
+      t += p;
+      res = asncs.x[n + 8] + t;
+      cor = (asncs.x[n + 8] - res) + t;
+      if (res == res + 1.05 * cor)
+{
+	  LIBC_PROBE (asin_probe, 2, 4, &x);
+	return (m > 0) ? res : -res;
+	}
+      else
+	{
+	  r = asncs.x[n + 8] + xx * asncs.x[n + 9];
+	  t =
+	    ((asncs.x[n + 8] - r) + xx * asncs.x[n + 9]) + (p +
+							    xx * asncs.x[n +
+									 10]);
+	  res = r + t;
+	  cor = (r - res) + t;
+	  if (res == res + 1.0005 * cor)
+	  {
+	  LIBC_PROBE (asin_probe, 2, 5, &x);
+	    return (m > 0) ? res : -res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      __dubsin (res, z, w);
+	      z = (w[0] - ABS (x)) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 6, &x);
+		return (m > 0) ? min (res, res1) : -min (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 7, &x);
+		return (m > 0) ? max (res, res1) : -max (res, res1);
+		}
+	      else
+		{
+		  y = ABS (x);
+		  return (m > 0) ? __sin32 (y, res, res1) : -__sin32 (y, res,
+								      res1);
+		}
+	    }
+	}
+    }				/*   else  if (k < 0x3fe00000)    */
   /*-------------------- 0.5 <= |x| < 0.75 -----------------------------*/
-  else
-  if (k < 0x3fe80000) {
-    n = 1056+((k&0x000fe000)>>11)*3;
-    if (m>0) xx = x - asncs.x[n];
-    else xx = -x - asncs.x[n];
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+xx*(asncs.x[n+5]
-	   +xx*(asncs.x[n+6]+xx*asncs.x[n+7])))))+asncs.x[n+8];
-    t+=p;
-    res =asncs.x[n+9] +t;
-    cor = (asncs.x[n+9]-res)+t;
-    if (res == res+1.01*cor) return (m>0)?res:-res;
-    else {
-      r=asncs.x[n+9]+xx*asncs.x[n+10];
-      t=((asncs.x[n+9]-r)+xx*asncs.x[n+10])+(p+xx*asncs.x[n+11]);
-      res = r+t;
-      cor = (r-res)+t;
-      if (res == res+1.0005*cor) return (m>0)?res:-res;
-      else {
-	res1=res+1.1*cor;
-	z=0.5*(res1-res);
-	__dubsin(res,z,w);
-	z=(w[0]-ABS(x))+w[1];
-	if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1);
-	else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1);
-	else {
-	  y=ABS(x);
-	  return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1);
-	}
-      }
-    }
-  }    /*   else  if (k < 0x3fe80000)    */
+  else if (k < 0x3fe80000)
+    {
+      n = 1056 + ((k & 0x000fe000) >> 11) * 3;
+      if (m > 0)
+	xx = x - asncs.x[n];
+      else
+	xx = -x - asncs.x[n];
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * (asncs.x[n + 6] +
+					   xx * asncs.x[n + 7]))))) +
+	asncs.x[n + 8];
+      t += p;
+      res = asncs.x[n + 9] + t;
+      cor = (asncs.x[n + 9] - res) + t;
+      if (res == res + 1.01 * cor)
+      {
+	  LIBC_PROBE (asin_probe, 2, 8, &x);
+	return (m > 0) ? res : -res;
+	}
+      else
+	{
+	  r = asncs.x[n + 9] + xx * asncs.x[n + 10];
+	  t =
+	    ((asncs.x[n + 9] - r) + xx * asncs.x[n + 10]) + (p +
+							     xx * asncs.x[n +
+									  11]);
+	  res = r + t;
+	  cor = (r - res) + t;
+	  if (res == res + 1.0005 * cor)
+	  {
+	  LIBC_PROBE (asin_probe, 2, 9, &x);
+	    return (m > 0) ? res : -res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      __dubsin (res, z, w);
+	      z = (w[0] - ABS (x)) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 10, &x);
+		return (m > 0) ? min (res, res1) : -min (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 11, &x);
+		return (m > 0) ? max (res, res1) : -max (res, res1);
+		}
+	      else
+		{
+		  y = ABS (x);
+		  return (m > 0) ? __sin32 (y, res, res1) : -__sin32 (y, res,
+								      res1);
+		}
+	    }
+	}
+    }				/*   else  if (k < 0x3fe80000)    */
   /*--------------------- 0.75 <= |x|< 0.921875 ----------------------*/
-  else
-  if (k < 0x3fed8000) {
-    n = 992+((k&0x000fe000)>>13)*13;
-    if (m>0) xx = x - asncs.x[n];
-    else xx = -x - asncs.x[n];
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+xx*(asncs.x[n+5]
-     +xx*(asncs.x[n+6]+xx*(asncs.x[n+7]+xx*asncs.x[n+8]))))))+asncs.x[n+9];
-    t+=p;
-    res =asncs.x[n+10] +t;
-    cor = (asncs.x[n+10]-res)+t;
-    if (res == res+1.01*cor) return (m>0)?res:-res;
-    else {
-      r=asncs.x[n+10]+xx*asncs.x[n+11];
-      t=((asncs.x[n+10]-r)+xx*asncs.x[n+11])+(p+xx*asncs.x[n+12]);
-      res = r+t;
-      cor = (r-res)+t;
-      if (res == res+1.0008*cor) return (m>0)?res:-res;
-      else {
-	res1=res+1.1*cor;
-	z=0.5*(res1-res);
-	y=hp0.x-res;
-	z=((hp0.x-y)-res)+(hp1.x-z);
-	__dubcos(y,z,w);
-	z=(w[0]-ABS(x))+w[1];
-	if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1);
-	else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1);
-	else {
-	  y=ABS(x);
-	  return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1);
-	}
-      }
-    }
-  }    /*   else  if (k < 0x3fed8000)    */
+  else if (k < 0x3fed8000)
+    {
+      n = 992 + ((k & 0x000fe000) >> 13) * 13;
+      if (m > 0)
+	xx = x - asncs.x[n];
+      else
+	xx = -x - asncs.x[n];
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * (asncs.x[n + 6] +
+					   xx * (asncs.x[n + 7] +
+						 xx * asncs.x[n + 8])))))) +
+	asncs.x[n + 9];
+      t += p;
+      res = asncs.x[n + 10] + t;
+      cor = (asncs.x[n + 10] - res) + t;
+      if (res == res + 1.01 * cor)
+      {
+	  LIBC_PROBE (asin_probe, 2, 12, &x);
+	return (m > 0) ? res : -res;
+	}
+      else
+	{
+	  r = asncs.x[n + 10] + xx * asncs.x[n + 11];
+	  t =
+	    ((asncs.x[n + 10] - r) + xx * asncs.x[n + 11]) + (p +
+							      xx * asncs.x[n +
+									   12]);
+	  res = r + t;
+	  cor = (r - res) + t;
+	  if (res == res + 1.0008 * cor)
+	  {
+	  LIBC_PROBE (asin_probe, 2, 13, &x);
+	    return (m > 0) ? res : -res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      y = hp0.x - res;
+	      z = ((hp0.x - y) - res) + (hp1.x - z);
+	      __dubcos (y, z, w);
+	      z = (w[0] - ABS (x)) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 14, &x);
+		return (m > 0) ? min (res, res1) : -min (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 15, &x);
+		return (m > 0) ? max (res, res1) : -max (res, res1);
+		}
+	      else
+		{
+		  y = ABS (x);
+		  return (m > 0) ? __sin32 (y, res, res1) : -__sin32 (y, res,
+								      res1);
+		}
+	    }
+	}
+    }				/*   else  if (k < 0x3fed8000)    */
   /*-------------------0.921875 <= |x| < 0.953125 ------------------------*/
-  else
-  if (k < 0x3fee8000) {
-    n = 884+((k&0x000fe000)>>13)*14;
-    if (m>0) xx = x - asncs.x[n];
-    else xx = -x - asncs.x[n];
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
-		      xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
-		      +xx*(asncs.x[n+7]+xx*(asncs.x[n+8]+
-		      xx*asncs.x[n+9])))))))+asncs.x[n+10];
-    t+=p;
-    res =asncs.x[n+11] +t;
-    cor = (asncs.x[n+11]-res)+t;
-    if (res == res+1.01*cor) return (m>0)?res:-res;
-    else {
-      r=asncs.x[n+11]+xx*asncs.x[n+12];
-      t=((asncs.x[n+11]-r)+xx*asncs.x[n+12])+(p+xx*asncs.x[n+13]);
-      res = r+t;
-      cor = (r-res)+t;
-      if (res == res+1.0007*cor) return (m>0)?res:-res;
-      else {
-	res1=res+1.1*cor;
-	z=0.5*(res1-res);
-	y=(hp0.x-res)-z;
-	z=y+hp1.x;
-	y=(y-z)+hp1.x;
-	__dubcos(z,y,w);
-	z=(w[0]-ABS(x))+w[1];
-	if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1);
-	else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1);
-	else {
-	  y=ABS(x);
-	  return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1);
-	}
-      }
-    }
-  }    /*   else  if (k < 0x3fee8000)    */
+  else if (k < 0x3fee8000)
+    {
+      n = 884 + ((k & 0x000fe000) >> 13) * 14;
+      if (m > 0)
+	xx = x - asncs.x[n];
+      else
+	xx = -x - asncs.x[n];
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * (asncs.x[n + 6] +
+					   xx * (asncs.x[n + 7] +
+						 xx * (asncs.x[n + 8] +
+						       xx * asncs.x[n +
+								    9])))))))
+	+ asncs.x[n + 10];
+      t += p;
+      res = asncs.x[n + 11] + t;
+      cor = (asncs.x[n + 11] - res) + t;
+      if (res == res + 1.01 * cor)
+      {
+	  LIBC_PROBE (asin_probe, 2, 16, &x);
+	return (m > 0) ? res : -res;
+	}
+      else
+	{
+	  r = asncs.x[n + 11] + xx * asncs.x[n + 12];
+	  t =
+	    ((asncs.x[n + 11] - r) + xx * asncs.x[n + 12]) + (p +
+							      xx * asncs.x[n +
+									   13]);
+	  res = r + t;
+	  cor = (r - res) + t;
+	  if (res == res + 1.0007 * cor)
+	  {
+	  LIBC_PROBE (asin_probe, 2, 17, &x);
+	    return (m > 0) ? res : -res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      y = (hp0.x - res) - z;
+	      z = y + hp1.x;
+	      y = (y - z) + hp1.x;
+	      __dubcos (z, y, w);
+	      z = (w[0] - ABS (x)) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 18, &x);
+		return (m > 0) ? min (res, res1) : -min (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 19, &x);
+		return (m > 0) ? max (res, res1) : -max (res, res1);
+		}
+	      else
+		{
+		  y = ABS (x);
+		  return (m > 0) ? __sin32 (y, res, res1) : -__sin32 (y, res,
+								      res1);
+		}
+	    }
+	}
+    }				/*   else  if (k < 0x3fee8000)    */
 
   /*--------------------0.953125 <= |x| < 0.96875 ------------------------*/
-  else
-  if (k < 0x3fef0000) {
-    n = 768+((k&0x000fe000)>>13)*15;
-    if (m>0) xx = x - asncs.x[n];
-    else xx = -x - asncs.x[n];
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
-			 xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
-			 +xx*(asncs.x[n+7]+xx*(asncs.x[n+8]+
-		    xx*(asncs.x[n+9]+xx*asncs.x[n+10]))))))))+asncs.x[n+11];
-    t+=p;
-    res =asncs.x[n+12] +t;
-    cor = (asncs.x[n+12]-res)+t;
-    if (res == res+1.01*cor) return (m>0)?res:-res;
-    else {
-      r=asncs.x[n+12]+xx*asncs.x[n+13];
-      t=((asncs.x[n+12]-r)+xx*asncs.x[n+13])+(p+xx*asncs.x[n+14]);
-      res = r+t;
-      cor = (r-res)+t;
-      if (res == res+1.0007*cor) return (m>0)?res:-res;
-      else {
-	res1=res+1.1*cor;
-	z=0.5*(res1-res);
-	y=(hp0.x-res)-z;
-	z=y+hp1.x;
-	y=(y-z)+hp1.x;
-	__dubcos(z,y,w);
-	z=(w[0]-ABS(x))+w[1];
-	if (z>1.0e-27) return (m>0)?min(res,res1):-min(res,res1);
-	else if (z<-1.0e-27) return (m>0)?max(res,res1):-max(res,res1);
-	else {
-	  y=ABS(x);
-	  return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1);
-	}
-      }
-    }
-  }    /*   else  if (k < 0x3fef0000)    */
+  else if (k < 0x3fef0000)
+    {
+      n = 768 + ((k & 0x000fe000) >> 13) * 15;
+      if (m > 0)
+	xx = x - asncs.x[n];
+      else
+	xx = -x - asncs.x[n];
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * (asncs.x[n + 6] +
+					   xx * (asncs.x[n + 7] +
+						 xx * (asncs.x[n + 8] +
+						       xx * (asncs.x[n + 9] +
+							     xx * asncs.x[n +
+									  10]))))))))
+	+ asncs.x[n + 11];
+      t += p;
+      res = asncs.x[n + 12] + t;
+      cor = (asncs.x[n + 12] - res) + t;
+      if (res == res + 1.01 * cor)
+      {
+	  LIBC_PROBE (asin_probe, 2, 20, &x);
+	return (m > 0) ? res : -res;
+	}
+      else
+	{
+	  r = asncs.x[n + 12] + xx * asncs.x[n + 13];
+	  t =
+	    ((asncs.x[n + 12] - r) + xx * asncs.x[n + 13]) + (p +
+							      xx * asncs.x[n +
+									   14]);
+	  res = r + t;
+	  cor = (r - res) + t;
+	  if (res == res + 1.0007 * cor)
+	  {
+	  LIBC_PROBE (asin_probe, 2, 21, &x);
+	    return (m > 0) ? res : -res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      y = (hp0.x - res) - z;
+	      z = y + hp1.x;
+	      y = (y - z) + hp1.x;
+	      __dubcos (z, y, w);
+	      z = (w[0] - ABS (x)) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 22, &x);
+		return (m > 0) ? min (res, res1) : -min (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (asin_probe, 2, 23, &x);
+		return (m > 0) ? max (res, res1) : -max (res, res1);
+		}
+	      else
+		{
+		  y = ABS (x);
+		  return (m > 0) ? __sin32 (y, res, res1) : -__sin32 (y, res,
+								      res1);
+		}
+	    }
+	}
+    }				/*   else  if (k < 0x3fef0000)    */
   /*--------------------0.96875 <= |x| < 1 --------------------------------*/
-  else
-  if (k<0x3ff00000)  {
-    z = 0.5*((m>0)?(1.0-x):(1.0+x));
-    v.x=z;
-    k=v.i[HIGH_HALF];
-    t=inroot[(k&0x001fffff)>>14]*powtwo[511-(k>>21)];
-    r=1.0-t*t*z;
-    t = t*(rt0+r*(rt1+r*(rt2+r*rt3)));
-    c=t*z;
-    t=c*(1.5-0.5*t*c);
-    y=(c+t24)-t24;
-    cc = (z-y*y)/(t+y);
-    p=(((((f6*z+f5)*z+f4)*z+f3)*z+f2)*z+f1)*z;
-    cor = (hp1.x - 2.0*cc)-2.0*(y+cc)*p;
-    res1 = hp0.x - 2.0*y;
-    res =res1 + cor;
-    if (res == res+1.003*((res1-res)+cor)) return (m>0)?res:-res;
-    else {
-      c=y+cc;
-      cc=(y-c)+cc;
-      __doasin(c,cc,w);
-      res1=hp0.x-2.0*w[0];
-      cor=((hp0.x-res1)-2.0*w[0])+(hp1.x-2.0*w[1]);
-      res = res1+cor;
-      cor = (res1-res)+cor;
-      if (res==(res+1.0000001*cor)) return (m>0)?res:-res;
-      else {
-	y=ABS(x);
-	res1=res+1.1*cor;
-	return (m>0)?__sin32(y,res,res1):-__sin32(y,res,res1);
-      }
-    }
-  }    /*   else  if (k < 0x3ff00000)    */
+  else if (k < 0x3ff00000)
+    {
+      z = 0.5 * ((m > 0) ? (1.0 - x) : (1.0 + x));
+      v.x = z;
+      k = v.i[HIGH_HALF];
+      t = inroot[(k & 0x001fffff) >> 14] * powtwo[511 - (k >> 21)];
+      r = 1.0 - t * t * z;
+      t = t * (rt0 + r * (rt1 + r * (rt2 + r * rt3)));
+      c = t * z;
+      t = c * (1.5 - 0.5 * t * c);
+      y = (c + t24) - t24;
+      cc = (z - y * y) / (t + y);
+      p = (((((f6 * z + f5) * z + f4) * z + f3) * z + f2) * z + f1) * z;
+      cor = (hp1.x - 2.0 * cc) - 2.0 * (y + cc) * p;
+      res1 = hp0.x - 2.0 * y;
+      res = res1 + cor;
+      if (res == res + 1.003 * ((res1 - res) + cor))
+      {
+	  LIBC_PROBE (asin_probe, 2, 24, &x);
+	return (m > 0) ? res : -res;
+	}
+      else
+	{
+	  c = y + cc;
+	  cc = (y - c) + cc;
+	  __doasin (c, cc, w);
+	  res1 = hp0.x - 2.0 * w[0];
+	  cor = ((hp0.x - res1) - 2.0 * w[0]) + (hp1.x - 2.0 * w[1]);
+	  res = res1 + cor;
+	  cor = (res1 - res) + cor;
+	  if (res == (res + 1.0000001 * cor))
+	  {
+	  LIBC_PROBE (asin_probe, 2, 25, &x);
+	    return (m > 0) ? res : -res;
+	    }
+	  else
+	    {
+	      y = ABS (x);
+	      res1 = res + 1.1 * cor;
+	      return (m > 0) ? __sin32 (y, res, res1) : -__sin32 (y, res,
+								  res1);
+	    }
+	}
+    }				/*   else  if (k < 0x3ff00000)    */
   /*---------------------------- |x|>=1 -------------------------------*/
-  else if (k==0x3ff00000 && u.i[LOW_HALF]==0) return (m>0)?hp0.x:-hp0.x;
+  else if (k == 0x3ff00000 && u.i[LOW_HALF] == 0)
+    return (m > 0) ? hp0.x : -hp0.x;
+  else if (k > 0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0))
+    return x;
   else
-  if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x;
-  else {
-    u.i[HIGH_HALF]=0x7ff00000;
-    v.i[HIGH_HALF]=0x7ff00000;
-    u.i[LOW_HALF]=0;
-    v.i[LOW_HALF]=0;
-    return u.x/v.x;  /* NaN */
- }
+    {
+      u.i[HIGH_HALF] = 0x7ff00000;
+      v.i[HIGH_HALF] = 0x7ff00000;
+      u.i[LOW_HALF] = 0;
+      v.i[LOW_HALF] = 0;
+      return u.x / v.x;		/* NaN */
+    }
 }
+
 #ifndef __ieee754_asin
 strong_alias (__ieee754_asin, __asin_finite)
 #endif
-
 /*******************************************************************/
 /*                                                                 */
 /*         End of arcsine,  below is arccosine                     */
 /*                                                                 */
 /*******************************************************************/
-
 double
 SECTION
-__ieee754_acos(double x)
+__ieee754_acos (double x)
 {
-  double x1,x2,xx,s1,s2,res1,p,t,res,r,cor,cc,y,c,z,w[2],eps;
-  mynumber u,v;
-  int4 k,m,n;
+  double x1, x2, xx, s1, s2, res1, p, t, res, r, cor, cc, y, c, z, w[2], eps;
+  mynumber u, v;
+  int4 k, m, n;
   u.x = x;
   m = u.i[HIGH_HALF];
-  k = 0x7fffffff&m;
+  k = 0x7fffffff & m;
   /*-------------------  |x|<2.77556*10^-17 ----------------------*/
-  if (k < 0x3c880000) return hp0.x;
+  if (k < 0x3c880000)
+    return hp0.x;
 
   /*-----------------  2.77556*10^-17 <= |x| < 2^-3 --------------*/
-  else
-  if (k < 0x3fc00000) {
-    x2 = x*x;
-    t = (((((f6*x2 + f5)*x2 + f4)*x2 + f3)*x2 + f2)*x2 + f1)*(x2*x);
-    r=hp0.x-x;
-    cor=(((hp0.x-r)-x)+hp1.x)-t;
-    res = r+cor;
-    cor = (r-res)+cor;
-    if (res == res+1.004*cor) return res;
-    else {
-      x1 = x+big;
-      xx = x*x;
-      x1 -= big;
-      x2 = x - x1;
-      p = x1*x1*x1;
-      s1 = a1.x*p;
-      s2 = ((((((c7*xx + c6)*xx + c5)*xx + c4)*xx + c3)*xx + c2)*xx*xx*x +
-	    ((a1.x+a2.x)*x2*x2+ 0.5*x1*x)*x2) + a2.x*p;
-      res1 = x+s1;
-      s2 = ((x-res1)+s1)+s2;
-      r=hp0.x-res1;
-      cor=(((hp0.x-r)-res1)+hp1.x)-s2;
-      res = r+cor;
-      cor = (r-res)+cor;
-      if (res == res+1.00004*cor) return res;
-      else {
-	__doasin(x,0,w);
-	r=hp0.x-w[0];
-	cor=((hp0.x-r)-w[0])+(hp1.x-w[1]);
-	res=r+cor;
-	cor=(r-res)+cor;
-	if (res ==(res +1.00000001*cor)) return res;
-	else {
-	  res1=res+1.1*cor;
-	  return __cos32(x,res,res1);
-	}
-      }
-    }
-  }    /*   else  if (k < 0x3fc00000)    */
+  else if (k < 0x3fc00000)
+    {
+      x2 = x * x;
+      t =
+	(((((f6 * x2 + f5) * x2 + f4) * x2 + f3) * x2 + f2) * x2 +
+	 f1) * (x2 * x);
+      r = hp0.x - x;
+      cor = (((hp0.x - r) - x) + hp1.x) - t;
+      res = r + cor;
+      cor = (r - res) + cor;
+      if (res == res + 1.004 * cor)
+      {
+	  LIBC_PROBE (acos_probe, 2, 1, &x);
+	return res;
+	}
+      else
+	{
+	  x1 = x + big;
+	  xx = x * x;
+	  x1 -= big;
+	  x2 = x - x1;
+	  p = x1 * x1 * x1;
+	  s1 = a1.x * p;
+	  s2 =
+	    ((((((c7 * xx + c6) * xx + c5) * xx + c4) * xx + c3) * xx +
+	      c2) * xx * xx * x + ((a1.x + a2.x) * x2 * x2 +
+				   0.5 * x1 * x) * x2) + a2.x * p;
+	  res1 = x + s1;
+	  s2 = ((x - res1) + s1) + s2;
+	  r = hp0.x - res1;
+	  cor = (((hp0.x - r) - res1) + hp1.x) - s2;
+	  res = r + cor;
+	  cor = (r - res) + cor;
+	  if (res == res + 1.00004 * cor)
+	  {
+	  LIBC_PROBE (acos_probe, 2, 2, &x);
+	    return res;
+	    }
+	  else
+	    {
+	      __doasin (x, 0, w);
+	      r = hp0.x - w[0];
+	      cor = ((hp0.x - r) - w[0]) + (hp1.x - w[1]);
+	      res = r + cor;
+	      cor = (r - res) + cor;
+	      if (res == (res + 1.00000001 * cor))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 3, &x);
+		return res;
+		}
+	      else
+		{
+		  res1 = res + 1.1 * cor;
+		  return __cos32 (x, res, res1);
+		}
+	    }
+	}
+    }				/*   else  if (k < 0x3fc00000)    */
   /*----------------------  0.125 <= |x| < 0.5 --------------------*/
-  else
-  if (k < 0x3fe00000) {
-    if (k<0x3fd00000) n = 11*((k&0x000fffff)>>15);
-    else n = 11*((k&0x000fffff)>>14)+352;
-    if (m>0) xx = x - asncs.x[n];
-    else xx = -x - asncs.x[n];
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
-		   xx*(asncs.x[n+5]+xx*asncs.x[n+6]))))+asncs.x[n+7];
-    t+=p;
-    y = (m>0)?(hp0.x-asncs.x[n+8]):(hp0.x+asncs.x[n+8]);
-    t = (m>0)?(hp1.x-t):(hp1.x+t);
-    res = y+t;
-    if (res == res+1.02*((y-res)+t)) return res;
-    else {
-      r=asncs.x[n+8]+xx*asncs.x[n+9];
-      t=((asncs.x[n+8]-r)+xx*asncs.x[n+9])+(p+xx*asncs.x[n+10]);
-      if (m>0)
-	{p = hp0.x-r; t = (((hp0.x-p)-r)-t)+hp1.x; }
+  else if (k < 0x3fe00000)
+    {
+      if (k < 0x3fd00000)
+	n = 11 * ((k & 0x000fffff) >> 15);
       else
-	{p = hp0.x+r; t = ((hp0.x-p)+r)+(hp1.x+t); }
-      res = p+t;
-      cor = (p-res)+t;
-      if (res == (res+1.0002*cor)) return res;
-      else {
-	res1=res+1.1*cor;
-	z=0.5*(res1-res);
-	__docos(res,z,w);
-	z=(w[0]-x)+w[1];
-	if (z>1.0e-27) return max(res,res1);
-	else if (z<-1.0e-27) return min(res,res1);
-	else return __cos32(x,res,res1);
-      }
-    }
-  }    /*   else  if (k < 0x3fe00000)    */
+	n = 11 * ((k & 0x000fffff) >> 14) + 352;
+      if (m > 0)
+	xx = x - asncs.x[n];
+      else
+	xx = -x - asncs.x[n];
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * asncs.x[n + 6])))) + asncs.x[n + 7];
+      t += p;
+      y = (m > 0) ? (hp0.x - asncs.x[n + 8]) : (hp0.x + asncs.x[n + 8]);
+      t = (m > 0) ? (hp1.x - t) : (hp1.x + t);
+      res = y + t;
+      if (res == res + 1.02 * ((y - res) + t))
+      {
+	  LIBC_PROBE (acos_probe, 2, 4, &x);
+	return res;
+	}
+      else
+	{
+	  r = asncs.x[n + 8] + xx * asncs.x[n + 9];
+	  t =
+	    ((asncs.x[n + 8] - r) + xx * asncs.x[n + 9]) + (p +
+							    xx * asncs.x[n +
+									 10]);
+	  if (m > 0)
+	    {
+	      p = hp0.x - r;
+	      t = (((hp0.x - p) - r) - t) + hp1.x;
+	    }
+	  else
+	    {
+	      p = hp0.x + r;
+	      t = ((hp0.x - p) + r) + (hp1.x + t);
+	    }
+	  res = p + t;
+	  cor = (p - res) + t;
+	  if (res == (res + 1.0002 * cor))
+	  {
+	  LIBC_PROBE (acos_probe, 2, 5, &x);
+	    return res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      __docos (res, z, w);
+	      z = (w[0] - x) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 6, &x);
+		return max (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 7, &x);
+		return min (res, res1);
+		}
+	      else
+		return __cos32 (x, res, res1);
+	    }
+	}
+    }				/*   else  if (k < 0x3fe00000)    */
 
   /*--------------------------- 0.5 <= |x| < 0.75 ---------------------*/
-  else
-  if (k < 0x3fe80000) {
-    n = 1056+((k&0x000fe000)>>11)*3;
-    if (m>0) {xx = x - asncs.x[n]; eps=1.04; }
-    else {xx = -x - asncs.x[n]; eps=1.02; }
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
-		   xx*(asncs.x[n+5]+xx*(asncs.x[n+6]+
-		   xx*asncs.x[n+7])))))+asncs.x[n+8];
-    t+=p;
-   y = (m>0)?(hp0.x-asncs.x[n+9]):(hp0.x+asncs.x[n+9]);
-   t = (m>0)?(hp1.x-t):(hp1.x+t);
-   res = y+t;
-   if (res == res+eps*((y-res)+t)) return res;
-   else {
-     r=asncs.x[n+9]+xx*asncs.x[n+10];
-     t=((asncs.x[n+9]-r)+xx*asncs.x[n+10])+(p+xx*asncs.x[n+11]);
-     if (m>0) {p = hp0.x-r; t = (((hp0.x-p)-r)-t)+hp1.x; eps=1.0004; }
-     else   {p = hp0.x+r; t = ((hp0.x-p)+r)+(hp1.x+t); eps=1.0002; }
-     res = p+t;
-     cor = (p-res)+t;
-     if (res == (res+eps*cor)) return res;
-     else {
-       res1=res+1.1*cor;
-       z=0.5*(res1-res);
-       __docos(res,z,w);
-       z=(w[0]-x)+w[1];
-       if (z>1.0e-27) return max(res,res1);
-       else if (z<-1.0e-27) return min(res,res1);
-       else return __cos32(x,res,res1);
-     }
-   }
-  }    /*   else  if (k < 0x3fe80000)    */
+  else if (k < 0x3fe80000)
+    {
+      n = 1056 + ((k & 0x000fe000) >> 11) * 3;
+      if (m > 0)
+	{
+	  xx = x - asncs.x[n];
+	  eps = 1.04;
+	}
+      else
+	{
+	  xx = -x - asncs.x[n];
+	  eps = 1.02;
+	}
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * (asncs.x[n + 6] +
+					   xx * asncs.x[n + 7]))))) +
+	asncs.x[n + 8];
+      t += p;
+      y = (m > 0) ? (hp0.x - asncs.x[n + 9]) : (hp0.x + asncs.x[n + 9]);
+      t = (m > 0) ? (hp1.x - t) : (hp1.x + t);
+      res = y + t;
+      if (res == res + eps * ((y - res) + t))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 8, &x);
+	return res;
+	}
+      else
+	{
+	  r = asncs.x[n + 9] + xx * asncs.x[n + 10];
+	  t =
+	    ((asncs.x[n + 9] - r) + xx * asncs.x[n + 10]) + (p +
+							     xx * asncs.x[n +
+									  11]);
+	  if (m > 0)
+	    {
+	      p = hp0.x - r;
+	      t = (((hp0.x - p) - r) - t) + hp1.x;
+	      eps = 1.0004;
+	    }
+	  else
+	    {
+	      p = hp0.x + r;
+	      t = ((hp0.x - p) + r) + (hp1.x + t);
+	      eps = 1.0002;
+	    }
+	  res = p + t;
+	  cor = (p - res) + t;
+	  if (res == (res + eps * cor))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 9, &x);
+	    return res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      __docos (res, z, w);
+	      z = (w[0] - x) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 10, &x);
+		return max (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 11, &x);
+		return min (res, res1);
+		}
+	      else
+		return __cos32 (x, res, res1);
+	    }
+	}
+    }				/*   else  if (k < 0x3fe80000)    */
 
 /*------------------------- 0.75 <= |x| < 0.921875 -------------*/
-  else
-  if (k < 0x3fed8000) {
-    n = 992+((k&0x000fe000)>>13)*13;
-    if (m>0) {xx = x - asncs.x[n]; eps = 1.04; }
-    else {xx = -x - asncs.x[n]; eps = 1.01; }
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
-		      xx*(asncs.x[n+5]+xx*(asncs.x[n+6]+xx*(asncs.x[n+7]+
-		      xx*asncs.x[n+8]))))))+asncs.x[n+9];
-    t+=p;
-    y = (m>0)?(hp0.x-asncs.x[n+10]):(hp0.x+asncs.x[n+10]);
-    t = (m>0)?(hp1.x-t):(hp1.x+t);
-    res = y+t;
-    if (res == res+eps*((y-res)+t)) return res;
-    else {
-      r=asncs.x[n+10]+xx*asncs.x[n+11];
-      t=((asncs.x[n+10]-r)+xx*asncs.x[n+11])+(p+xx*asncs.x[n+12]);
-      if (m>0) {p = hp0.x-r; t = (((hp0.x-p)-r)-t)+hp1.x; eps=1.0032; }
-      else   {p = hp0.x+r; t = ((hp0.x-p)+r)+(hp1.x+t); eps=1.0008; }
-      res = p+t;
-      cor = (p-res)+t;
-      if (res == (res+eps*cor)) return res;
-      else {
-	res1=res+1.1*cor;
-	z=0.5*(res1-res);
-	__docos(res,z,w);
-	z=(w[0]-x)+w[1];
-	if (z>1.0e-27) return max(res,res1);
-	else if (z<-1.0e-27) return min(res,res1);
-	else return __cos32(x,res,res1);
-      }
-    }
-  }    /*   else  if (k < 0x3fed8000)    */
+  else if (k < 0x3fed8000)
+    {
+      n = 992 + ((k & 0x000fe000) >> 13) * 13;
+      if (m > 0)
+	{
+	  xx = x - asncs.x[n];
+	  eps = 1.04;
+	}
+      else
+	{
+	  xx = -x - asncs.x[n];
+	  eps = 1.01;
+	}
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * (asncs.x[n + 6] +
+					   xx * (asncs.x[n + 7] +
+						 xx * asncs.x[n + 8])))))) +
+	asncs.x[n + 9];
+      t += p;
+      y = (m > 0) ? (hp0.x - asncs.x[n + 10]) : (hp0.x + asncs.x[n + 10]);
+      t = (m > 0) ? (hp1.x - t) : (hp1.x + t);
+      res = y + t;
+      if (res == res + eps * ((y - res) + t))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 12, &x);
+	return res;
+	}
+      else
+	{
+	  r = asncs.x[n + 10] + xx * asncs.x[n + 11];
+	  t =
+	    ((asncs.x[n + 10] - r) + xx * asncs.x[n + 11]) + (p +
+							      xx * asncs.x[n +
+									   12]);
+	  if (m > 0)
+	    {
+	      p = hp0.x - r;
+	      t = (((hp0.x - p) - r) - t) + hp1.x;
+	      eps = 1.0032;
+	    }
+	  else
+	    {
+	      p = hp0.x + r;
+	      t = ((hp0.x - p) + r) + (hp1.x + t);
+	      eps = 1.0008;
+	    }
+	  res = p + t;
+	  cor = (p - res) + t;
+	  if (res == (res + eps * cor))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 13, &x);
+	    return res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      __docos (res, z, w);
+	      z = (w[0] - x) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 14, &x);
+		return max (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 15, &x);
+		return min (res, res1);
+		}
+	      else
+		return __cos32 (x, res, res1);
+	    }
+	}
+    }				/*   else  if (k < 0x3fed8000)    */
 
 /*-------------------0.921875 <= |x| < 0.953125 ------------------*/
-  else
-  if (k < 0x3fee8000) {
-    n = 884+((k&0x000fe000)>>13)*14;
-    if (m>0) {xx = x - asncs.x[n]; eps=1.04; }
-    else {xx = -x - asncs.x[n]; eps =1.005; }
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
-		   xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
-		   +xx*(asncs.x[n+7]+xx*(asncs.x[n+8]+
-		   xx*asncs.x[n+9])))))))+asncs.x[n+10];
-    t+=p;
-    y = (m>0)?(hp0.x-asncs.x[n+11]):(hp0.x+asncs.x[n+11]);
-    t = (m>0)?(hp1.x-t):(hp1.x+t);
-    res = y+t;
-    if (res == res+eps*((y-res)+t)) return res;
-    else {
-      r=asncs.x[n+11]+xx*asncs.x[n+12];
-      t=((asncs.x[n+11]-r)+xx*asncs.x[n+12])+(p+xx*asncs.x[n+13]);
-      if (m>0) {p = hp0.x-r; t = (((hp0.x-p)-r)-t)+hp1.x; eps=1.0030; }
-      else   {p = hp0.x+r; t = ((hp0.x-p)+r)+(hp1.x+t); eps=1.0005; }
-      res = p+t;
-      cor = (p-res)+t;
-      if (res == (res+eps*cor)) return res;
-      else {
-	res1=res+1.1*cor;
-	z=0.5*(res1-res);
-	__docos(res,z,w);
-	z=(w[0]-x)+w[1];
-	if (z>1.0e-27) return max(res,res1);
-	else if (z<-1.0e-27) return min(res,res1);
-	else return __cos32(x,res,res1);
-      }
-    }
-  }    /*   else  if (k < 0x3fee8000)    */
+  else if (k < 0x3fee8000)
+    {
+      n = 884 + ((k & 0x000fe000) >> 13) * 14;
+      if (m > 0)
+	{
+	  xx = x - asncs.x[n];
+	  eps = 1.04;
+	}
+      else
+	{
+	  xx = -x - asncs.x[n];
+	  eps = 1.005;
+	}
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * (asncs.x[n + 6] +
+					   xx * (asncs.x[n + 7] +
+						 xx * (asncs.x[n + 8] +
+						       xx * asncs.x[n +
+								    9])))))))
+	+ asncs.x[n + 10];
+      t += p;
+      y = (m > 0) ? (hp0.x - asncs.x[n + 11]) : (hp0.x + asncs.x[n + 11]);
+      t = (m > 0) ? (hp1.x - t) : (hp1.x + t);
+      res = y + t;
+      if (res == res + eps * ((y - res) + t))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 16, &x);
+	return res;
+	}
+      else
+	{
+	  r = asncs.x[n + 11] + xx * asncs.x[n + 12];
+	  t =
+	    ((asncs.x[n + 11] - r) + xx * asncs.x[n + 12]) + (p +
+							      xx * asncs.x[n +
+									   13]);
+	  if (m > 0)
+	    {
+	      p = hp0.x - r;
+	      t = (((hp0.x - p) - r) - t) + hp1.x;
+	      eps = 1.0030;
+	    }
+	  else
+	    {
+	      p = hp0.x + r;
+	      t = ((hp0.x - p) + r) + (hp1.x + t);
+	      eps = 1.0005;
+	    }
+	  res = p + t;
+	  cor = (p - res) + t;
+	  if (res == (res + eps * cor))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 17, &x);
+	    return res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      __docos (res, z, w);
+	      z = (w[0] - x) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 18, &x);
+		return max (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 19, &x);
+		return min (res, res1);
+		}
+	      else
+		return __cos32 (x, res, res1);
+	    }
+	}
+    }				/*   else  if (k < 0x3fee8000)    */
 
   /*--------------------0.953125 <= |x| < 0.96875 ----------------*/
-  else
-  if (k < 0x3fef0000) {
-    n = 768+((k&0x000fe000)>>13)*15;
-    if (m>0) {xx = x - asncs.x[n]; eps=1.04; }
-    else {xx = -x - asncs.x[n]; eps=1.005;}
-    t = asncs.x[n+1]*xx;
-    p=xx*xx*(asncs.x[n+2]+xx*(asncs.x[n+3]+xx*(asncs.x[n+4]+
-	    xx*(asncs.x[n+5]+xx*(asncs.x[n+6]
-	    +xx*(asncs.x[n+7]+xx*(asncs.x[n+8]+xx*(asncs.x[n+9]+
-	    xx*asncs.x[n+10]))))))))+asncs.x[n+11];
-    t+=p;
-    y = (m>0)?(hp0.x-asncs.x[n+12]):(hp0.x+asncs.x[n+12]);
-   t = (m>0)?(hp1.x-t):(hp1.x+t);
-   res = y+t;
-   if (res == res+eps*((y-res)+t)) return res;
-   else {
-     r=asncs.x[n+12]+xx*asncs.x[n+13];
-     t=((asncs.x[n+12]-r)+xx*asncs.x[n+13])+(p+xx*asncs.x[n+14]);
-     if (m>0) {p = hp0.x-r; t = (((hp0.x-p)-r)-t)+hp1.x; eps=1.0030; }
-     else   {p = hp0.x+r; t = ((hp0.x-p)+r)+(hp1.x+t); eps=1.0005; }
-     res = p+t;
-     cor = (p-res)+t;
-     if (res == (res+eps*cor)) return res;
-     else {
-       res1=res+1.1*cor;
-       z=0.5*(res1-res);
-       __docos(res,z,w);
-       z=(w[0]-x)+w[1];
-       if (z>1.0e-27) return max(res,res1);
-       else if (z<-1.0e-27) return min(res,res1);
-       else return __cos32(x,res,res1);
-     }
-   }
-  }    /*   else  if (k < 0x3fef0000)    */
+  else if (k < 0x3fef0000)
+    {
+      n = 768 + ((k & 0x000fe000) >> 13) * 15;
+      if (m > 0)
+	{
+	  xx = x - asncs.x[n];
+	  eps = 1.04;
+	}
+      else
+	{
+	  xx = -x - asncs.x[n];
+	  eps = 1.005;
+	}
+      t = asncs.x[n + 1] * xx;
+      p =
+	xx * xx * (asncs.x[n + 2] +
+		   xx * (asncs.x[n + 3] +
+			 xx * (asncs.x[n + 4] +
+			       xx * (asncs.x[n + 5] +
+				     xx * (asncs.x[n + 6] +
+					   xx * (asncs.x[n + 7] +
+						 xx * (asncs.x[n + 8] +
+						       xx * (asncs.x[n + 9] +
+							     xx * asncs.x[n +
+									  10]))))))))
+	+ asncs.x[n + 11];
+      t += p;
+      y = (m > 0) ? (hp0.x - asncs.x[n + 12]) : (hp0.x + asncs.x[n + 12]);
+      t = (m > 0) ? (hp1.x - t) : (hp1.x + t);
+      res = y + t;
+      if (res == res + eps * ((y - res) + t))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 20, &x);
+	return res;
+	}
+      else
+	{
+	  r = asncs.x[n + 12] + xx * asncs.x[n + 13];
+	  t =
+	    ((asncs.x[n + 12] - r) + xx * asncs.x[n + 13]) + (p +
+							      xx * asncs.x[n +
+									   14]);
+	  if (m > 0)
+	    {
+	      p = hp0.x - r;
+	      t = (((hp0.x - p) - r) - t) + hp1.x;
+	      eps = 1.0030;
+	    }
+	  else
+	    {
+	      p = hp0.x + r;
+	      t = ((hp0.x - p) + r) + (hp1.x + t);
+	      eps = 1.0005;
+	    }
+	  res = p + t;
+	  cor = (p - res) + t;
+	  if (res == (res + eps * cor))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 21, &x);
+	    return res;
+	    }
+	  else
+	    {
+	      res1 = res + 1.1 * cor;
+	      z = 0.5 * (res1 - res);
+	      __docos (res, z, w);
+	      z = (w[0] - x) + w[1];
+	      if (z > 1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 22, &x);
+		return max (res, res1);
+		}
+	      else if (z < -1.0e-27)
+	      {
+	  LIBC_PROBE (acos_probe, 2, 23, &x);
+		return min (res, res1);
+		}
+	      else
+		return __cos32 (x, res, res1);
+	    }
+	}
+    }				/*   else  if (k < 0x3fef0000)    */
   /*-----------------0.96875 <= |x| < 1 ---------------------------*/
 
-  else
-  if (k<0x3ff00000)  {
-    z = 0.5*((m>0)?(1.0-x):(1.0+x));
-    v.x=z;
-    k=v.i[HIGH_HALF];
-    t=inroot[(k&0x001fffff)>>14]*powtwo[511-(k>>21)];
-    r=1.0-t*t*z;
-    t = t*(rt0+r*(rt1+r*(rt2+r*rt3)));
-    c=t*z;
-    t=c*(1.5-0.5*t*c);
-    y = (t27*c+c)-t27*c;
-    cc = (z-y*y)/(t+y);
-    p=(((((f6*z+f5)*z+f4)*z+f3)*z+f2)*z+f1)*z;
-    if (m<0) {
-      cor = (hp1.x - cc)-(y+cc)*p;
-      res1 = hp0.x - y;
-      res =res1 + cor;
-      if (res == res+1.002*((res1-res)+cor)) return (res+res);
-      else {
-	c=y+cc;
-	cc=(y-c)+cc;
-	__doasin(c,cc,w);
-	res1=hp0.x-w[0];
-	cor=((hp0.x-res1)-w[0])+(hp1.x-w[1]);
-	res = res1+cor;
-	cor = (res1-res)+cor;
-	if (res==(res+1.000001*cor)) return (res+res);
-	else {
-	  res=res+res;
-	  res1=res+1.2*cor;
-	  return __cos32(x,res,res1);
-	}
-      }
-    }
-    else {
-      cor = cc+p*(y+cc);
-      res = y + cor;
-      if (res == res+1.03*((y-res)+cor)) return (res+res);
-      else {
-	c=y+cc;
-	cc=(y-c)+cc;
-	__doasin(c,cc,w);
-	res = w[0];
-	cor=w[1];
-	if (res==(res+1.000001*cor)) return (res+res);
-	else {
-	  res=res+res;
-	  res1=res+1.2*cor;
-	  return __cos32(x,res,res1);
-	}
-      }
-    }
-  }    /*   else  if (k < 0x3ff00000)    */
+  else if (k < 0x3ff00000)
+    {
+      z = 0.5 * ((m > 0) ? (1.0 - x) : (1.0 + x));
+      v.x = z;
+      k = v.i[HIGH_HALF];
+      t = inroot[(k & 0x001fffff) >> 14] * powtwo[511 - (k >> 21)];
+      r = 1.0 - t * t * z;
+      t = t * (rt0 + r * (rt1 + r * (rt2 + r * rt3)));
+      c = t * z;
+      t = c * (1.5 - 0.5 * t * c);
+      y = (t27 * c + c) - t27 * c;
+      cc = (z - y * y) / (t + y);
+      p = (((((f6 * z + f5) * z + f4) * z + f3) * z + f2) * z + f1) * z;
+      if (m < 0)
+	{
+	  cor = (hp1.x - cc) - (y + cc) * p;
+	  res1 = hp0.x - y;
+	  res = res1 + cor;
+	  if (res == res + 1.002 * ((res1 - res) + cor))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 24, &x);
+	    return (res + res);
+	    }
+	  else
+	    {
+	      c = y + cc;
+	      cc = (y - c) + cc;
+	      __doasin (c, cc, w);
+	      res1 = hp0.x - w[0];
+	      cor = ((hp0.x - res1) - w[0]) + (hp1.x - w[1]);
+	      res = res1 + cor;
+	      cor = (res1 - res) + cor;
+	      if (res == (res + 1.000001 * cor))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 25, &x);
+		return (res + res);
+		}
+	      else
+		{
+		  res = res + res;
+		  res1 = res + 1.2 * cor;
+		  return __cos32 (x, res, res1);
+		}
+	    }
+	}
+      else
+	{
+	  cor = cc + p * (y + cc);
+	  res = y + cor;
+	  if (res == res + 1.03 * ((y - res) + cor))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 26, &x);
+	    return (res + res);
+	    }
+	  else
+	    {
+	      c = y + cc;
+	      cc = (y - c) + cc;
+	      __doasin (c, cc, w);
+	      res = w[0];
+	      cor = w[1];
+	      if (res == (res + 1.000001 * cor))
+	      {
+	  LIBC_PROBE (acos_probe, 2, 27, &x);
+		return (res + res);
+		}
+	      else
+		{
+		  res = res + res;
+		  res1 = res + 1.2 * cor;
+		  return __cos32 (x, res, res1);
+		}
+	    }
+	}
+    }				/*   else  if (k < 0x3ff00000)    */
 
   /*---------------------------- |x|>=1 -----------------------*/
+  else if (k == 0x3ff00000 && u.i[LOW_HALF] == 0)
+    return (m > 0) ? 0 : 2.0 * hp0.x;
+  else if (k > 0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0))
+    return x;
   else
-  if (k==0x3ff00000 && u.i[LOW_HALF]==0) return (m>0)?0:2.0*hp0.x;
-  else
-  if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x;
-  else {
-    u.i[HIGH_HALF]=0x7ff00000;
-    v.i[HIGH_HALF]=0x7ff00000;
-    u.i[LOW_HALF]=0;
-    v.i[LOW_HALF]=0;
-    return u.x/v.x;
-  }
+    {
+      u.i[HIGH_HALF] = 0x7ff00000;
+      v.i[HIGH_HALF] = 0x7ff00000;
+      u.i[LOW_HALF] = 0;
+      v.i[LOW_HALF] = 0;
+      return u.x / v.x;
+    }
 }
+
 #ifndef __ieee754_acos
 strong_alias (__ieee754_acos, __acos_finite)
 #endif
diff --git a/sysdeps/ieee754/dbl-64/e_atanh.c b/sysdeps/ieee754/dbl-64/e_atanh.c
index 0f96743..0cb5c34 100644
--- a/sysdeps/ieee754/dbl-64/e_atanh.c
+++ b/sysdeps/ieee754/dbl-64/e_atanh.c
@@ -38,6 +38,7 @@
 #include <inttypes.h>
 #include <math.h>
 #include <math_private.h>
+#include <stap-probe.h>
 
 static const double huge = 1e300;
 
@@ -56,9 +57,13 @@ __ieee754_atanh (double x)
 
       t = xa + xa;
       t = 0.5 * __log1p (t + t * xa / (1.0 - xa));
+      LIBC_PROBE (atanh_probe, 2, 1, &x);
     }
   else if (__glibc_likely (isless (xa, 1.0)))
+  {
+    LIBC_PROBE (atanh_probe, 2, 2, &x);
     t = 0.5 * __log1p ((xa + xa) / (1.0 - xa));
+    }
   else
     {
       if (isgreater (xa, 1.0))
diff --git a/sysdeps/ieee754/dbl-64/e_cosh.c b/sysdeps/ieee754/dbl-64/e_cosh.c
index 6caf943..798591d 100644
--- a/sysdeps/ieee754/dbl-64/e_cosh.c
+++ b/sysdeps/ieee754/dbl-64/e_cosh.c
@@ -33,6 +33,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <stap-probe.h>
 
 static const double one = 1.0, half = 0.5, huge = 1.0e300;
 
@@ -55,11 +56,13 @@ __ieee754_cosh (double x)
 	{
 	  t = __expm1 (fabs (x));
 	  w = one + t;
+	  LIBC_PROBE (cosh_probe, 2, 1, &x);
 	  if (ix < 0x3c800000)
 	    return w;                                   /* cosh(tiny) = 1 */
 	  return one + (t * t) / (w + w);
 	}
 
+	  LIBC_PROBE (cosh_probe, 2, 2, &x);
       /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
       t = __ieee754_exp (fabs (x));
       return half * t + half / t;
@@ -67,7 +70,10 @@ __ieee754_cosh (double x)
 
   /* |x| in [22, log(maxdouble)] return half*exp(|x|) */
   if (ix < 0x40862e42)
+  {
+	  LIBC_PROBE (cosh_probe, 2, 3, &x);
     return half * __ieee754_exp (fabs (x));
+    }
 
   /* |x| in [log(maxdouble), overflowthresold] */
   GET_LOW_WORD (lx, x);
@@ -75,6 +81,7 @@ __ieee754_cosh (double x)
     {
       w = __ieee754_exp (half * fabs (x));
       t = half * w;
+	  LIBC_PROBE (cosh_probe, 2, 4, &x);
       return t * w;
     }
 
diff --git a/sysdeps/ieee754/dbl-64/e_pow.c b/sysdeps/ieee754/dbl-64/e_pow.c
index 1c5f4b3..4664f7d 100644
--- a/sysdeps/ieee754/dbl-64/e_pow.c
+++ b/sysdeps/ieee754/dbl-64/e_pow.c
@@ -42,6 +42,7 @@
 #include "upow.tbl"
 #include <math_private.h>
 #include <fenv.h>
+#include <stap-probe.h>
 
 #ifndef SECTION
 # define SECTION
@@ -65,6 +66,7 @@ __ieee754_pow (double x, double y)
   double z, a, aa, error, t, a1, a2, y1, y2;
   mynumber u, v;
   int k;
+  int retcode = -1;
   int4 qx, qy;
   v.x = y;
   u.x = x;
@@ -110,7 +112,16 @@ __ieee754_pow (double x, double y)
       a2 = (a - a1) + aa;
       error = error * ABS (y);
       t = __exp1 (a1, a2, 1.9e16 * error);	/* return -10 or 0 if wasn't computed exactly */
-      retval = (t > 0) ? t : power1 (x, y);
+      if (t > 0)
+        {
+	  retval = t;
+      retcode = 1;
+      LIBC_PROBE (pow_probe, 3, &x, &y, &retcode);
+	}
+      else
+        {
+	  retval = power1 (x, y);
+	}
 
       return retval;
     }
@@ -140,6 +151,8 @@ __ieee754_pow (double x, double y)
   /* if x<0 */
   if (u.i[HIGH_HALF] < 0)
     {
+      retcode = 2;
+      LIBC_PROBE (pow_probe, 3, &x, &y, &retcode);
       k = checkint (y);
       if (k == 0)
 	{
@@ -199,6 +212,7 @@ static double
 SECTION
 power1 (double x, double y)
 {
+  int retcode = 3;
   double z, a, aa, error, t, a1, a2, y1, y2;
   z = my_log2 (x, &aa, &error);
   t = y * CN;
@@ -213,7 +227,13 @@ power1 (double x, double y)
   a2 = (a - a1) + aa;
   error = error * ABS (y);
   t = __exp1 (a1, a2, 1.9e16 * error);
-  return (t >= 0) ? t : __slowpow (x, y, z);
+  if (t >= 0)
+    {
+      LIBC_PROBE (pow_probe, 3, &x, &y, &retcode);
+      return t;
+    }
+  else
+    return __slowpow (x, y, z);
 }
 
 /* Compute log(x) (x is left argument). The result is the returned double + the
diff --git a/sysdeps/ieee754/dbl-64/e_sinh.c b/sysdeps/ieee754/dbl-64/e_sinh.c
index 4ff28bf..3482edf 100644
--- a/sysdeps/ieee754/dbl-64/e_sinh.c
+++ b/sysdeps/ieee754/dbl-64/e_sinh.c
@@ -34,6 +34,7 @@ static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $";
 
 #include <math.h>
 #include <math_private.h>
+#include <stap-probe.h>
 
 static const double one = 1.0, shuge = 1.0e307;
 
@@ -63,6 +64,7 @@ __ieee754_sinh (double x)
 	  return x;
       /* sinh(tiny) = tiny with inexact */
       t = __expm1 (fabs (x));
+	  LIBC_PROBE (sinh_probe, 2, 1, &x);
       if (ix < 0x3ff00000)
 	return h * (2.0 * t - t * t / (t + one));
       return h * (t + t / (t + one));
@@ -70,12 +72,16 @@ __ieee754_sinh (double x)
 
   /* |x| in [22, log(maxdouble)] return 0.5*exp(|x|) */
   if (ix < 0x40862e42)
+  {
+	  LIBC_PROBE (sinh_probe, 2, 2, &x);
     return h * __ieee754_exp (fabs (x));
+    }
 
   /* |x| in [log(maxdouble), overflowthresold] */
   GET_LOW_WORD (lx, x);
   if (ix < 0x408633ce || ((ix == 0x408633ce) && (lx <= (u_int32_t) 0x8fb9f87d)))
     {
+	  LIBC_PROBE (sinh_probe, 2, 3, &x);
       w = __ieee754_exp (0.5 * fabs (x));
       t = h * w;
       return t * w;
diff --git a/sysdeps/ieee754/dbl-64/s_asinh.c b/sysdeps/ieee754/dbl-64/s_asinh.c
index a33758d..b6e7d95 100644
--- a/sysdeps/ieee754/dbl-64/s_asinh.c
+++ b/sysdeps/ieee754/dbl-64/s_asinh.c
@@ -23,6 +23,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <stap-probe.h>
 
 static const double
   one = 1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
@@ -46,6 +47,7 @@ __asinh (double x)
       if (ix >= 0x7ff00000)
 	return x + x;                           /* x is inf or NaN */
       w = __ieee754_log (fabs (x)) + ln2;
+      LIBC_PROBE (asinh_probe, 2, 1, &x);
     }
   else
     {
@@ -54,11 +56,13 @@ __asinh (double x)
 	{
 	  w = __ieee754_log (2.0 * xa + one / (__ieee754_sqrt (xa * xa + one) +
               xa));
+	  LIBC_PROBE (asinh_probe, 2, 2, &x);
 	}
       else                      /* 2.0 > |x| > 2**-28 */
 	{
 	  double t = xa * xa;
 	  w = __log1p (xa + t / (one + __ieee754_sqrt (one + t)));
+	  LIBC_PROBE (asinh_probe, 2, 3, &x);
 	}
     }
   return __copysign (w, x);
diff --git a/sysdeps/ieee754/dbl-64/s_atan.c b/sysdeps/ieee754/dbl-64/s_atan.c
index 0aa145c..456ffea 100644
--- a/sysdeps/ieee754/dbl-64/s_atan.c
+++ b/sysdeps/ieee754/dbl-64/s_atan.c
@@ -97,7 +97,10 @@ atan (double x)
 	      yy *= x * v;
 
 	      if ((y = x + (yy - U1 * x)) == x + (yy + U1 * x))
+	      {
+	        LIBC_PROBE (atan_probe, 2, 1, &x);
 		return y;
+		}
 
 	      EMULV (x, x, v, vv, t1, t2, t3, t4, t5);	/* v+vv=x^2 */
 
@@ -119,7 +122,10 @@ atan (double x)
 		    t8);
 	      ADD2 (x, 0, s2, ss2, s1, ss1, t1, t2);
 	      if ((y = s1 + (ss1 - U5 * s1)) == s1 + (ss1 + U5 * s1))
+	      {
+	        LIBC_PROBE (atan_probe, 2, 2, &x);
 		return y;
+		}
 
 	      return atanMp (x, pr);
 	    }
@@ -151,7 +157,10 @@ atan (double x)
 		u2 = U24;
 	    }			/* 3/4 <= u <= 1  */
 	  if ((y = t1 + (yy - u2 * t1)) == t1 + (yy + u2 * t1))
+	  {
+	        LIBC_PROBE (atan_probe, 2, 3, &x);
 	    return __signArctan (x, y);
+	    }
 
 	  z = u - hij[i][0].d;
 
@@ -171,7 +180,10 @@ atan (double x)
 	  MUL2 (z, 0, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8);
 	  ADD2 (hij[i][1].d, hij[i][2].d, s1, ss1, s2, ss2, t1, t2);
 	  if ((y = s2 + (ss2 - U6 * s2)) == s2 + (ss2 + U6 * s2))
+	  {
+	        LIBC_PROBE (atan_probe, 2, 4, &x);
 	    return __signArctan (x, y);
+	    }
 
 	  return atanMp (x, pr);
 	}
@@ -199,7 +211,10 @@ atan (double x)
 	  else
 	    u3 = U32;           /* w >= 1/2 */
 	  if ((y = t1 + (yy - u3)) == t1 + (yy + u3))
+	  {
+	        LIBC_PROBE (atan_probe, 2, 5, &x);
 	    return __signArctan (x, y);
+	    }
 
 	  DIV2 (1, 0, u, 0, w, ww, t1, t2, t3, t4, t5, t6, t7, t8, t9,
 		t10);
@@ -223,7 +238,10 @@ atan (double x)
 	  ADD2 (hij[i][1].d, hij[i][2].d, s1, ss1, s2, ss2, t1, t2);
 	  SUB2 (HPI, HPI1, s2, ss2, s1, ss1, t1, t2);
 	  if ((y = s1 + (ss1 - U7)) == s1 + (ss1 + U7))
+	  {
+	        LIBC_PROBE (atan_probe, 2, 6, &x);
 	    return __signArctan (x, y);
+	    }
 
 	  return atanMp (x, pr);
 	}
@@ -246,7 +264,10 @@ atan (double x)
 	      ESUB (HPI, w, t3, cor);
 	      yy = ((HPI1 + cor) - ww) - yy;
 	      if ((y = t3 + (yy - U4)) == t3 + (yy + U4))
+	      {
+	        LIBC_PROBE (atan_probe, 2, 7, &x);
 		return __signArctan (x, y);
+		}
 
 	      DIV2 (1, 0, u, 0, w, ww, t1, t2, t3, t4, t5, t6, t7, t8,
 		    t9, t10);
@@ -271,7 +292,10 @@ atan (double x)
 	      SUB2 (HPI, HPI1, s1, ss1, s2, ss2, t1, t2);
 
 	      if ((y = s2 + (ss2 - U8)) == s2 + (ss2 + U8))
+	      {
+	        LIBC_PROBE (atan_probe, 2, 8, &x);
 		return __signArctan (x, y);
+		}
 
 	      return atanMp (x, pr);
 	    }
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index 6105e9f..7210daf 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -303,7 +303,7 @@ __sin (double x)
       t = POLYNOMIAL (xx) * (xx * x);
       res = x + t;
       cor = (x - res) + t;
-      retval = (res == res + 1.07 * cor) ? res : slow (x);
+      if (res == res + 1.07 * cor) { LIBC_PROBE (sin_probe, 2, 1, &x); retval = res; } else retval = slow (x);
     }				/*  else  if (k < 0x3fd00000)    */
 /*---------------------------- 0.25<|x|< 0.855469---------------------- */
   else if (k < 0x3feb6000)
@@ -322,7 +322,7 @@ __sin (double x)
       cor = (ssn + s * ccs - sn * c) + cs * s;
       res = sn + cor;
       cor = (sn - res) + cor;
-      retval = (res == res + 1.096 * cor) ? res : slow1 (x);
+      if (res == res + 1.096 * cor) { LIBC_PROBE (sin_probe, 2, 2, &x); retval = res; } else retval = slow1 (x);
     }				/*   else  if (k < 0x3feb6000)    */
 
 /*----------------------- 0.855469  <|x|<2.426265  ----------------------*/
@@ -341,7 +341,7 @@ __sin (double x)
 	  y = (-hp1) - (y + (u.x - big));
 	}
       res = do_cos (u, y, &cor);
-      retval = (res == res + 1.020 * cor) ? ((m > 0) ? res : -res) : slow2 (x);
+      if (res == res + 1.020 * cor) { LIBC_PROBE (sin_probe, 2, 3, &x); retval = ((m > 0) ? res : -res); } else retval = slow2 (x);
     }				/*   else  if (k < 0x400368fd)    */
 
 /*-------------------------- 2.426265<|x|< 105414350 ----------------------*/
@@ -372,7 +372,7 @@ __sin (double x)
 	      /* Taylor series.  */
 	      res = TAYLOR_SIN (xx, a, da, cor);
 	      cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
-	      retval = (res == res + cor) ? res : sloww (a, da, x);
+	      if (res == res + cor) { LIBC_PROBE (sin_probe, 2, 4, &x); retval = res; } else retval = sloww (a, da, x);
 	    }
 	  else
 	    {
@@ -388,8 +388,7 @@ __sin (double x)
 	      y = a - (u.x - big);
 	      res = do_sin (u, y, da, &cor);
 	      cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
-	      retval = ((res == res + cor) ? ((m) ? res : -res)
-			: sloww1 (a, da, x, m));
+	      if (res == res + cor) { LIBC_PROBE (sin_probe, 2, 5, &x); retval = ((m) ? res : -res); } else retval = sloww1 (a, da, x, m);
 	    }
 	  break;
 
@@ -404,8 +403,7 @@ __sin (double x)
 	  y = a - (u.x - big) + da;
 	  res = do_cos (u, y, &cor);
 	  cor = (cor > 0) ? 1.025 * cor + eps : 1.025 * cor - eps;
-	  retval = ((res == res + cor) ? ((n & 2) ? -res : res)
-		    : sloww2 (a, da, x, n));
+	  if (res == res + cor) { LIBC_PROBE (sin_probe, 2, 6, &x); retval = ((n & 2) ? -res : res); } else retval = sloww2 (a, da, x, n);
 	  break;
 	}
     }				/*   else  if (k <  0x419921FB )    */
@@ -443,7 +441,7 @@ __sin (double x)
 	      /* Taylor series.  */
 	      res = TAYLOR_SIN (xx, a, da, cor);
 	      cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
-	      retval = (res == res + cor) ? res : bsloww (a, da, x, n);
+	      if (res == res + cor) { LIBC_PROBE (sin_probe, 2, 7, &x); retval = res; } else retval = bsloww (a, da, x, n);
 	    }
 	  else
 	    {
@@ -462,8 +460,7 @@ __sin (double x)
 	      y = a - (u.x - big);
 	      res = do_sin (u, y, db, &cor);
 	      cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
-	      retval = ((res == res + cor) ? ((m) ? res : -res)
-			: bsloww1 (a, da, x, n));
+	      if (res == res + cor) { LIBC_PROBE (sin_probe, 2, 8, &x); retval = ((m) ? res : -res); } else retval = bsloww1 (a, da, x, n);
 	    }
 	  break;
 
@@ -478,8 +475,7 @@ __sin (double x)
 	  y = a - (u.x - big) + da;
 	  res = do_cos (u, y, &cor);
 	  cor = (cor > 0) ? 1.025 * cor + eps : 1.025 * cor - eps;
-	  retval = ((res == res + cor) ? ((n & 2) ? -res : res)
-		    : bsloww2 (a, da, x, n));
+	  if (res == res + cor) { LIBC_PROBE (sin_probe, 2, 9, &x); retval = ((n & 2) ? -res : res); } else retval = bsloww2 (a, da, x, n);
 	  break;
 	}
     }				/*   else  if (k <  0x42F00000 )   */
@@ -532,7 +528,7 @@ __cos (double x)
       u.x = big + y;
       y = y - (u.x - big);
       res = do_cos (u, y, &cor);
-      retval = (res == res + 1.020 * cor) ? res : cslow2 (x);
+      if (res == res + 1.020 * cor) { LIBC_PROBE (cos_probe, 2, 1, &x); retval = res; } else retval = cslow2 (x);
     }				/*   else  if (k < 0x3feb6000)    */
 
   else if (k < 0x400368fd)
@@ -545,7 +541,7 @@ __cos (double x)
 	{
 	  res = TAYLOR_SIN (xx, a, da, cor);
 	  cor = (cor > 0) ? 1.02 * cor + 1.0e-31 : 1.02 * cor - 1.0e-31;
-	  retval = (res == res + cor) ? res : csloww (a, da, x);
+	  if (res == res + cor) { LIBC_PROBE (cos_probe, 2, 2, &x); retval = res; } else retval = csloww (a, da, x);
 	}
       else
 	{
@@ -563,8 +559,7 @@ __cos (double x)
 	  y = a - (u.x - big);
 	  res = do_sin (u, y, da, &cor);
 	  cor = (cor > 0) ? 1.035 * cor + 1.0e-31 : 1.035 * cor - 1.0e-31;
-	  retval = ((res == res + cor) ? ((m) ? res : -res)
-		    : csloww1 (a, da, x, m));
+	  if (res == res + cor) { LIBC_PROBE (cos_probe, 2, 3, &x); retval = ((m) ? res : -res); } else retval = csloww1 (a, da, x, m);
 	}
 
     }				/*   else  if (k < 0x400368fd)    */
@@ -596,7 +591,7 @@ __cos (double x)
 	    {
 	      res = TAYLOR_SIN (xx, a, da, cor);
 	      cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
-	      retval = (res == res + cor) ? res : csloww (a, da, x);
+	      if (res == res + cor) { LIBC_PROBE (cos_probe, 2, 4, &x); retval = res; } else retval = csloww (a, da, x);
 	    }
 	  else
 	    {
@@ -614,8 +609,7 @@ __cos (double x)
 	      y = a - (u.x - big);
 	      res = do_sin (u, y, da, &cor);
 	      cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
-	      retval = ((res == res + cor) ? ((m) ? res : -res)
-			: csloww1 (a, da, x, m));
+	      if (res == res + cor) { LIBC_PROBE (cos_probe, 2, 5, &x); retval = ((m) ? res : -res); } else retval = csloww1 (a, da, x, m);
 	    }
 	  break;
 
@@ -630,8 +624,7 @@ __cos (double x)
 	  y = a - (u.x - big) + da;
 	  res = do_cos (u, y, &cor);
 	  cor = (cor > 0) ? 1.025 * cor + eps : 1.025 * cor - eps;
-	  retval = ((res == res + cor) ? ((n) ? -res : res)
-		    : csloww2 (a, da, x, n));
+	  if (res == res + cor) { LIBC_PROBE (cos_probe, 2, 6, &x); retval = ((n) ? -res : res); } else retval = csloww2 (a, da, x, n);
 	  break;
 	}
     }				/*   else  if (k <  0x419921FB )    */
@@ -667,7 +660,7 @@ __cos (double x)
 	    {
 	      res = TAYLOR_SIN (xx, a, da, cor);
 	      cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
-	      retval = (res == res + cor) ? res : bsloww (a, da, x, n);
+	      if (res == res + cor) { LIBC_PROBE (cos_probe, 2, 7, &x); retval = res; } else retval = bsloww (a, da, x, n);
 	    }
 	  else
 	    {
@@ -686,8 +679,7 @@ __cos (double x)
 	      y = a - (u.x - big);
 	      res = do_sin (u, y, db, &cor);
 	      cor = (cor > 0) ? 1.035 * cor + eps : 1.035 * cor - eps;
-	      retval = ((res == res + cor) ? ((m) ? res : -res)
-			: bsloww1 (a, da, x, n));
+	      if (res == res + cor) { LIBC_PROBE (cos_probe, 2, 8, &x); retval = ((m) ? res : -res); } else retval = bsloww1 (a, da, x, n);
 	    }
 	  break;
 
@@ -702,8 +694,7 @@ __cos (double x)
 	  y = a - (u.x - big) + da;
 	  res = do_cos (u, y, &cor);
 	  cor = (cor > 0) ? 1.025 * cor + eps : 1.025 * cor - eps;
-	  retval = ((res == res + cor) ? ((n) ? -res : res)
-		    : bsloww2 (a, da, x, n));
+	  if (res == res + cor) { LIBC_PROBE (cos_probe, 2, 9, &x); retval = ((n) ? -res : res); } else retval = bsloww2 (a, da, x, n);
 	  break;
 	}
     }				/*   else  if (k <  0x42F00000 )    */
@@ -734,12 +725,18 @@ slow (double x)
   double res, cor, w[2];
   res = TAYLOR_SLOW (x, 0, cor);
   if (res == res + 1.0007 * cor)
-    return res;
+    {
+    LIBC_PROBE (sin_probe, 2, 10, &x);
+      return res;
+    }
   else
     {
       __dubsin (ABS (x), 0, w);
       if (w[0] == w[0] + 1.000000001 * w[1])
+        {
+	LIBC_PROBE (sin_probe, 2, 11, &x);
 	return (x > 0) ? w[0] : -w[0];
+	}
       else
 	return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
     }
@@ -761,12 +758,18 @@ slow1 (double x)
   y = y - (u.x - big);
   res = do_sin_slow (u, y, 0, 0, &cor);
   if (res == res + cor)
+  {
+  LIBC_PROBE (sin_probe, 2, 12, &x);
     return (x > 0) ? res : -res;
+    }
   else
     {
       __dubsin (ABS (x), 0, w);
       if (w[0] == w[0] + 1.000000005 * w[1])
+      {
+      LIBC_PROBE (sin_probe, 2, 13, &x);
 	return (x > 0) ? w[0] : -w[0];
+	}
       else
 	return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
     }
@@ -799,7 +802,8 @@ slow2 (double x)
     }
   res = do_cos_slow (u, y, del, 0, &cor);
   if (res == res + cor)
-    return (x > 0) ? res : -res;
+  { LIBC_PROBE (sin_probe, 2, 14, &x);
+    return (x > 0) ? res : -res; }
   else
     {
       y = ABS (x) - hp0;
@@ -807,7 +811,8 @@ slow2 (double x)
       y2 = (y - y1) - hp1;
       __docos (y1, y2, w);
       if (w[0] == w[0] + 1.000000005 * w[1])
-	return (x > 0) ? w[0] : -w[0];
+  { LIBC_PROBE (sin_probe, 2, 15, &x);
+	return (x > 0) ? w[0] : -w[0]; }
       else
 	return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
     }
@@ -835,7 +840,8 @@ sloww (double x, double dx, double orig)
     cor = 1.0005 * cor - ABS (orig) * 3.1e-30;
 
   if (res == res + cor)
-    return res;
+  { LIBC_PROBE (sin_probe, 2, 16, &orig);
+    return res;}
   else
     {
       (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
@@ -845,7 +851,8 @@ sloww (double x, double dx, double orig)
 	cor = 1.000000001 * w[1] - ABS (orig) * 1.1e-30;
 
       if (w[0] == w[0] + cor)
-	return (x > 0) ? w[0] : -w[0];
+  { LIBC_PROBE (sin_probe, 2, 17, &orig);
+	return (x > 0) ? w[0] : -w[0]; }
       else
 	{
 	  t = (orig * hpinv + toint);
@@ -871,7 +878,8 @@ sloww (double x, double dx, double orig)
 	    cor = 1.000000001 * w[1] - ABS (orig) * 1.1e-40;
 
 	  if (w[0] == w[0] + cor)
-	    return (a > 0) ? w[0] : -w[0];
+  { LIBC_PROBE (sin_probe, 2, 18, &orig);
+	    return (a > 0) ? w[0] : -w[0]; }
 	  else
 	    return __mpsin (orig, 0, true);
 	}
@@ -897,7 +905,8 @@ sloww1 (double x, double dx, double orig, int m)
   res = do_sin_slow (u, y, dx, 3.1e-30 * ABS (orig), &cor);
 
   if (res == res + cor)
-    return (m > 0) ? res : -res;
+  { LIBC_PROBE (sin_probe, 2, 19, &orig);
+    return (m > 0) ? res : -res; }
   else
     {
       __dubsin (x, dx, w);
@@ -908,7 +917,8 @@ sloww1 (double x, double dx, double orig, int m)
 	cor = 1.000000005 * w[1] - 1.1e-30 * ABS (orig);
 
       if (w[0] == w[0] + cor)
-	return (m > 0) ? w[0] : -w[0];
+  { LIBC_PROBE (sin_probe, 2, 20, &orig);
+	return (m > 0) ? w[0] : -w[0]; }
       else
 	return __mpsin (orig, 0, true);
     }
@@ -933,7 +943,8 @@ sloww2 (double x, double dx, double orig, int n)
   res = do_cos_slow (u, y, dx, 3.1e-30 * ABS (orig), &cor);
 
   if (res == res + cor)
-    return (n & 2) ? -res : res;
+  { LIBC_PROBE (sin_probe, 2, 21, &orig);
+    return (n & 2) ? -res : res; }
   else
     {
       __docos (x, dx, w);
@@ -944,7 +955,8 @@ sloww2 (double x, double dx, double orig, int n)
 	cor = 1.000000005 * w[1] - 1.1e-30 * ABS (orig);
 
       if (w[0] == w[0] + cor)
-	return (n & 2) ? -w[0] : w[0];
+  { LIBC_PROBE (sin_probe, 2, 22, &orig);
+	return (n & 2) ? -w[0] : w[0]; }
       else
 	return __mpsin (orig, 0, true);
     }
@@ -967,7 +979,8 @@ bsloww (double x, double dx, double orig, int n)
   res = TAYLOR_SLOW (x, dx, cor);
   cor = (cor > 0) ? 1.0005 * cor + 1.1e-24 : 1.0005 * cor - 1.1e-24;
   if (res == res + cor)
-    return res;
+  { LIBC_PROBE (sincos_probe, 2, 1, &orig);
+    return res; }
   else
     {
       (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
@@ -976,7 +989,8 @@ bsloww (double x, double dx, double orig, int n)
       else
 	cor = 1.000000001 * w[1] - 1.1e-24;
       if (w[0] == w[0] + cor)
-	return (x > 0) ? w[0] : -w[0];
+  { LIBC_PROBE (sincos_probe, 2, 2, &orig);
+	return (x > 0) ? w[0] : -w[0]; }
       else
 	return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
     }
@@ -1002,7 +1016,8 @@ bsloww1 (double x, double dx, double orig, int n)
   dx = (x > 0) ? dx : -dx;
   res = do_sin_slow (u, y, dx, 1.1e-24, &cor);
   if (res == res + cor)
-    return (x > 0) ? res : -res;
+  { LIBC_PROBE (sincos_probe, 2, 3, &orig);
+    return (x > 0) ? res : -res; }
   else
     {
       __dubsin (ABS (x), dx, w);
@@ -1013,7 +1028,8 @@ bsloww1 (double x, double dx, double orig, int n)
 	cor = 1.000000005 * w[1] - 1.1e-24;
 
       if (w[0] == w[0] + cor)
-	return (x > 0) ? w[0] : -w[0];
+  { LIBC_PROBE (sincos_probe, 2, 4, &orig);
+	return (x > 0) ? w[0] : -w[0]; }
       else
 	return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
     }
@@ -1039,7 +1055,8 @@ bsloww2 (double x, double dx, double orig, int n)
   dx = (x > 0) ? dx : -dx;
   res = do_cos_slow (u, y, dx, 1.1e-24, &cor);
   if (res == res + cor)
-    return (n & 2) ? -res : res;
+  { LIBC_PROBE (sincos_probe, 2, 5, &orig);
+    return (n & 2) ? -res : res; }
   else
     {
       __docos (ABS (x), dx, w);
@@ -1050,7 +1067,8 @@ bsloww2 (double x, double dx, double orig, int n)
 	cor = 1.000000005 * w[1] - 1.1e-24;
 
       if (w[0] == w[0] + cor)
-	return (n & 2) ? -w[0] : w[0];
+  { LIBC_PROBE (sincos_probe, 2, 6, &orig);
+	return (n & 2) ? -w[0] : w[0]; }
       else
 	return (n & 1) ? __mpsin (orig, 0, true) : __mpcos (orig, 0, true);
     }
@@ -1073,13 +1091,15 @@ cslow2 (double x)
   y = y - (u.x - big);
   res = do_cos_slow (u, y, 0, 0, &cor);
   if (res == res + cor)
-    return res;
+  { LIBC_PROBE (cos_probe, 2, 10, &x);
+    return res; }
   else
     {
       y = ABS (x);
       __docos (y, 0, w);
       if (w[0] == w[0] + 1.000000005 * w[1])
-	return w[0];
+  { LIBC_PROBE (cos_probe, 2, 11, &x);
+	return w[0]; }
       else
 	return __mpcos (x, 0, false);
     }
@@ -1110,7 +1130,8 @@ csloww (double x, double dx, double orig)
     cor = 1.0005 * cor - ABS (orig) * 3.1e-30;
 
   if (res == res + cor)
-    return res;
+  { LIBC_PROBE (cos_probe, 2, 12, &orig);
+    return res; }
   else
     {
       (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
@@ -1121,7 +1142,8 @@ csloww (double x, double dx, double orig)
 	cor = 1.000000001 * w[1] - ABS (orig) * 1.1e-30;
 
       if (w[0] == w[0] + cor)
-	return (x > 0) ? w[0] : -w[0];
+  { LIBC_PROBE (cos_probe, 2, 13, &orig);
+	return (x > 0) ? w[0] : -w[0]; }
       else
 	{
 	  t = (orig * hpinv + toint);
@@ -1148,7 +1170,8 @@ csloww (double x, double dx, double orig)
 	    cor = 1.000000001 * w[1] - ABS (orig) * 1.1e-40;
 
 	  if (w[0] == w[0] + cor)
-	    return (a > 0) ? w[0] : -w[0];
+  { LIBC_PROBE (cos_probe, 2, 14, &orig);
+	    return (a > 0) ? w[0] : -w[0]; }
 	  else
 	    return __mpcos (orig, 0, true);
 	}
@@ -1174,7 +1197,8 @@ csloww1 (double x, double dx, double orig, int m)
   res = do_sin_slow (u, y, dx, 3.1e-30 * ABS (orig), &cor);
 
   if (res == res + cor)
-    return (m > 0) ? res : -res;
+  { LIBC_PROBE (cos_probe, 2, 15, &orig);
+    return (m > 0) ? res : -res; }
   else
     {
       __dubsin (x, dx, w);
@@ -1183,7 +1207,8 @@ csloww1 (double x, double dx, double orig, int m)
       else
 	cor = 1.000000005 * w[1] - 1.1e-30 * ABS (orig);
       if (w[0] == w[0] + cor)
-	return (m > 0) ? w[0] : -w[0];
+  { LIBC_PROBE (cos_probe, 2, 16, &orig);
+	return (m > 0) ? w[0] : -w[0]; }
       else
 	return __mpcos (orig, 0, true);
     }
@@ -1209,7 +1234,8 @@ csloww2 (double x, double dx, double orig, int n)
   res = do_cos_slow (u, y, dx, 3.1e-30 * ABS (orig), &cor);
 
   if (res == res + cor)
-    return (n) ? -res : res;
+  { LIBC_PROBE (cos_probe, 2, 17, &orig);
+    return (n) ? -res : res; }
   else
     {
       __docos (x, dx, w);
@@ -1218,7 +1244,8 @@ csloww2 (double x, double dx, double orig, int n)
       else
 	cor = 1.000000005 * w[1] - 1.1e-30 * ABS (orig);
       if (w[0] == w[0] + cor)
-	return (n) ? -w[0] : w[0];
+  { LIBC_PROBE (cos_probe, 2, 18, &orig);
+	return (n) ? -w[0] : w[0]; }
       else
 	return __mpcos (orig, 0, true);
     }
diff --git a/sysdeps/ieee754/dbl-64/s_tanh.c b/sysdeps/ieee754/dbl-64/s_tanh.c
index 23cfcde..4286a71 100644
--- a/sysdeps/ieee754/dbl-64/s_tanh.c
+++ b/sysdeps/ieee754/dbl-64/s_tanh.c
@@ -40,6 +40,7 @@ static char rcsid[] = "$NetBSD: s_tanh.c,v 1.7 1995/05/10 20:48:22 jtc Exp $";
 
 #include <math.h>
 #include <math_private.h>
+#include <stap-probe.h>
 
 static const double one = 1.0, two = 2.0, tiny = 1.0e-300;
 
@@ -73,11 +74,13 @@ __tanh (double x)
 	{
 	  t = __expm1 (two * fabs (x));
 	  z = one - two / (t + two);
+	  LIBC_PROBE (tanh_probe, 2, 1, &x);
 	}
       else
 	{
 	  t = __expm1 (-two * fabs (x));
 	  z = -t / (t + two);
+	  LIBC_PROBE (tanh_probe, 2, 2, &x);
 	}
       /* |x| > 22, return +-1 */
     }
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
index ccccdaf..586de12 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_acosh.c
@@ -26,6 +26,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <stap-probe.h>
 
 static const double
 one	= 1.0,
@@ -46,17 +47,22 @@ __ieee754_acosh (double x)
 	    /* x is inf of NaN */
 	    return x + x;
 	  else
+	  {
+	    LIBC_PROBE (acosh_probe, 2, 1, &x);
 	    return __ieee754_log (x) + ln2;/* acosh(huge)=log(2x) */
+	    }
 	}
 
       /* 2**28 > x > 2 */
       double t = x * x;
+	    LIBC_PROBE (acosh_probe, 2, 2, &x);
       return __ieee754_log (2.0 * x - one / (x + __ieee754_sqrt (t - one)));
     }
   else if (__glibc_likely (hx > INT64_C (0x3ff0000000000000)))
     {
       /* 1<x<2 */
       double t = x - one;
+	    LIBC_PROBE (acosh_probe, 2, 3, &x);
       return __log1p (t + __ieee754_sqrt (2.0 * t + t * t));
     }
   else if (__glibc_likely (hx == INT64_C (0x3ff0000000000000)))
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c
index 8459352..ecf8210 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c
@@ -33,6 +33,7 @@
 
 #include <math.h>
 #include <math_private.h>
+#include <stap-probe.h>
 
 static const double one = 1.0, half=0.5, huge = 1.0e300;
 
@@ -52,17 +53,23 @@ __ieee754_cosh (double x)
 		if(ix<0x3fd62e43) {
 		    t = __expm1(fabs(x));
 		    w = one+t;
+		    LIBC_PROBE (cosh_probe, 2, 1, &x);
 		    if (ix<0x3c800000) return w;	/* cosh(tiny) = 1 */
 		    return one+(t*t)/(w+w);
 		}
 
+		    LIBC_PROBE (cosh_probe, 2, 2, &x);
 	    /* |x| in [0.5*ln2,22], return (exp(|x|)+1/exp(|x|)/2; */
 		t = __ieee754_exp(fabs(x));
 		return half*t+half/t;
 	}
 
     /* |x| in [22, log(maxdouble)] return half*exp(|x|) */
-	if (ix < 0x40862e42)  return half*__ieee754_exp(fabs(x));
+	if (ix < 0x40862e42)  
+	{
+		    LIBC_PROBE (cosh_probe, 2, 3, &x);
+	return half*__ieee754_exp(fabs(x));
+	}
 
     /* |x| in [log(maxdouble), overflowthresold] */
 	int64_t fix;
@@ -71,6 +78,7 @@ __ieee754_cosh (double x)
 	if (fix <= UINT64_C(0x408633ce8fb9f87d)) {
 	    w = __ieee754_exp(half*fabs(x));
 	    t = half*w;
+		    LIBC_PROBE (cosh_probe, 2, 4, &x);
 	    return t*w;
 	}
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]