Re: [PATCH 11/18] perf metric: Add referenced metrics to hash data

2020-07-17 Thread Jiri Olsa
On Wed, Jul 15, 2020 at 11:36:09PM +0200, Jiri Olsa wrote: > On Wed, Jul 15, 2020 at 11:25:14AM -0700, Ian Rogers wrote: > > On Sun, Jul 12, 2020 at 6:27 AM Jiri Olsa wrote: > > SNIP > > > > +int expr__add_ref(struct expr_parse_ctx *ctx, struct metric_ref *ref) > > > +{ > > > + struct expr

Re: [PATCH 11/18] perf metric: Add referenced metrics to hash data

2020-07-15 Thread Jiri Olsa
On Wed, Jul 15, 2020 at 11:25:14AM -0700, Ian Rogers wrote: > On Sun, Jul 12, 2020 at 6:27 AM Jiri Olsa wrote: SNIP > > +int expr__add_ref(struct expr_parse_ctx *ctx, struct metric_ref *ref) > > +{ > > + struct expr_id_data *data_ptr = NULL, *old_data = NULL; > > + char *old_key = NU

Re: [PATCH 11/18] perf metric: Add referenced metrics to hash data

2020-07-15 Thread Ian Rogers
On Sun, Jul 12, 2020 at 6:27 AM Jiri Olsa wrote: > > Adding referenced metrics to the parsing context so they > can be resolved during the metric processing. > > Adding expr__add_ref function to store referenced metrics > into parse context. > > Signed-off-by: Jiri Olsa > --- > tools/perf/util/e

Re: [PATCH 11/18] perf metric: Add referenced metrics to hash data

2020-07-13 Thread Jiri Olsa
On Mon, Jul 13, 2020 at 05:27:53PM +0100, John Garry wrote: > On 12/07/2020 14:26, Jiri Olsa wrote: > > +int expr__add_ref(struct expr_parse_ctx *ctx, struct metric_ref *ref) > > +{ > > + struct expr_id_data *data_ptr = NULL, *old_data = NULL; > > + char *old_key = NULL; > > + char *name; > >

Re: [PATCH 11/18] perf metric: Add referenced metrics to hash data

2020-07-13 Thread John Garry
On 12/07/2020 14:26, Jiri Olsa wrote: +int expr__add_ref(struct expr_parse_ctx *ctx, struct metric_ref *ref) +{ + struct expr_id_data *data_ptr = NULL, *old_data = NULL; + char *old_key = NULL; + char *name; + int ret; + + data_ptr = zalloc(sizeof(*data_ptr)); +

[PATCH 11/18] perf metric: Add referenced metrics to hash data

2020-07-12 Thread Jiri Olsa
Adding referenced metrics to the parsing context so they can be resolved during the metric processing. Adding expr__add_ref function to store referenced metrics into parse context. Signed-off-by: Jiri Olsa --- tools/perf/util/expr.c| 35 +++ tools/perf/ut