mirror of
https://github.com/andreas-abel/nanoBench.git
synced 2025-12-16 11:30:07 +01:00
28 lines
631 B
Python
Executable File
28 lines
631 B
Python
Executable File
#!/usr/bin/python
|
|
import argparse
|
|
|
|
from cacheLib import *
|
|
|
|
import logging
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser(description='Cache Information')
|
|
parser.add_argument("-logLevel", help="Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL)", default='INFO')
|
|
args = parser.parse_args()
|
|
|
|
logging.basicConfig(stream=sys.stdout, format='%(message)s', level=logging.getLevelName(args.logLevel))
|
|
|
|
cpuidInfo = getCpuidCacheInfo()
|
|
|
|
print ''
|
|
print getCacheInfo(1)
|
|
print getCacheInfo(2)
|
|
if 'L3' in cpuidInfo:
|
|
print getCacheInfo(3)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|