[STATS] Print "Unknown" for frequency if it wasn't able to be parsed

llvm-svn: 263583
This commit is contained in:
Jonathan Peyton 2016-03-15 20:55:32 +00:00
parent 226dcd3243
commit 20c1e4e69d
2 changed files with 5 additions and 2 deletions

View File

@ -482,7 +482,10 @@ void kmp_stats_output_module::printHeaderInfo(FILE * statsOut)
#if KMP_ARCH_X86 || KMP_ARCH_X86_64
fprintf (statsOut, "# CPU: %s\n", &__kmp_cpuinfo.name[0]);
fprintf (statsOut, "# Family: %d, Model: %d, Stepping: %d\n", __kmp_cpuinfo.family, __kmp_cpuinfo.model, __kmp_cpuinfo.stepping);
fprintf (statsOut, "# Nominal frequency: %sz\n", formatSI(double(__kmp_cpuinfo.frequency),9,'H').c_str());
if (__kmp_cpuinfo.frequency == 0)
fprintf (statsOut, "# Nominal frequency: Unknown\n");
else
fprintf (statsOut, "# Nominal frequency: %sz\n", formatSI(double(__kmp_cpuinfo.frequency),9,'H').c_str());
#endif
}

View File

@ -109,7 +109,7 @@ __kmp_parse_frequency( // R: Frequency in Hz.
double value = 0.0;
char const * unit = NULL;
kmp_uint64 result = ~ 0;
kmp_uint64 result = 0; /* Zero is a better unknown value than all ones. */
if ( frequency == NULL ) {
return result;