From b07510cb5bc9875124275fd3a4edd51a0bddddbb Mon Sep 17 00:00:00 2001 From: Andrea Arteaga Date: Tue, 10 Apr 2012 00:04:43 +0200 Subject: Added cache information in report. --- numbench/reports/html.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/numbench/reports/html.py b/numbench/reports/html.py index 0ab9ba4..227de57 100644 --- a/numbench/reports/html.py +++ b/numbench/reports/html.py @@ -15,8 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -import time -from os.path import join as pjoin, basename +import os, time +from os.path import join as pjoin, basename, exists from xml.sax.saxutils import escape as xmlescape from .. import benchconfig as cfg @@ -81,6 +81,19 @@ h1, h2, .plot, .descr, .info { mem = l.split(':',1)[1].strip() if mem: self.content += '

Total memory: ' + mem + '

' + + # Information regarding the caches + cachedir = '/sys/devices/system/cpu/cpu0/cache' + if exists(cachedir): + self.content += '

Caches:
' + for i in os.listdir(cachedir): + cdir = pjoin(cachedir, i) + ctxt = 'L' + file(pjoin(cdir, 'level')).read().strip() + ctxt += ' ' + file(pjoin(cdir, 'type')).read().strip() + ctxt += ': ' + file(pjoin(cdir, 'size')).read().strip()[:-1] + self.content += ctxt + ' kB
' + self.content += '

' + # Input file self.content += '
Input file: ' + \ -- cgit v1.2.3-65-gdbad