@@ -53,12 +53,14 @@
#define DEFAULT_COUNT 10
-static void lkdtm_handler(void);
static int lkdtm_debugfs_open(struct inode *inode, struct file *file);
static ssize_t lkdtm_debugfs_read(struct file *f, char __user *user_buf,
size_t count, loff_t *off);
static ssize_t direct_entry(struct file *f, const char __user *user_buf,
size_t count, loff_t *off);
+
+#ifdef CONFIG_KPROBES
+static void lkdtm_handler(void);
static ssize_t lkdtm_debugfs_entry(struct file *f,
const char __user *user_buf,
size_t count, loff_t *off);
@@ -128,7 +130,7 @@ static int jp_generic_ide_ioctl(ide_drive_t *drive, struct file *file,
return 0;
}
#endif
-
+#endif
/* Crash points */
struct crashpoint {
@@ -240,7 +242,9 @@ struct crashtype *lkdtm_crashtype;
/* Global crash counter and spinlock. */
static int crash_count = DEFAULT_COUNT;
+#ifdef CONFIG_KPROBES
static DEFINE_SPINLOCK(crash_count_lock);
+#endif
/* Module parameters */
static int recur_count = -1;
@@ -285,6 +289,7 @@ static noinline void lkdtm_do_action(struct crashtype *crashtype)
crashtype->func();
}
+#ifdef CONFIG_KPROBES
/* Called by jprobe entry points. */
static void lkdtm_handler(void)
{
@@ -307,6 +312,7 @@ static void lkdtm_handler(void)
if (do_it)
lkdtm_do_action(lkdtm_crashtype);
}
+#endif
static int lkdtm_register_cpoint(struct crashpoint *crashpoint,
struct crashtype *crashtype)
@@ -337,6 +343,7 @@ static int lkdtm_register_cpoint(struct crashpoint *crashpoint,
return ret;
}
+#ifdef CONFIG_KPROBES
static ssize_t lkdtm_debugfs_entry(struct file *f,
const char __user *user_buf,
size_t count, loff_t *off)
@@ -374,6 +381,7 @@ static ssize_t lkdtm_debugfs_entry(struct file *f,
return count;
}
+#endif
/* Generic read callback that just prints out the available crash types */
static ssize_t lkdtm_debugfs_read(struct file *f, char __user *user_buf,