summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/llprocessor.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 65b4507e2d..446c312ca9 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -26,9 +26,11 @@
#include "linden_common.h"
#include "llprocessor.h"
-
+#include "llstring.h"
+#include "stringize.h"
#include "llerror.h"
+#include <iomanip>
//#include <memory>
#if LL_WINDOWS
@@ -188,7 +190,7 @@ namespace
case 0xF: return "Intel Pentium 4";
case 0x10: return "Intel Itanium 2 (IA-64)";
}
- return "Unknown";
+ return STRINGIZE("Intel <unknown 0x" << std::hex << composed_family << ">");
}
std::string amd_CPUFamilyName(int composed_family)
@@ -201,26 +203,26 @@ namespace
case 0xF: return "AMD K8";
case 0x10: return "AMD K8L";
}
- return "Unknown";
+ return STRINGIZE("AMD <unknown 0x" << std::hex << composed_family << ">");
}
std::string compute_CPUFamilyName(const char* cpu_vendor, int family, int ext_family)
{
const char* intel_string = "GenuineIntel";
const char* amd_string = "AuthenticAMD";
- if(!strncmp(cpu_vendor, intel_string, strlen(intel_string)))
+ if (LLStringUtil::startsWith(cpu_vendor, intel_string))
{
U32 composed_family = family + ext_family;
return intel_CPUFamilyName(composed_family);
}
- else if(!strncmp(cpu_vendor, amd_string, strlen(amd_string)))
+ else if (LLStringUtil::startsWith(cpu_vendor, amd_string))
{
U32 composed_family = (family == 0xF)
? family + ext_family
: family;
return amd_CPUFamilyName(composed_family);
}
- return "Unknown";
+ return STRINGIZE("Unrecognized CPU vendor <" << cpu_vendor << ">");
}
} // end unnamed namespace
@@ -258,8 +260,8 @@ public:
return hasExtension("Altivec");
}
- std::string getCPUFamilyName() const { return getInfo(eFamilyName, "Unknown").asString(); }
- std::string getCPUBrandName() const { return getInfo(eBrandName, "Unknown").asString(); }
+ std::string getCPUFamilyName() const { return getInfo(eFamilyName, "Unset family").asString(); }
+ std::string getCPUBrandName() const { return getInfo(eBrandName, "Unset brand").asString(); }
// This is virtual to support a different linux format.
// *NOTE:Mani - I didn't want to screw up server use of this data...
@@ -271,7 +273,7 @@ public:
out << "//////////////////////////" << std::endl;
out << "Processor Name: " << getCPUBrandName() << std::endl;
out << "Frequency: " << getCPUFrequency() << " MHz" << std::endl;
- out << "Vendor: " << getInfo(eVendor, "Unknown").asString() << std::endl;
+ out << "Vendor: " << getInfo(eVendor, "Unset vendor").asString() << std::endl;
out << "Family: " << getCPUFamilyName() << " (" << getInfo(eFamily, 0) << ")" << std::endl;
out << "Extended family: " << getInfo(eExtendedFamily, 0) << std::endl;
out << "Model: " << getInfo(eModel, 0) << std::endl;