Whamcloud - gitweb
LU-1282 lprocfs: Add a module param to disable percpu stats
[fs/lustre-release.git] / lustre / obdclass / lprocfs_status.c
index 921f907..1c11c5a 100644 (file)
 
 #if defined(LPROCFS)
 
+static int lprocfs_no_percpu_stats = 0;
+CFS_MODULE_PARM(lprocfs_no_percpu_stats, "i", int, 0644,
+                "Do not alloc percpu data for lprocfs stats");
+
 #define MAX_STRING_SIZE 128
 
 /* for bug 10866, global variable */
@@ -1195,6 +1199,9 @@ struct lprocfs_stats *lprocfs_alloc_stats(unsigned int num,
         if (num == 0)
                 return NULL;
 
+        if (lprocfs_no_percpu_stats != 0)
+                flags |= LPROCFS_STATS_FLAG_NOPERCPU;
+
         if (flags & LPROCFS_STATS_FLAG_NOPERCPU)
                 num_cpu = 1;
         else