Whamcloud - gitweb
b=11680 Add /proc/sys/lnet/force_lbug
authorRobert Read <rread@sun.com>
Thu, 18 Mar 2010 20:06:54 +0000 (13:06 -0700)
committerRobert Read <rread@sun.com>
Thu, 18 Mar 2010 20:06:54 +0000 (13:06 -0700)
This patch adds a proc entry called force_lbug.

a=Christopher J. Morrone <morrone@llnl.gov>
i=johann

libcfs/libcfs/linux/linux-proc.c

index 553e8f2..a36cf1d 100644 (file)
@@ -104,6 +104,7 @@ enum {
         PSDEV_LNET_DEBUG_MB,      /* size of debug buffer */
         PSDEV_LNET_DEBUG_LOG_UPCALL, /* debug log upcall script */
         PSDEV_LNET_WATCHDOG_RATELIMIT,  /* ratelimit watchdog messages  */
+        PSDEV_LNET_FORCE_LBUG,    /* hook to force an LBUG */
 };
 #else
 #define CTL_LNET                        CTL_UNNUMBERED
@@ -331,6 +332,13 @@ int LL_PROC_PROTO(proc_console_backoff)
         return rc;
 }
 
+int LL_PROC_PROTO(libcfs_force_lbug)
+{
+        if (write)
+                LBUG();
+        return 0;
+}
+
 static cfs_sysctl_table_t lnet_table[] = {
         /*
          * NB No .strategy entries have been provided since sysctl(8) prefers
@@ -472,6 +480,13 @@ static cfs_sysctl_table_t lnet_table[] = {
                 .extra1   = &min_watchdog_ratelimit,
                 .extra2   = &max_watchdog_ratelimit,
         },
+        {       .ctl_name = PSDEV_LNET_FORCE_LBUG,
+                .procname = "force_lbug",
+                .data     = NULL,
+                .maxlen   = 0,
+                .mode     = 0200,
+                .proc_handler = &libcfs_force_lbug
+        },
         {0}
 };