lkml.org 
[lkml]   [2009]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 3/4] tracing/filters: Fix MATCH_FRONT_ONLY filter matching
    MATCH_FRONT_ONLY matching works exactly as MATCH_FULL.

    We should pass the length of the pattern to strncmp().

    Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
    ---
    kernel/trace/trace_events_filter.c | 2 +-
    1 files changed, 1 insertions(+), 1 deletions(-)

    diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
    index c8eb1c0..bd492ce 100644
    --- a/kernel/trace/trace_events_filter.c
    +++ b/kernel/trace/trace_events_filter.c
    @@ -262,7 +262,7 @@ static int regex_match_full(char *str, struct regex *r, int len)

    static int regex_match_front(char *str, struct regex *r, int len)
    {
    - if (strncmp(str, r->pattern, len) == 0)
    + if (strncmp(str, r->pattern, r->len) == 0)
    return 1;
    return 0;
    }
    --
    1.6.3


    \
     
     \ /
      Last update: 2009-12-11 11:03    [W:0.025 / U:61.592 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site