about summary refs log tree commit diff
path: root/benchtests/bench-timing-type.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2014-03-29 09:37:44 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2014-03-29 09:37:44 +0530
commitcb5e4aada7f044fc029dd64b31411a23bb09c287 (patch)
tree24f50d1418ef624707a8745737c89086944528a5 /benchtests/bench-timing-type.c
parentcf806aff6067273307d958f35c0a4cd0b0d40e80 (diff)
downloadglibc-cb5e4aada7f044fc029dd64b31411a23bb09c287.tar.gz
glibc-cb5e4aada7f044fc029dd64b31411a23bb09c287.tar.xz
glibc-cb5e4aada7f044fc029dd64b31411a23bb09c287.zip
Make bench.out in json format
This patch changes the output format of the main benchmark output file
(bench.out) to an extensible format.  I chose JSON over XML because in
addition to being extensible, it is also not too verbose.
Additionally it has good support in python.

The significant change I have made in terms of functionality is to put
timing information as an attribute in JSON instead of a string and to
do that, there is a separate program that prints out a JSON snippet
mentioning the type of timing (hp_timing or clock_gettime).  The mean
timing has now changed from iterations per unit to actual timing per
iteration.
Diffstat (limited to 'benchtests/bench-timing-type.c')
-rw-r--r--benchtests/bench-timing-type.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/benchtests/bench-timing-type.c b/benchtests/bench-timing-type.c
new file mode 100644
index 0000000000..903a61f0af
--- /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;
+}