diff options
| author | zy <[email protected]> | 2023-11-23 18:12:57 +0800 |
|---|---|---|
| committer | zy <[email protected]> | 2023-11-23 18:12:57 +0800 |
| commit | 1df11cd6e4534ac2c2759d29718743ef5ceb6f2b (patch) | |
| tree | 9265db834b7c07934d9cb9c77cf70560aa612d1d /source/module/monitor_kernel.c | |
| parent | 316174b71e7c192f0139b5c294c80b5f2292be51 (diff) | |
add workqueue
Diffstat (limited to 'source/module/monitor_kernel.c')
| -rw-r--r-- | source/module/monitor_kernel.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/source/module/monitor_kernel.c b/source/module/monitor_kernel.c index c6350d4..fd83158 100644 --- a/source/module/monitor_kernel.c +++ b/source/module/monitor_kernel.c @@ -49,7 +49,7 @@ typedef struct { static long device_ioctl(struct file *file, unsigned int ioctl_num, unsigned long ioctl_param) { int ret = 0; - // watch_arg warg; + watch_arg warg; ioctl_dump_param dump_param; ioctl_pid wpid; @@ -58,19 +58,19 @@ static long device_ioctl(struct file *file, unsigned int ioctl_num, ioctl_num); switch (ioctl_num) { - // case 0: - // // copy watch_arg - // if (copy_from_user(&warg, (watch_arg *)ioctl_param, sizeof(warg))) { - // return -EACCES; - // } - // printk(KERN_INFO - // "Watch_arg: task_id=%d, name=%s, ptr=%p, length_byte=%d, " - // "time_ns=%ld, threshold=%lld\n", - // warg.task_id, warg.name, warg.ptr, warg.length_byte, warg.time_ns, - // warg.threshold); - // // start watch variable - // start_watch_variable(warg); - // break; + case 0: + // copy watch_arg + if (copy_from_user(&warg, (watch_arg *)ioctl_param, sizeof(warg))) { + return -EACCES; + } + printk(KERN_INFO + "Watch_arg: task_id=%d, name=%s, ptr=%p, length_byte=%d, " + "time_ns=%ld, threshold=%lld\n", + warg.task_id, warg.name, warg.ptr, warg.length_byte, warg.time_ns, + warg.threshold); + // start watch variable + start_watch_variable(warg); + break; case 1: printk(KERN_INFO "variable_monitor 1\n"); ret = copy_from_user(&dump_param, (ioctl_dump_param *)ioctl_param, @@ -86,16 +86,16 @@ static long device_ioctl(struct file *file, unsigned int ioctl_num, } printk(KERN_INFO "copy_to_user \n"); break; - case 0: - printk(KERN_INFO "variable_monitor test 2\n"); - ret = copy_from_user(&wpid, (ioctl_pid *)ioctl_param, sizeof(ioctl_pid)); - diag_test(wpid.pid); - /* code */ - break; + // case 0: + // printk(KERN_INFO "variable_monitor test 2\n"); + // ret = copy_from_user(&wpid, (ioctl_pid *)ioctl_param, sizeof(ioctl_pid)); + // diag_test(wpid.pid); + // /* code */ + // break; default: - printk(KERN_INFO "variable_monitor test default\n"); - ret = copy_from_user(&wpid, (ioctl_pid *)ioctl_param, sizeof(ioctl_pid)); - diag_test(wpid.pid); + // printk(KERN_INFO "variable_monitor test default\n"); + // ret = copy_from_user(&wpid, (ioctl_pid *)ioctl_param, sizeof(ioctl_pid)); + // diag_test(wpid.pid); break; } return 0; |
