Re: [PATCH v13 02/14] perf, tools, jevents: Program to convert JSON file to C style file

2015-06-03 Thread Jiri Olsa
On Tue, Jun 02, 2015 at 10:12:02AM -0700, Sukadev Bhattiprolu wrote: SNIP > + > +static int process_mapfile(FILE *outfp, char *fpath) > +{ > + int n = 16384; > + FILE *mapfp; > + char *save; > + char *line, *p; > + int line_num; > + char *tblname; > + > + pr_info("%s:

Re: [PATCH v13 02/14] perf, tools, jevents: Program to convert JSON file to C style file

2015-06-03 Thread Jiri Olsa
On Tue, Jun 02, 2015 at 10:12:02AM -0700, Sukadev Bhattiprolu wrote: SNIP > + * If we fail to locate/process JSON and map files, create a NULL mapping > + * table. This would at least allow perf to build even if we can't find/use > + * the aliases. > + */ > +static void

Re: [PATCH v13 02/14] perf, tools, jevents: Program to convert JSON file to C style file

2015-06-03 Thread Jiri Olsa
On Tue, Jun 02, 2015 at 10:12:02AM -0700, Sukadev Bhattiprolu wrote: SNIP > + > +static char *file_name_to_table_name(char *fname) > +{ > + unsigned int i, j; > + int c; > + int n = 1024; /* use max variable length? */ I think this should be at least PATH_MAX, or you might

Re: [PATCH v13 02/14] perf, tools, jevents: Program to convert JSON file to C style file

2015-06-03 Thread Jiri Olsa
On Tue, Jun 02, 2015 at 10:12:02AM -0700, Sukadev Bhattiprolu wrote: SNIP + +static int process_mapfile(FILE *outfp, char *fpath) +{ + int n = 16384; + FILE *mapfp; + char *save; + char *line, *p; + int line_num; + char *tblname; + + pr_info(%s: Processing

Re: [PATCH v13 02/14] perf, tools, jevents: Program to convert JSON file to C style file

2015-06-03 Thread Jiri Olsa
On Tue, Jun 02, 2015 at 10:12:02AM -0700, Sukadev Bhattiprolu wrote: SNIP + +static char *file_name_to_table_name(char *fname) +{ + unsigned int i, j; + int c; + int n = 1024; /* use max variable length? */ I think this should be at least PATH_MAX, or you might

Re: [PATCH v13 02/14] perf, tools, jevents: Program to convert JSON file to C style file

2015-06-03 Thread Jiri Olsa
On Tue, Jun 02, 2015 at 10:12:02AM -0700, Sukadev Bhattiprolu wrote: SNIP + * If we fail to locate/process JSON and map files, create a NULL mapping + * table. This would at least allow perf to build even if we can't find/use + * the aliases. + */ +static void create_empty_mapping(const

[PATCH v13 02/14] perf, tools, jevents: Program to convert JSON file to C style file

2015-06-02 Thread Sukadev Bhattiprolu
From: Andi Kleen This is a modified version of an earlier patch by Andi Kleen. We expect architectures to describe the performance monitoring events for each CPU in a corresponding JSON file, which look like: [ { "EventCode": "0x00", "UMask": "0x01",

[PATCH v13 02/14] perf, tools, jevents: Program to convert JSON file to C style file

2015-06-02 Thread Sukadev Bhattiprolu
From: Andi Kleen a...@linux.intel.com This is a modified version of an earlier patch by Andi Kleen. We expect architectures to describe the performance monitoring events for each CPU in a corresponding JSON file, which look like: [ { EventCode: 0x00, UMask: 0x01,