Skip to content

Commit

Permalink
USB: snoop processes opening usbfs device files
Browse files Browse the repository at this point in the history
This patch (as1148) adds a new "snoop" message to usbfs when a device
file is opened, identifying the process responsible.  This comes in
extremely handy when trying to determine which program is doing some
unwanted USB access.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Alan Stern authored and Greg Kroah-Hartman committed Oct 17, 2008
1 parent bb78a82 commit 2da41d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ static int usbdev_open(struct inode *inode, struct file *file)
smp_wmb();
list_add_tail(&ps->list, &dev->filelist);
file->private_data = ps;
snoop(&dev->dev, "opened by process %d: %s\n", task_pid_nr(current),
current->comm);
out:
if (ret) {
kfree(ps);
Expand Down

0 comments on commit 2da41d5

Please sign in to comment.