summaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/debug.c b/debug.c
index ab0add8..c1d4529 100644
--- a/debug.c
+++ b/debug.c
@@ -105,3 +105,22 @@ int hello_debugfs_destroy(struct dentry *dir, struct dentry *file)
return 0;
}
+/*
+ * Function implementing a read on /proc/hellomem, here we print few fields
+ * from internal data structure
+ */
+int hello_read_procmem(char *page, char **start, off_t off, int count, int *eof, void *data)
+{
+ int len = 0;
+
+ struct hello_dev *dev = (struct hello_dev *) data;
+
+ len = sprintf(page, "hello module internal buffer is at: %p, with index of: %lu, "
+ "buffer starts with: %c\n", dev->hello_buffer, dev->buff_index,
+ dev->hello_buffer[0]);
+
+ *eof = 1; /* signify that we're done with dumping our internal structure */
+
+ return len;
+}
+