[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1311630170-26057-14-git-send-email-jim.cromie@gmail.com>
Date: Mon, 25 Jul 2011 15:42:38 -0600
From: Jim Cromie <jim.cromie@...il.com>
To: jbaron@...hat.com
Cc: bvanassche@....org, joe@...ches.com, gregkh@...e.de,
linux-kernel@...r.kernel.org, gnb@...h.org,
Jim Cromie <jim.cromie@...il.com>
Subject: [PATCH 13/25] dynamic_debug: apply_pending_queries() from ddebug_add_module()
When a module is loaded, ddebug_add_module calls apply_pending_queries
to scan pending_queries list and call ddebug_change to apply them.
Pending queries remain on the list after they're applied, so they
persist through modprobe-rmmod cycles during debugging.
With this change, the loaded module's pr_debugs are enabled when
its module_init is invoked, which is not possible otherwize.
Signed-off-by: Jim Cromie <jim.cromie@...il.com>
---
lib/dynamic_debug.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c
index 4135bf5..7e4f919 100644
--- a/lib/dynamic_debug.c
+++ b/lib/dynamic_debug.c
@@ -866,6 +866,21 @@ static const struct file_operations ddebug_proc_fops = {
.write = ddebug_proc_write
};
+/* apply matching queries in pending-queries list */
+static void apply_pending_queries(struct ddebug_table *dt)
+{
+ struct pending_query *pq, *pqnext;
+ int nfound;
+ char *qstr;
+
+ list_for_each_entry_safe(pq, pqnext, &pending_queries, link) {
+ nfound = ddebug_change(&pq->query, pq->flags, pq->mask);
+ qstr = show_pending_query(pq);
+ pr_debug("%s: %s\n", (nfound) ? "applied" : "no-match", qstr);
+ kfree(qstr);
+ }
+}
+
/*
* Allocate a new ddebug_table for the given module
* and add it to the global list.
@@ -890,6 +905,7 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n,
mutex_lock(&ddebug_lock);
list_add_tail(&dt->link, &ddebug_tables);
+ apply_pending_queries(dt);
mutex_unlock(&ddebug_lock);
if (verbose)
--
1.7.4.1
--
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