X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=libs%2Fsys%2Fluasrc%2Fsys.lua;h=817217b900978e8bb4a7de28a6df69b37a0b0cc5;hp=61da6f1cb41873c96b40a21e2fc0794147c18c8f;hb=6951da02ce0b5ffa5593d31173cee92d1b33ee3d;hpb=d0c8c5b5327484dbd88c924d5f44a33c11af8893 diff --git a/libs/sys/luasrc/sys.lua b/libs/sys/luasrc/sys.lua index 61da6f1cb4..817217b900 100644 --- a/libs/sys/luasrc/sys.lua +++ b/libs/sys/luasrc/sys.lua @@ -166,6 +166,7 @@ end -- @return String containing the memory used for caching in kB -- @return String containing the memory used for buffering in kB -- @return String containing the free memory amount in kB +-- @return String containing the cpu bogomips (number) function sysinfo() local cpuinfo = fs.readfile("/proc/cpuinfo") local meminfo = fs.readfile("/proc/meminfo") @@ -176,6 +177,7 @@ function sysinfo() local memcached = tonumber(meminfo:match("\nCached:%s*(%d+)")) local memfree = tonumber(meminfo:match("MemFree:%s*(%d+)")) local membuffers = tonumber(meminfo:match("Buffers:%s*(%d+)")) + local bogomips = tonumber(cpuinfo:match("BogoMIPS.-:%s*([^\n]+)")) if not system then system = nixio.uname().machine @@ -187,7 +189,7 @@ function sysinfo() model = cpuinfo:match("cpu model.-:%s*([^\n]+)") end - return system, model, memtotal, memcached, membuffers, memfree + return system, model, memtotal, memcached, membuffers, memfree, bogomips end --- Retrieves the output of the "logread" command.