From 91f573d5f7a114e4d5bb1341a5e284207bd728bb Mon Sep 17 00:00:00 2001 From: zy Date: Fri, 17 Nov 2023 01:59:41 -0500 Subject: [PATCH] temp --- source/module/monitor_kernel.c | 4 ++-- source/module/monitor_kernel_lib.c | 2 +- testcase/helloworld.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/module/monitor_kernel.c b/source/module/monitor_kernel.c index b6cd892..af5d069 100644 --- a/source/module/monitor_kernel.c +++ b/source/module/monitor_kernel.c @@ -21,7 +21,7 @@ struct my_device_data { static int device_open(struct inode *inode, struct file *file) { struct my_device_data *data; - printk(KERN_INFO "%s: with pid %d\n", __FUNCTION__, current->pid); + printk(KERN_INFO "variable_monitor fun: %s with pid %d\n", __FUNCTION__, current->pid); // save pid data = kmalloc(sizeof(*data), GFP_KERNEL); if (!data) @@ -32,9 +32,9 @@ static int device_open(struct inode *inode, struct file *file) { } static int device_release(struct inode *inode, struct file *file) { - // printk(KERN_INFO "%s\n", __FUNCTION__); // load pid struct my_device_data *data = file->private_data; + printk(KERN_INFO "variable_monitor fun: %s with pid %d\n", __FUNCTION__, data->pid); // clear watch with pid clear_watch(data->pid); kfree(data); // free data memory diff --git a/source/module/monitor_kernel_lib.c b/source/module/monitor_kernel_lib.c index 532fdb5..0f30ee9 100644 --- a/source/module/monitor_kernel_lib.c +++ b/source/module/monitor_kernel_lib.c @@ -161,7 +161,7 @@ int start_watch_variable(watch_arg warg) { * @param pid */ void clear_watch(pid_t pid) { - printk(KERN_INFO "clear pid %d 's watch variable\n", pid); + printk(KERN_INFO "Clear pid: %d's watch variable\n", pid); cancel_all_hrTimer(); // just in case del_all_kwarg_by_pid(pid); // delete all kwarg with pid free_page_list(pid); // free page with pid diff --git a/testcase/helloworld.c b/testcase/helloworld.c index ae75db5..50eaea6 100644 --- a/testcase/helloworld.c +++ b/testcase/helloworld.c @@ -22,7 +22,7 @@ int main() .ptr = &temps[i], .name = "temp", .length_byte = sizeof(int), - .threshold = 150 + i, + .threshold = 110 + i, .unsigned_flag = 0, .greater_flag = 1, .time_ns = 2000 + (i / 33) * 5000, // on hyper-v, 1us will block all system. 2us just fine, maybe 1us is too short for hyper-v @@ -48,4 +48,4 @@ int main() cancel_watch(); return 0; -} \ No newline at end of file +}