From 64581fb8d001262d2e34b3e3b653e485555d9c9c Mon Sep 17 00:00:00 2001
From: Nat Goodspeed <nat@lindenlab.com>
Date: Wed, 29 Mar 2017 16:07:58 -0400
Subject: [PATCH] DRTVWR-418: Instead of "Unknown", try be informative about
 platform.

When a 'family' code isn't recognized, for instance, report the family code.
That should at least clue us in to look up and add an entry for the relevant
family code.
---
 indra/llcommon/llprocessor.cpp | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index 65b4507e2d7..446c312ca9e 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 @@ class LLProcessorInfoImpl
 		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 @@ class LLProcessorInfoImpl
 		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;
-- 
GitLab