[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20101216100035.23751.82055.sendpatchset@localhost6.localdomain6>
Date: Thu, 16 Dec 2010 15:30:35 +0530
From: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...e.hu>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
Linux-mm <linux-mm@...r.kernel.org>,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Christoph Hellwig <hch@...radead.org>,
Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>,
Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
SystemTap <systemtap@...rces.redhat.com>,
Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Andi Kleen <andi@...stfloor.org>,
LKML <linux-kernel@...r.kernel.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: [RFC] [PATCH 2.6.37-rc5-tip 17/20] 17: uprobes: filter chain
Loops through the filters callbacks of currently registered
consumers to see if any consumer is interested in tracing this task.
Signed-off-by: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
---
kernel/uprobes.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/kernel/uprobes.c b/kernel/uprobes.c
index 93a3118..b0d323c 100644
--- a/kernel/uprobes.c
+++ b/kernel/uprobes.c
@@ -429,6 +429,24 @@ static void handler_chain(struct uprobe *uprobe, struct pt_regs *regs)
}
/* Acquires uprobe->consumer_rwsem */
+static bool filter_chain(struct uprobe *uprobe, struct task_struct *t)
+{
+ struct uprobe_consumer *consumer;
+ bool ret = false;
+
+ down_read(&uprobe->consumer_rwsem);
+ for (consumer = uprobe->consumers; consumer;
+ consumer = consumer->next) {
+ if (!consumer->filter || consumer->filter(consumer, t)) {
+ ret = true;
+ break;
+ }
+ }
+ up_read(&uprobe->consumer_rwsem);
+ return ret;
+}
+
+/* Acquires uprobe->consumer_rwsem */
static void add_consumer(struct uprobe *uprobe,
struct uprobe_consumer *consumer)
{
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists