travisdowns / uarch-bench

A benchmark for low-level CPU micro-architectural features
MIT License
686 stars 63 forks source link

detect if running in a VM #80

Closed olafhering closed 4 years ago

travisdowns commented 4 years ago

Thanks! Can you comment specifically on the reasoning behind unsetting the LC_ variables?

olafhering commented 4 years ago

Thanks! Can you comment specifically on the reasoning behind unsetting the LC_ variables?

As the commit message says, the output of lscpu will be localized.

travisdowns commented 4 years ago

@olafhering sorry, I had not checked the commit messages: they have the detail I was looking for.

I will review this soon.

travisdowns commented 4 years ago

@olafhering - thanks for these changes. TBH, uarch-bench.sh is a bit of a mess, I've been planning to clean it up. In particular, every time a special file like .../no_turbo is used, we should just check if the file exists, and do the thing, but move on otherwise.

At some point I'll probably make that change (this script may change to python), and I think that will work for the VM case too? That is, not checking explicitly if we are in a VM, but simply not failing if the various files are not present.