summaryrefslogtreecommitdiff
path: root/indra/llcommon
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2010-05-27 16:22:47 -0700
committerMark Palange (Mani) <palange@lindenlab.com>2010-05-27 16:22:47 -0700
commita6a9e893930584db90a57263211b7eac787085a0 (patch)
tree3bc1975f4059f5b8296e876ffec8347e637a2b68 /indra/llcommon
parent5fb6f4fe93cd9e7a83d59cd23b53dd53cae5721a (diff)
EXT-3780 FIX Bug in linux reporting.
Diffstat (limited to 'indra/llcommon')
-rw-r--r--indra/llcommon/llprocessor.cpp57
1 files changed, 2 insertions, 55 deletions
diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp
index b7c1fd2ad2..f991190d7a 100644
--- a/indra/llcommon/llprocessor.cpp
+++ b/indra/llcommon/llprocessor.cpp
@@ -680,66 +680,13 @@ class LLProcessorInfoLinuxImpl : public LLProcessorInfoImpl
public:
LLProcessorInfoLinuxImpl()
{
- std::map< std::string, std::string > cpuinfo;
- LLFILE* cpuinfo_fp = LLFile::fopen(CPUINFO_FILE, "rb");
- if(cpuinfo_fp)
- {
- char line[MAX_STRING];
- memset(line, 0, MAX_STRING);
- while(fgets(line, MAX_STRING, cpuinfo_fp))
- {
- // /proc/cpuinfo on Linux looks like:
- // name\t*: value\n
- char* tabspot = strchr( line, '\t' );
- if (tabspot == NULL)
- continue;
- char* colspot = strchr( tabspot, ':' );
- if (colspot == NULL)
- continue;
- char* spacespot = strchr( colspot, ' ' );
- if (spacespot == NULL)
- continue;
- char* nlspot = strchr( line, '\n' );
- if (nlspot == NULL)
- nlspot = line + strlen( line ); // Fallback to terminating NUL
- std::string linename( line, tabspot );
- std::string llinename(linename);
- LLStringUtil::toLower(llinename);
- std::string lineval( spacespot + 1, nlspot );
- cpuinfo[ llinename ] = lineval;
- }
- fclose(cpuinfo_fp);
- }
-# if LL_X86
- std::string flags = " " + cpuinfo["flags"] + " ";
- LLStringUtil::toLower(flags);
-
- if( flags.find( " sse " ) != std::string::npos )
- {
- setExtension(eSSE_Ext);
- }
-
- if( flags.find( " sse2 " ) != std::string::npos )
- {
- setExtension(eSSE2_Ext);
- }
-
- F64 mhz;
- if (LLStringUtil::convertToF64(cpuinfo["cpu mhz"], mhz)
- && 200.0 < mhz && mhz < 10000.0)
- {
- setInfo(eFrequency,(F64)(mhz));
- }
-
- if (!cpuinfo["model name"].empty())
- mCPUString = cpuinfo["model name"];
-# endif // LL_X86
+ get_proc_cpuinfo();
}
virtual ~LLProcessorInfoLinuxImpl() {}
private:
- void getCPUIDInfo()
+ void get_proc_cpuinfo()
{
std::map< std::string, std::string > cpuinfo;
LLFILE* cpuinfo_fp = LLFile::fopen(CPUINFO_FILE, "rb");