This is the mail archive of the libc-alpha@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]

Re: [PATCH 4/4] Validate bench.out against a JSON schema


On Tue, Mar 25, 2014 at 02:49:18PM +0000, Will Newton wrote:
> On 25 March 2014 10:30, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
> > Hi,
> >
> > The first patch in this series converted the benchmark output into
> > JSON format.  This patch adds a JSON schema that describes the format
> > of the benchmark output.  There is also a script that validates the
> > generated bench.out against the schema at the end of `make bench`.
> >
> > Siddhesh
> >
> >         * benchtests/scripts/benchout.schema.json: New file.
> >         * benchtests/scripts/validate_benchout.py: New script.
> >         * benchtests/Makefile (bench-func): Call it.
> 
> I had a problem validating the results of modf:
> 
>   File "/usr/lib/python2.7/site-packages/jsonschema.py", line 311, in validate
>     raise error
> jsonschema.ValidationError: Additional properties are not allowed
> (u'modf()' was unexpected)
> 

Ahh, you need this patch:

https://patchwork.siddhesh.in/patch/206/

> > +      "required": ["vendor-id", "cpu-family", "model", "cpu-cores",
> > +                   "processors", "cache-size", "memory", "swap"]
> 
> This isn't going to work for non-Intel architectures. On ARM I get:
> 
> {
>   "memory": 2068232,
>   "swap": 0,
>   "processors": 2
> }
> 
> I'm not sure what the best solution is, /proc/cpuinfo seems pretty
> much architecture specific:
> 
> Processor    : ARMv7 Processor rev 4 (v7l)
> processor    : 0
> BogoMIPS    : 1694.10
> 
> processor    : 1
> BogoMIPS    : 1694.10
> 
> Features    : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
> vfpv4 idiva idivt
> CPU implementer    : 0x41
> CPU architecture: 7
> CPU variant    : 0x0
> CPU part    : 0xc0f
> CPU revision    : 4
> 
> Hardware    : SAMSUNG EXYNOS5 (Flattened Device Tree)
> Revision    : 0000
> Serial        : 0000000000000000

Thanks, I didn't know this.  Would it be useful to just have a
free-form machine information to begin with, i.e. arbitrary name-value
pairs without a strict set of rules?  The main use I see for machine
information is for benchmark comparisons, i.e. where we want to know
what it is we're comparing.  The secondary goal from that would be to
ensure that benchmark comparions are done across comparable
configurations.

> > +from __future__ import print_function
> > +import jsonschema
> 
> This module is not part of the standard Python install so it should
> probably be imported inside a try block so we can catch if it is
> missing and print a message. Otherwise make bench fails with a
> non-zero exit which I don't think is necessarily desirable given this
> validation will generally not be required.

Ack, will fix.  I also should be adding a note in the README about the
dependency.

Thanks,
Siddhesh

Attachment: pgpqEsdO0uQ7U.pgp
Description: PGP signature


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