[Crash-utility] Patch to fix Incorrect Incorrect Processor speed in x86_64

Sharyathi Nagesh sharyath at in.ibm.com
Fri Mar 24 12:47:10 UTC 2006


This is a patch to fix incorrect Processor speed being displayed on
dumps taken over x86_64 machines. Please review and let me know of your
views...


--- crash-4.0-2.21.old/x86_64.c 2006-02-15 04:10:02.000000000 +0530
+++ crash-4.0-2.21/x86_64.c     2006-03-23 11:22:43.000000000 +0530
@@ -1044,13 +1044,13 @@ x86_64_is_task_addr(ulong task)
 static ulong
 x86_64_processor_speed(void)
 {
-        unsigned long cpu_khz;
+        unsigned long cpu_khz=0;
 
         if (machdep->mhz)
                 return (machdep->mhz);
 
         if (symbol_exists("cpu_khz")) {
-                get_symbol_data("cpu_khz", sizeof(long), &cpu_khz);
+                get_symbol_data("cpu_khz", sizeof(int), &cpu_khz);
                 if (cpu_khz)
                         return(machdep->mhz = cpu_khz/1000);
         }




More information about the Crash-utility mailing list