Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-27 Thread kajoljain
On 8/26/20 5:29 PM, Jiri Olsa wrote: > On Wed, Aug 26, 2020 at 05:02:04PM +0530, kajoljain wrote: >> >> >> On 8/26/20 4:26 PM, Jiri Olsa wrote: >>> On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: >>> >>> SNIP >>> { /* try to find matching event from arch standard values

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-27 Thread kajoljain
On 8/26/20 5:03 PM, John Garry wrote: > On 26/08/2020 12:24, kajoljain wrote: >> >> >> On 8/26/20 4:30 PM, Jiri Olsa wrote: >>> On Tue, Aug 25, 2020 at 09:14:11AM +0100, John Garry wrote: >>> >>> SNIP >>> >    goto free_strings; >    } > -    err = func(da

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread kajoljain
On 8/26/20 4:30 PM, Jiri Olsa wrote: > On Tue, Aug 25, 2020 at 09:14:11AM +0100, John Garry wrote: > > SNIP > >>> goto free_strings; >>> } >>> - err = func(data, name, real_event(name, event), desc, long_desc, >>> - pmu, un

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread Jiri Olsa
On Wed, Aug 26, 2020 at 05:02:04PM +0530, kajoljain wrote: > > > On 8/26/20 4:26 PM, Jiri Olsa wrote: > > On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: > > > > SNIP > > > >> { > >>/* try to find matching event from arch standard values */ > >>struct event_struct *es; > >>

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread kajoljain
On 8/26/20 4:27 PM, Jiri Olsa wrote: > On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: > > SNIP > >> } >> } >> >> -static int save_arch_std_events(void *data, char *name, char *event, >> -char *desc, char *long_desc, char *pmu, >> -

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread John Garry
On 26/08/2020 12:24, kajoljain wrote: On 8/26/20 4:30 PM, Jiri Olsa wrote: On Tue, Aug 25, 2020 at 09:14:11AM +0100, John Garry wrote: SNIP goto free_strings; } - err = func(data, name, real_event(name, event), desc, long_desc, -

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread kajoljain
On 8/26/20 4:26 PM, Jiri Olsa wrote: > On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: > > SNIP > >> { >> /* try to find matching event from arch standard values */ >> struct event_struct *es; >> @@ -498,8 +486,7 @@ try_fixup(const char *fn, char *arch_std, char **event,

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread kajoljain
On 8/25/20 9:17 PM, Andi Kleen wrote: > On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: >> This patch adds new structure called 'json_event' inside jevents.h >> file to improve the callback prototype inside jevent files. >> Initially, whenever user want to add new field, they need to

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread kajoljain
On 8/26/20 4:27 PM, Jiri Olsa wrote: > On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: > > SNIP > >> diff --git a/tools/perf/pmu-events/jevents.h >> b/tools/perf/pmu-events/jevents.h >> index 2afc8304529e..e696edf70e9a 100644 >> --- a/tools/perf/pmu-events/jevents.h >> +++ b/tools

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread Jiri Olsa
On Tue, Aug 25, 2020 at 09:14:11AM +0100, John Garry wrote: SNIP > > goto free_strings; > > } > > - err = func(data, name, real_event(name, event), desc, long_desc, > > - pmu, unit, perpkg, metric_expr, metric_name, > > -

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread Jiri Olsa
On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: SNIP > diff --git a/tools/perf/pmu-events/jevents.h b/tools/perf/pmu-events/jevents.h > index 2afc8304529e..e696edf70e9a 100644 > --- a/tools/perf/pmu-events/jevents.h > +++ b/tools/perf/pmu-events/jevents.h > @@ -2,14 +2,28 @@ > #ifnde

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread Jiri Olsa
On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: SNIP > } > } > > -static int save_arch_std_events(void *data, char *name, char *event, > - char *desc, char *long_desc, char *pmu, > - char *unit, char *perpkg, char *metri

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-26 Thread Jiri Olsa
On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: SNIP > { > /* try to find matching event from arch standard values */ > struct event_struct *es; > @@ -498,8 +486,7 @@ try_fixup(const char *fn, char *arch_std, char **event, > char **desc, > if (!strcmp(arch_

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-25 Thread Andi Kleen
On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: > This patch adds new structure called 'json_event' inside jevents.h > file to improve the callback prototype inside jevent files. > Initially, whenever user want to add new field, they need to update > in all function callback which make

Re: [RFC] perf/jevents: Add new structure to pass json fields.

2020-08-25 Thread John Garry
On 25/08/2020 08:40, Kajol Jain wrote: This patch adds new structure called 'json_event' inside jevents.h file to improve the callback prototype inside jevent files. Initially, whenever user want to add new field, they need to update in all function callback which make it more and more complex wi

[RFC] perf/jevents: Add new structure to pass json fields.

2020-08-25 Thread Kajol Jain
This patch adds new structure called 'json_event' inside jevents.h file to improve the callback prototype inside jevent files. Initially, whenever user want to add new field, they need to update in all function callback which make it more and more complex with increased number of parmeters. With th