temp
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user