[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1383262255.2769.11.camel@joe-AO722>
Date: Thu, 31 Oct 2013 16:30:55 -0700
From: Joe Perches <joe@...ches.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: "Du, Changbin" <changbin.du@...il.com>, jbaron@...mai.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] dynamic_debug: add wildcard support to filter
files/functions/modules
On Thu, 2013-10-31 at 15:52 -0700, Andrew Morton wrote:
> On Mon, 28 Oct 2013 23:29:10 +0800 "Du, Changbin" <changbin.du@...il.com> wrote:
[]
> > +/* check if the string matches given pattern which includes wildcards */
> > +static int match_pattern(const char *pattern, const char *string)
[]
> No, something like this should be in lib/ so that other callers can use
> it. We already have at least one copy handy in
> drivers/ata/libata-core.c:glob_match(). A better approach would be to
> move that glob_match() into lib/glob_match.c then teach dynamic_debug
> to use it.
>
> There are probably other private globbing functions lying around the
> kernel, but it's rather a hard thing to grep for...
Maybe use lib/parser.c where the other match_<foo> functions
are already.
match_glob has the disadvantage that it's recursive too.
trace has:
kernel/trace/trace_events_filter.c:static int regex_match_full(char *str, struct regex *r, int len)
kernel/trace/trace_events_filter.c:static int regex_match_front(char *str, struct regex *r, int len)
kernel/trace/trace_events_filter.c:static int regex_match_middle(char *str, struct regex *r, int len)
kernel/trace/trace_events_filter.c:static int regex_match_end(char *str, struct regex *r, int len)
but there probably aren't many more that could be converted.
--
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