This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/4] Make bench.out in json format
- From: Will Newton <will dot newton at linaro dot org>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 25 Mar 2014 11:48:24 +0000
- Subject: Re: [PATCH 1/4] Make bench.out in json format
- Authentication-results: sourceware.org; auth=none
- References: <20140325102859 dot GA1850 at spoyarek dot pnq dot redhat dot com>
On 25 March 2014 10:28, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
> Hi,
>
> 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.
>
> Siddhesh
>
> * benchtests/Makefile (timing-type): New binary.
> (bench-clean): Also remove bench-timing-type.
> (bench): New target for timing-type.
> (bench-func): Print output in JSON format.
> * benchtests/bench-skeleton.c (main): Print output in JSON
> format.
> * benchtests/bench-timing-type.c: New file.
> * benchtests/bench-timing.h (TIMING_TYPE): New macro.
> (TIMING_PRINT_STATS): Remove.
> * benchtests/scripts/bench.py (_print_arg_data): Store variant
> name separately.
>
> ---
> benchtests/Makefile | 23 +++++++++++++++++++----
> benchtests/bench-skeleton.c | 18 +++++++++++++++---
> benchtests/bench-timing-type.c | 27 +++++++++++++++++++++++++++
> benchtests/bench-timing.h | 14 ++++----------
> benchtests/scripts/bench.py | 2 +-
> 5 files changed, 66 insertions(+), 18 deletions(-)
> create mode 100644 benchtests/bench-timing-type.c
In principle this seems ok to me, although it does seem to make the
output quite ugly for the human reader. Would it be possible to get
the layout a bit tidier? i.e. indentation and newlines.
--
Will Newton
Toolchain Working Group, Linaro