summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-09-18 20:41:03 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-09-18 20:41:03 +0000
commit752ce1e6e77f89814c443628c5ee3761cf782bc9 (patch)
treef44f0e3c7088b2d77aefaa8387dec663288fc831
parentf18e630ef2988fa2d813f86d2b3872509028a0a4 (diff)
downloadrockbox-752ce1e6e77f89814c443628c5ee3761cf782bc9.tar.gz
rockbox-752ce1e6e77f89814c443628c5ee3761cf782bc9.tar.bz2
rockbox-752ce1e6e77f89814c443628c5ee3761cf782bc9.zip
Display number of processors in System Info dialog.
Since Rockbox Utility got support for utilizing more than one CPU / Core this value might be helpful in case of issues like FS#11496 (QThreadPool defaults to the number of CPUs found as maximum number of threads). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28106 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/base/system.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/base/system.cpp b/rbutil/rbutilqt/base/system.cpp
index 748bc60766..11b31e8f16 100644
--- a/rbutil/rbutilqt/base/system.cpp
+++ b/rbutil/rbutilqt/base/system.cpp
@@ -164,6 +164,7 @@ QString System::osVersionString(void)
{
QString result;
#if defined(Q_OS_WIN32)
+ SYSTEM_INFO sysinfo;
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
@@ -175,14 +176,22 @@ QString System::osVersionString(void)
.arg(QString::fromWCharArray(osvi.szCSDVersion));
else
result += QString("build %1").arg(osvi.dwBuildNumber);
+ result += QString("<br/>CPU: %1, %2 processor(s)").arg(sysinfo.dwProcessorType)
+ .arg(sysinfo.dwNumberOfProcessors);
#endif
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX)
struct utsname u;
int ret;
ret = uname(&u);
- result = QString("CPU: %1<br/>System: %2<br/>Release: %3<br/>Version: %4")
- .arg(u.machine).arg(u.sysname).arg(u.release).arg(u.version);
+#if defined(Q_OS_MACX)
+ ItemCount cores = MPProcessors();
+#else
+ long cores = sysconf(_SC_NPROCESSORS_ONLN);
+#endif
+ result = QString("CPU: %1, %2 processor(s)").arg(u.machine).arg(cores);
+ result += QString("<br/>System: %2<br/>Release: %3<br/>Version: %4")
+ .arg(u.sysname).arg(u.release).arg(u.version);
#if defined(Q_OS_MACX)
SInt32 major;
SInt32 minor;