adjust output
This commit is contained in:
@@ -21,8 +21,7 @@ struct my_device_data {
|
||||
|
||||
static int device_open(struct inode *inode, struct file *file) {
|
||||
struct my_device_data *data;
|
||||
printk(KERN_INFO "variable_monitor fun: %s with pid %d\n", __FUNCTION__,
|
||||
current->pid);
|
||||
printk(KERN_INFO "variable_monitor open device with pid %d\n", current->pid);
|
||||
// save pid
|
||||
data = kmalloc(sizeof(*data), GFP_KERNEL);
|
||||
if (!data)
|
||||
@@ -35,8 +34,7 @@ static int device_open(struct inode *inode, struct file *file) {
|
||||
static int device_release(struct inode *inode, struct file *file) {
|
||||
// load pid
|
||||
struct my_device_data *data = file->private_data;
|
||||
printk(KERN_INFO "variable_monitor fun: %s with pid %d\n", __FUNCTION__,
|
||||
data->pid);
|
||||
printk(KERN_INFO "variable_monitor release device with pid %d\n", data->pid);
|
||||
// clear watch with pid
|
||||
clear_watch(data->pid);
|
||||
kfree(data); // free data memory
|
||||
|
||||
Reference in New Issue
Block a user