summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzy <[email protected]>2023-11-17 01:59:41 -0500
committerzy <[email protected]>2023-11-17 01:59:41 -0500
commit91f573d5f7a114e4d5bb1341a5e284207bd728bb (patch)
treec46374ee17725e48fb33dd0cf3ca702d54e5a6fd
parentf47a39b2d7738c848f4555aeb93620b53e93de93 (diff)
temp
-rw-r--r--source/module/monitor_kernel.c4
-rw-r--r--source/module/monitor_kernel_lib.c2
-rw-r--r--testcase/helloworld.c4
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
+}