diff options
| author | zy <[email protected]> | 2023-11-27 22:22:30 -0500 |
|---|---|---|
| committer | zy <[email protected]> | 2023-11-27 22:22:30 -0500 |
| commit | 5e650478fb4b8ae27f63f584b1dd5c8597fc142a (patch) | |
| tree | 7f1e7f4fc15edd971b14c564b99b992d04e9cbb0 /source/module/monitor_kernel.c | |
| parent | fd459340a717933b5124f686f3c4f2ca0d3f32dc (diff) | |
/proc work
Diffstat (limited to 'source/module/monitor_kernel.c')
| -rw-r--r-- | source/module/monitor_kernel.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/module/monitor_kernel.c b/source/module/monitor_kernel.c index 2d49e2b..1c2ab11 100644 --- a/source/module/monitor_kernel.c +++ b/source/module/monitor_kernel.c @@ -56,7 +56,6 @@ static long device_ioctl(struct file *file, unsigned int ioctl_num, printk(KERN_INFO "variable_monitor fun: %s with ioctl_num %d\n", __FUNCTION__, ioctl_num); - //! todo check style switch (ioctl_num) { case IOCTL_WATCH_VARIABLE: // copy watch_arg @@ -67,7 +66,8 @@ static long device_ioctl(struct file *file, unsigned int ioctl_num, "time_ns=%ld, threshold=%lld\n", warg.task_id, warg.name, warg.ptr, warg.length_byte, warg.time_ns, warg.threshold); - warg.time_ns = warg.time_ns == 0 ? 10000 : warg.time_ns; // default 10us + warg.time_ns = + warg.time_ns == 0 ? def_interval_ns : warg.time_ns; // default 10us // start watch variable start_watch_variable(warg); break; @@ -143,6 +143,9 @@ int init_module(void) { printk(KERN_INFO "dev number: %d\n", dev_num); printk(KERN_INFO "path: /dev/%s %d\n", DEVICE_NAME, dev_num); + // proc + monitor_proc_init(); + // orig_X | buffer monitor_init(); @@ -154,6 +157,9 @@ void cleanup_module(void) { // clear all watch | free buffer monitor_exit(); + // proc + monitor_proc_exit(); + // unmount device_destroy(watch_class, dev_num); class_destroy(watch_class); |
