diff options
Diffstat (limited to 'debug.c')
-rw-r--r-- | debug.c | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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; +} + |