diff options
author | Stefan Held <stefan_held@mentor.com> | 2015-06-24 15:50:04 +0200 |
---|---|---|
committer | Alexander Wenzel <Alexander.AW.Wenzel@bmw.de> | 2015-07-21 12:47:02 +0200 |
commit | fb8cb3735e3b69695289f0ddb8917c1f425a402a (patch) | |
tree | 67b1e00f002cd2e8ca7b61db054b42fe5218e168 /tests/mod_system_logger/mod_system_logger.c | |
parent | ed0e6711ce3e2937de348a1475d70f9d41bcd487 (diff) | |
download | DLT-daemon-fb8cb3735e3b69695289f0ddb8917c1f425a402a.tar.gz |
Add start_system_logger_test.sh Modify start_filetransfer_test.sh Modify start_systemd_journal_test.sh
Signed-off-by: Stefan Held <stefan_held@mentor.com>
Signed-off-by: Alexander Wenzel <Alexander.AW.Wenzel@bmw.de>
Diffstat (limited to 'tests/mod_system_logger/mod_system_logger.c')
-rw-r--r-- | tests/mod_system_logger/mod_system_logger.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/mod_system_logger/mod_system_logger.c b/tests/mod_system_logger/mod_system_logger.c new file mode 100644 index 0000000..1d31fdb --- /dev/null +++ b/tests/mod_system_logger/mod_system_logger.c @@ -0,0 +1,36 @@ +#include <linux/module.h> +#include <linux/proc_fs.h> +#include <linux/seq_file.h> + +int i; + +static int system_proc_show(struct seq_file *m, void *v) { + for(i=0; i<1000; i++) + seq_printf(m, "Test Systemlogger %i\n",i); + return 0; +} + +static int system_proc_open(struct inode *inode, struct file *file) { + return single_open(file, system_proc_show, NULL); +} + +static const struct file_operations system_proc_fops = { + .owner = THIS_MODULE, + .open = system_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +static int __init system_proc_init(void) { + proc_create("systemlogger", 0, NULL, &system_proc_fops); + return 0; +} + +static void __exit system_proc_exit(void) { + remove_proc_entry("systemlogger", NULL); +} + +MODULE_LICENSE("GPL"); +module_init(system_proc_init); +module_exit(system_proc_exit); |