Gentoo Archives: gentoo-commits

From: Andrea Arteaga <andyspiros@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/auto-numerical-bench:master commit in: numbench/reports/
Date: Mon, 09 Apr 2012 22:07:41
Message-Id: 1334009083.b07510cb5bc9875124275fd3a4edd51a0bddddbb.spiros@gentoo
1 commit: b07510cb5bc9875124275fd3a4edd51a0bddddbb
2 Author: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
3 AuthorDate: Mon Apr 9 22:04:43 2012 +0000
4 Commit: Andrea Arteaga <andyspiros <AT> gmail <DOT> com>
5 CommitDate: Mon Apr 9 22:04:43 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/auto-numerical-bench.git;a=commit;h=b07510cb
7
8 Added cache information in report.
9
10 ---
11 numbench/reports/html.py | 17 +++++++++++++++--
12 1 files changed, 15 insertions(+), 2 deletions(-)
13
14 diff --git a/numbench/reports/html.py b/numbench/reports/html.py
15 index 0ab9ba4..227de57 100644
16 --- a/numbench/reports/html.py
17 +++ b/numbench/reports/html.py
18 @@ -15,8 +15,8 @@
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #
22 -import time
23 -from os.path import join as pjoin, basename
24 +import os, time
25 +from os.path import join as pjoin, basename, exists
26 from xml.sax.saxutils import escape as xmlescape
27
28 from .. import benchconfig as cfg
29 @@ -81,6 +81,19 @@ h1, h2, .plot, .descr, .info {
30 mem = l.split(':',1)[1].strip()
31 if mem:
32 self.content += '<p class="info">Total memory: ' + mem + '</p>'
33 +
34 + # Information regarding the caches
35 + cachedir = '/sys/devices/system/cpu/cpu0/cache'
36 + if exists(cachedir):
37 + self.content += '<p class="info">Caches:<br />'
38 + for i in os.listdir(cachedir):
39 + cdir = pjoin(cachedir, i)
40 + ctxt = 'L' + file(pjoin(cdir, 'level')).read().strip()
41 + ctxt += ' ' + file(pjoin(cdir, 'type')).read().strip()
42 + ctxt += ': ' + file(pjoin(cdir, 'size')).read().strip()[:-1]
43 + self.content += ctxt + ' kB<br />'
44 + self.content += '</p>'
45 +
46
47 # Input file
48 self.content += '<div class="inputfile">Input file: ' + \