This is an archive of the discontinued LLVM Phabricator instance.

[NFC] Add utility to sum/merge stats files
ClosedPublic

Authored by Tyker on Jul 9 2020, 1:32 PM.

Details

Summary

Add a small script to sum *.stats file given as input and output the totals
usage example:

merge-stats.py $(find ./builddir/ -name "*.stats") > total.stats

Diff Detail

Event Timeline

Tyker created this revision.Jul 9 2020, 1:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2020, 1:32 PM

Is there really no such existing script? (i don't know of one, i've always hacked around with bash)
It's a non-blocker, but i just want to point out that aggregating via sum is not always correct for all stats - there's updateMax() setter.

Tyker added a comment.Jul 9 2020, 1:47 PM

Is there really no such existing script? (i don't know of one, i've always hacked around with bash)

i tried to find one the first time i needed one and didn't find any. maybe there is one i didn't find.

It's a non-blocker, but i just want to point out that aggregating via sum is not always correct for all stats - there's updateMax() setter.

ok
i wasn't aware of it, i don't think it is really possible to differentiate between them. but we could count both the sum and the max for all stats.

Is there really no such existing script? (i don't know of one, i've always hacked around with bash)

i tried to find one the first time i needed one and didn't find any. maybe there is one i didn't find.

It's a non-blocker, but i just want to point out that aggregating via sum is not always correct for all stats - there's updateMax() setter.

ok
i wasn't aware of it, i don't think it is really possible to differentiate between them.

Yep. Just feel like pointing out.

but we could count both the sum and the max for all stats.

lebedev.ri accepted this revision.Jul 16 2020, 10:04 AM

This looks good and reasonable to me.
I think it would be useful to have that in-tree.

llvm/utils/merge-stats.py
2

I think it would be okay to hardcode python3 in a new script :)

This revision is now accepted and ready to land.Jul 16 2020, 10:04 AM
lebedev.ri added inline comments.Jul 17 2020, 5:56 AM
llvm/utils/merge-stats.py
25

.. because python2 doesn't like this

This revision was landed with ongoing or failed builds.Aug 7 2020, 10:04 AM
This revision was automatically updated to reflect the committed changes.