[RFC] [PATCH 2.6.37-rc5-tip 4/20] 4: uprobes: Adding and remove a uprobe in a rb tree.
Peter Zijlstra
peterz@infradead.org
Tue Jan 25 12:15:00 GMT 2011
On Thu, 2010-12-16 at 15:28 +0530, Srikar Dronamraju wrote:
> +/* Acquires uprobes_mutex */
Requires? afaict uprobes_mutex isn't actually used anywhere in this
patch.
Its use is added in the next patch.
> +static struct uprobe *uprobes_add(struct inode *inode,
> + unsigned long offset)
> +{
> + struct uprobe *uprobe, *cur_uprobe;
> +
> + __iget(inode);
> + uprobe = kzalloc(sizeof(struct uprobe), GFP_KERNEL);
> +
> + if (!uprobe) {
> + iput(inode);
> + return NULL;
> + }
> + uprobe->inode = inode;
> + uprobe->offset = offset;
> +
> + /* add to uprobes_tree, sorted on inode:offset */
> + cur_uprobe = insert_uprobe_rb_node(uprobe);
> +
> + /* a uprobe exists for this inode:offset combination*/
> + if (cur_uprobe) {
> + kfree(uprobe);
> + uprobe = cur_uprobe;
> + iput(inode);
> + } else
> + init_rwsem(&uprobe->consumer_rwsem);
> +
> + return uprobe;
> +}
More information about the Systemtap
mailing list