Recording hash of binaries in test-suite and LNT.

Sean Silva chisophugis at gmail.com
Tue Jul 7 19:59:42 PDT 2015


Is there a way to avoid running the perf test for binaries that haven't
changed? I guess that it might be useful for a bit of redundancy, but for
doing the analysis I was doing, which involved bisecting back through
history to pinpoint at which revisions the hashes changed, it would be
useful to avoid wasting time benchmarking programs known to be the same
binary (if that matters, then there is a bug in how the perf is being
measured, or it is an unrelated system problem which, while it might be
interesting to dive into, may not be the focus).

It's interesting that you had to strip out the .comment and .note. I didn't
have to do that on mac. Do you know if there is a linker flag or compiler
flag on linux that we can use to avoid outputting them in the first place?

-- Sean Silva

On Tue, Jul 7, 2015 at 11:37 AM, Kristof Beyls <kristof.beyls at arm.com>
wrote:

> I've implemented a test-suite patch and an LNT patch to calculate a hash
> function
> for each binary in the test-suite & to store it in the LNT database.
>
> The test-suite patch is surprisingly simple. The only thing I had to do
> to get stable hashes is to strip out the .comment and all .note sections.
> The attached spreadsheet shows the calculated hashes by the patch across
> the test-suite for a range of LLVM svn revisions from last week, each
> roughly a day apart from each other. It does show indeed that on about
> half of the days the binaries didn't change. The hashes were collected
> on a linux-x86_64 system.
>
> The attached lnt patch is quite a bit bigger - adding a new type of
> sample field (hash) and adapting the rest of LNT to make LNT's regression
> tests pass. I didn't attempt to make use of the hash values in any of
> LNT's analyses or reports in this patch. I've got a vague idea that maybe
> the first easy & useful additions could be to color-code the background
> in the run-chart with the hash-value of the binary. That way, you could
> see which sample points were produced by identical binaries. The same
> could be done for the spark lines on the daily report page.
>
> Bottom line: at least on linux platforms, it seems that it's pretty
> straightforward
> to compute useful hashes from binaries pretty easily, see the attached
> test-suite patch. I'm assuming that on Darwin platforms the exact same
> patch - or maybe with some tweaks on which sections to strip - should
> work too, but don't know enough about Darwin to know for sure.
>
> The LNT changes are indeed more invasive. I've attached my current version
> of the patch I've got for that.
>
> What do you think of this approach?
>
> Thanks,
>
> Kristof
>
> > -----Original Message-----
> > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> > On Behalf Of Chris Matthews
> > Sent: 21 May 2015 19:25
> > To: Renato Golin
> > Cc: LLVM Developers Mailing List
> > Subject: Re: [LLVMdev] Proposal: change LNT's regression detection
> > algorithm and how it is used to reduce false positives
> >
> > I agree this is a great idea.  I think it needs to be fleshed out a
> > little though.
> >
> > It would still be wise to run the regression detection algorithm,
> > because the test suite changes and the machines change, and the
> > algorithm is not perfect yet.  It would be a valuable source of
> > information though.
> >
> > This is not a small change to how LNT works, so I think some due
> > diligence is necessary.  Is clang *really* that deterministic,
> > especially over successive revs?  I know it is supposed to be.  Does
> > anyone have any data to show this is going to be an effective approach?
> > It seems like there are benchmarks in the test-suite which use __DATE__
> > and __TIME__ in them. I assume that will be a problem?
> >
> > > On May 21, 2015, at 1:43 AM, Renato Golin <renato.golin at linaro.org>
> > wrote:
> > >
> > > On 20 May 2015 at 23:31, Sean Silva <chisophugis at gmail.com> wrote:
> > >> In the last 10,000 revisions of LLVM+Clang, only 10 revisions
> > >> actually caused the binary of MultiSource/Benchmarks/BitBench/five11
> > >> to change. So if just store a hash of the binary in the database, we
> > >> should be able to pool all samples we have collected while the binary
> > >> is the the same as it currently is, which will let us use
> > >> significantly more datapoints for the reference.
> > >
> > > +1
> > >
> > >
> > >> Also, we can trivially eliminate running the regression detection
> > >> algorithm if the binary hasn't changed.
> > >
> > > +2!
> > >
> > > --renato
> > > _______________________________________________
> > > LLVM Developers mailing list
> > > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> >
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150707/802bb79e/attachment.html>


More information about the llvm-commits mailing list