|
From: <sv...@va...> - 2008-06-21 08:08:19
|
Author: bart
Date: 2008-06-21 09:07:40 +0100 (Sat, 21 Jun 2008)
New Revision: 8265
Log:
Works now with older kernels too.
Modified:
trunk/exp-drd/scripts/measurement-functions
Modified: trunk/exp-drd/scripts/measurement-functions
===================================================================
--- trunk/exp-drd/scripts/measurement-functions 2008-06-20 12:37:41 UTC (rev 8264)
+++ trunk/exp-drd/scripts/measurement-functions 2008-06-21 08:07:40 UTC (rev 8265)
@@ -22,7 +22,12 @@
## Print the size of the level 2 cache in bytes on stdout.
function get_cache_size {
local s
- s=$(</sys/devices/system/cpu/cpu0/cache/index2/size)
+ if [ -e /sys/devices/system/cpu/cpu0/cache/index2/size ]; then
+ s="$(</sys/devices/system/cpu/cpu0/cache/index2/size)"
+ else
+ s="$(cat /proc/cpuinfo|while read a b c d e ; do if [ "$a" = cache -a "$b" = size ]; then echo $d $e; break; fi; done)"
+ s="${s%B}"
+ fi
if [ "${s%M}" != "$s" ]; then
echo $((${s%M}*1024*1024))
elif [ "${s%K}" != "$s" ]; then
|