diff options
Diffstat (limited to 'lib/dynamic_debug.c')
-rw-r--r-- | lib/dynamic_debug.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index c37aeacd7651..600ac57e2777 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * By Greg Banks <gnb@melbourne.sgi.com> | 8 | * By Greg Banks <gnb@melbourne.sgi.com> |
9 | * Copyright (c) 2008 Silicon Graphics Inc. All Rights Reserved. | 9 | * Copyright (c) 2008 Silicon Graphics Inc. All Rights Reserved. |
10 | * Copyright (C) 2011 Bart Van Assche. All Rights Reserved. | 10 | * Copyright (C) 2011 Bart Van Assche. All Rights Reserved. |
11 | * Copyright (C) 2013 Du, Changbin <changbin.du@gmail.com> | ||
11 | */ | 12 | */ |
12 | 13 | ||
13 | #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ | 14 | #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__ |
@@ -24,6 +25,7 @@ | |||
24 | #include <linux/sysctl.h> | 25 | #include <linux/sysctl.h> |
25 | #include <linux/ctype.h> | 26 | #include <linux/ctype.h> |
26 | #include <linux/string.h> | 27 | #include <linux/string.h> |
28 | #include <linux/parser.h> | ||
27 | #include <linux/string_helpers.h> | 29 | #include <linux/string_helpers.h> |
28 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
29 | #include <linux/dynamic_debug.h> | 31 | #include <linux/dynamic_debug.h> |
@@ -147,7 +149,8 @@ static int ddebug_change(const struct ddebug_query *query, | |||
147 | list_for_each_entry(dt, &ddebug_tables, link) { | 149 | list_for_each_entry(dt, &ddebug_tables, link) { |
148 | 150 | ||
149 | /* match against the module name */ | 151 | /* match against the module name */ |
150 | if (query->module && strcmp(query->module, dt->mod_name)) | 152 | if (query->module && |
153 | !match_wildcard(query->module, dt->mod_name)) | ||
151 | continue; | 154 | continue; |
152 | 155 | ||
153 | for (i = 0; i < dt->num_ddebugs; i++) { | 156 | for (i = 0; i < dt->num_ddebugs; i++) { |
@@ -155,14 +158,16 @@ static int ddebug_change(const struct ddebug_query *query, | |||
155 | 158 | ||
156 | /* match against the source filename */ | 159 | /* match against the source filename */ |
157 | if (query->filename && | 160 | if (query->filename && |
158 | strcmp(query->filename, dp->filename) && | 161 | !match_wildcard(query->filename, dp->filename) && |
159 | strcmp(query->filename, kbasename(dp->filename)) && | 162 | !match_wildcard(query->filename, |
160 | strcmp(query->filename, trim_prefix(dp->filename))) | 163 | kbasename(dp->filename)) && |
164 | !match_wildcard(query->filename, | ||
165 | trim_prefix(dp->filename))) | ||
161 | continue; | 166 | continue; |
162 | 167 | ||
163 | /* match against the function */ | 168 | /* match against the function */ |
164 | if (query->function && | 169 | if (query->function && |
165 | strcmp(query->function, dp->function)) | 170 | !match_wildcard(query->function, dp->function)) |
166 | continue; | 171 | continue; |
167 | 172 | ||
168 | /* match against the format */ | 173 | /* match against the format */ |