[Fwd: Fw: [PATCH] PURR data on iSeries Linux]

Jeff Scheel scheel at vnet.ibm.com
Thu Nov 11 08:22:03 EST 2004


Got one additional suggestion from Will Schmidt on including the version 
in the iSeries lparcfg data.

I've included that and attached a new patch.
-Jeff

Signed-off by: Jeff Scheel (scheel at vnet.ibm.com)

--- linuxppc-2.6.10_rc1.orig/arch/ppc64/kernel/lparcfg.c    2004-11-09 
07:03:43.354383000 -0600
+++ linuxppc-2.6.10_rc1/arch/ppc64/kernel/lparcfg.c    2004-11-10 
10:38:47.904484533 -0600
@@ -34,7 +34,7 @@
 #include <asm/rtas.h>
 #include <asm/system.h>
 
-#define MODULE_VERS "1.4"
+#define MODULE_VERS "1.5"
 #define MODULE_NAME "lparcfg"
 
 /* #define LPARCFG_DEBUG */
@@ -70,6 +70,28 @@
 
 #ifdef CONFIG_PPC_ISERIES
 
+/*
+ * For iSeries legacy systems, the PPA purr function is available from the
+ * xEmulatedTimeBase field in the paca.
+ */
+static unsigned long get_purr(void)
+{
+    unsigned long sum_purr = 0;
+    int cpu;
+    struct paca_struct *lpaca;
+
+    for_each_cpu(cpu) {
+        lpaca = paca + cpu;
+        sum_purr += lpaca->xLpPaca.xEmulatedTimeBase;
+
+#ifdef PURR_DEBUG
+        printk(KERN_INFO "get_purr for cpu (%d) has value (%ld) \n",
+            cpu, lpaca->xLpPaca.xEmulatedTimeBase);
+#endif
+    }
+    return sum_purr;
+}
+
 #define lparcfg_write NULL
 
 /*
@@ -81,6 +103,9 @@
     int shared, entitled_capacity, max_entitled_capacity;
     int processors, max_processors;
     struct paca_struct *lpaca = get_paca();
+    unsigned long purr = get_purr();
+
+    seq_printf(m, "%s %s \n", MODULE_NAME, MODULE_VERS);
 
     shared = (int)(lpaca->lppaca_ptr->xSharedProc);
     seq_printf(m, "serial_number=%c%c%c%c%c%c%c\n",
@@ -131,6 +156,7 @@
         seq_printf(m, "pool_capacity=%d\n",
                (int)(HvLpConfig_getNumProcsInSharedPool(pool_id) *
                  100));
+        seq_printf(m, "purr=%ld\n", purr);
     }
 
     seq_printf(m, "shared_processor_mode=%d\n", shared);



More information about the Linuxppc64-dev mailing list