diff --git a/source/module/monitor_kernel.c b/source/module/monitor_kernel.c index 06c334d..bf0d872 100644 --- a/source/module/monitor_kernel.c +++ b/source/module/monitor_kernel.c @@ -69,7 +69,10 @@ static long device_ioctl(struct file *file, unsigned int ioctl_num, warg.time_ns = warg.time_ns == 0 ? def_interval_ns : warg.time_ns; // default 10us // start watch variable - start_watch_variable(warg); + ret = start_watch_variable(warg); + if (ret) { + printk(KERN_INFO "start_watch_variable failed\n"); + } break; case IOCTL_DUMP_LOG: printk(KERN_INFO "variable_monitor IOCTL_DUMP_LOG\n"); diff --git a/source/module/monitor_kernel_lib.c b/source/module/monitor_kernel_lib.c index 68ed9ad..ade2616 100644 --- a/source/module/monitor_kernel_lib.c +++ b/source/module/monitor_kernel_lib.c @@ -239,7 +239,7 @@ int monitor_init(void) { if (ret) return ret; //!todo - ret = init_buffer(512 * 1024 * 1024); // 512M + ret = init_buffer(256 * 1024 * 1024); // 512M if (ret) return -1; return 0; @@ -284,6 +284,11 @@ int start_watch_variable(watch_arg warg) { w_arg2k_w_arg(kptr, warg, &k_watch_arg); timer = get_timer(warg.time_ns); // get a valuable timer + if (timer == NULL) { + printk(KERN_ERR "Timer is full\n"); + return -1; + } + INIT_WORK(&timer->wk, diag_task_info_work); printk(KERN_INFO "ptr transform kptr: %p\n", kptr);