[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 6/6] trace: replace hand-crafted pattern_glob with g_patt
Re: [PATCH v2 6/6] trace: replace hand-crafted pattern_glob with g_pattern_match_simple
Fri, 06 Dec 2019 11:59:01 +0000
mu4e 1.3.5; emacs 27.0.50
Stefan Hajnoczi <address@hidden> writes:
> On Thu, Dec 05, 2019 at 12:25:17PM +0000, Alex Bennée wrote:
>> We already use g_pattern_match elsewhere so remove the duplication.
>> Signed-off-by: Alex Bennée <address@hidden>
>> trace/control.c | 35 +----------------------------------
>> 1 file changed, 1 insertion(+), 34 deletions(-)
> Is g_pattern_match() a superset of pattern_glob()? Existing patterns
> should continue to work.
Yes - it supports more than pattern_glob and a bit less than the system
The g_pattern_match* functions match a string against a pattern
containing '*' and '?' wildcards with similar semantics as the standard
glob() function: '*' matches an arbitrary, possibly empty, string, '?'
matches an arbitrary character.
Note that in contrast to glob(), the '/' character can be matched by the
wildcards, there are no '[...]' character ranges and '*' and '?' can not
be escaped to include them literally in a pattern.
If you give me some example existing pattern forms we can add them to
test-logging. I manually tested both single and double * patterns while
working on the rest of the series.
[PATCH v2 3/6] linux-user: add target_mmap_complete tracepoint, Alex Bennée, 2019/12/05
- Re: [PATCH v2 2/6] linux-user: convert target_mmap debug to tracepoint, (continued)