diff options
author | Kyle K <kylek389@gmail.com> | 2013-01-22 21:24:28 -0600 |
---|---|---|
committer | Kyle Kaminski <kyle@kkaminsk.com> | 2013-01-22 21:24:28 -0600 |
commit | 8fdd43b49af70fd8712116b31010c032301a96b4 (patch) | |
tree | 0c26a12a33b77ca6ff79ca64b99e3ebb42c62b6b /debug.c | |
parent | 9618a5e3d3104dc92223f7a51283e603cce31628 (diff) | |
download | kernelhello-8fdd43b49af70fd8712116b31010c032301a96b4.tar.gz kernelhello-8fdd43b49af70fd8712116b31010c032301a96b4.tar.bz2 kernelhello-8fdd43b49af70fd8712116b31010c032301a96b4.zip |
place a simple /proc, support debug build with Makefile
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; +} + |