Re: [RFC][PATCH 07/10] tracing: Have zero size length in filter logic be full string

2018-05-14 Thread Steven Rostedt
On Sat, 12 May 2018 20:32:18 +0200 Yann Ylavic wrote: > On Fri, May 11, 2018 at 9:49 PM, Steven Rostedt wrote: > [] > > > > static int regex_match_front(char *str, struct regex *r, int len) > > { > > - if (len < r->len) > > + if (len && len < r->len) > > return 0; >

Re: [RFC][PATCH 07/10] tracing: Have zero size length in filter logic be full string

2018-05-13 Thread Namhyung Kim
Hi, On Sat, May 12, 2018 at 08:32:18PM +0200, Yann Ylavic wrote: > On Fri, May 11, 2018 at 9:49 PM, Steven Rostedt wrote: > [] > > > > static int regex_match_front(char *str, struct regex *r, int len) > > { > > - if (len < r->len) > > + if (len && len < r->len) > > r

Re: [RFC][PATCH 07/10] tracing: Have zero size length in filter logic be full string

2018-05-12 Thread Yann Ylavic
On Fri, May 11, 2018 at 9:49 PM, Steven Rostedt wrote: [] > > static int regex_match_front(char *str, struct regex *r, int len) > { > - if (len < r->len) > + if (len && len < r->len) > return 0; > > - if (strncmp(str, r->pattern, r->len) == 0) > -

Re: [RFC][PATCH 07/10] tracing: Have zero size length in filter logic be full string

2018-05-12 Thread Steven Rostedt
On Sat, 12 May 2018 21:40:29 +0900 Masami Hiramatsu wrote: > > static int regex_match_full(char *str, struct regex *r, int len) > > { > > - if (strncmp(str, r->pattern, len) == 0) > > - return 1; > > - return 0; > > + /* len means str is dynamic and ends with '\0' */ >

Re: [RFC][PATCH 07/10] tracing: Have zero size length in filter logic be full string

2018-05-12 Thread Masami Hiramatsu
On Fri, 11 May 2018 15:49:34 -0400 Steven Rostedt wrote: > From: "Steven Rostedt (VMware)" > > As strings in trace events may not have a nul terminating character, the > filter string compares use the defined string length for the field for the > compares. > > The trace_marker records data sli

[RFC][PATCH 07/10] tracing: Have zero size length in filter logic be full string

2018-05-11 Thread Steven Rostedt
From: "Steven Rostedt (VMware)" As strings in trace events may not have a nul terminating character, the filter string compares use the defined string length for the field for the compares. The trace_marker records data slightly different than do normal events. It's size is zero, meaning that th