Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-15 Thread Jiri Olsa
On Fri, Jun 15, 2018 at 11:09:05AM +0200, Thomas-Mich Richter wrote: > On 06/15/2018 10:12 AM, Jiri Olsa wrote: > > On Thu, Jun 14, 2018 at 08:53:14AM -0500, Paul Clarke wrote: > > > > SNIP > > > >>> + if (ret) > >>> + ret += scnprintf(newval + ret, sizeof(newval) - ret,

Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-15 Thread Jiri Olsa
On Fri, Jun 15, 2018 at 11:09:05AM +0200, Thomas-Mich Richter wrote: > On 06/15/2018 10:12 AM, Jiri Olsa wrote: > > On Thu, Jun 14, 2018 at 08:53:14AM -0500, Paul Clarke wrote: > > > > SNIP > > > >>> + if (ret) > >>> + ret += scnprintf(newval + ret, sizeof(newval) - ret,

Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-15 Thread Thomas-Mich Richter
On 06/15/2018 10:12 AM, Jiri Olsa wrote: > On Thu, Jun 14, 2018 at 08:53:14AM -0500, Paul Clarke wrote: > > SNIP > >>> + if (ret) >>> + ret += scnprintf(newval + ret, sizeof(newval) - ret, >>> +","); >>> + if

Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-15 Thread Thomas-Mich Richter
On 06/15/2018 10:12 AM, Jiri Olsa wrote: > On Thu, Jun 14, 2018 at 08:53:14AM -0500, Paul Clarke wrote: > > SNIP > >>> + if (ret) >>> + ret += scnprintf(newval + ret, sizeof(newval) - ret, >>> +","); >>> + if

Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-15 Thread Jiri Olsa
On Thu, Jun 14, 2018 at 08:53:14AM -0500, Paul Clarke wrote: SNIP > > + if (ret) > > + ret += scnprintf(newval + ret, sizeof(newval) - ret, > > +","); > > + if (term->type_val == PARSE_EVENTS__TERM_TYPE_NUM) > > +

Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-15 Thread Jiri Olsa
On Thu, Jun 14, 2018 at 08:53:14AM -0500, Paul Clarke wrote: SNIP > > + if (ret) > > + ret += scnprintf(newval + ret, sizeof(newval) - ret, > > +","); > > + if (term->type_val == PARSE_EVENTS__TERM_TYPE_NUM) > > +

Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-14 Thread Thomas-Mich Richter
On 06/14/2018 03:53 PM, Paul Clarke wrote: > On 06/14/2018 06:48 AM, Thomas Richter wrote: >> PMU alias definitions in sysfs files may have spaces, newlines >> and number with leading zeroes. Same alias definitions may >> also appear in JSON files without spaces, etc. >> >> Scan alias definitions

Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-14 Thread Thomas-Mich Richter
On 06/14/2018 03:53 PM, Paul Clarke wrote: > On 06/14/2018 06:48 AM, Thomas Richter wrote: >> PMU alias definitions in sysfs files may have spaces, newlines >> and number with leading zeroes. Same alias definitions may >> also appear in JSON files without spaces, etc. >> >> Scan alias definitions

Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-14 Thread Paul Clarke
On 06/14/2018 06:48 AM, Thomas Richter wrote: > PMU alias definitions in sysfs files may have spaces, newlines > and number with leading zeroes. Same alias definitions may > also appear in JSON files without spaces, etc. > > Scan alias definitions and remove leading zeroes, spaces, > newlines,

Re: [PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-14 Thread Paul Clarke
On 06/14/2018 06:48 AM, Thomas Richter wrote: > PMU alias definitions in sysfs files may have spaces, newlines > and number with leading zeroes. Same alias definitions may > also appear in JSON files without spaces, etc. > > Scan alias definitions and remove leading zeroes, spaces, > newlines,

[PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-14 Thread Thomas Richter
PMU alias definitions in sysfs files may have spaces, newlines and number with leading zeroes. Same alias definitions may also appear in JSON files without spaces, etc. Scan alias definitions and remove leading zeroes, spaces, newlines, etc and rebuild string to make alias->str member comparable.

[PATCH 2/3] perf alias: Rebuild alias expression string to make it comparable

2018-06-14 Thread Thomas Richter
PMU alias definitions in sysfs files may have spaces, newlines and number with leading zeroes. Same alias definitions may also appear in JSON files without spaces, etc. Scan alias definitions and remove leading zeroes, spaces, newlines, etc and rebuild string to make alias->str member comparable.