This is an archive of the discontinued LLVM Phabricator instance.

[lld][benchmark] Be tolerant of optional metric units in output
AbandonedPublic

Authored by int3 on Jan 20 2021, 12:53 PM.

Details

Reviewers
lebedev.ri
Group Reviewers
Restricted Project
Summary

... and set up a test scaffolding so we can verify the behavior.

It seems that the perf on my machine does emit the msec unit for
task-clock, hence this fix.

Note that perf stat has an -x flag that will output things in an
easy-to-parse CSV-like format, but that flag will cause things like
the 'seconds time elapsed' data to be omitted, which is why I didn't
take that route here.

P.S. I'm barely familiar with CMake, so I just copied the stuff from
clang/bindings/python/tests/CMakeLists.txt which also has a python unit
test.

Diff Detail

Event Timeline

int3 created this revision.Jan 20 2021, 12:53 PM
int3 requested review of this revision.Jan 20 2021, 12:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2021, 12:53 PM
lebedev.ri resigned from this revision.Jan 20 2021, 12:56 PM
int3 edited the summary of this revision. (Show Details)Jan 20 2021, 12:59 PM
compnerd added inline comments.
lld/test/CMakeLists.txt
39

This doesn't seem correct - the check-* shouldn't be a dependency for running tests.

int3 added inline comments.Jan 20 2021, 4:18 PM
lld/test/CMakeLists.txt
39

True, but neither is LLDUnitTests, and I was following its lead...

Looking at llvm/CMakeLists.txt, it seems that over there they define a LLVM_ADDITIONAL_TEST_TARGETS variable that gets added as a dependency to the check-all target, alongside the test dependencies for the main test suite; I guess we could do something similar here.

int3 updated this revision to Diff 318065.Jan 20 2021, 4:53 PM
int3 marked an inline comment as done.

clean up cmake

int3 abandoned this revision.Feb 19 2021, 8:02 PM